Sha256: ccfbc512c3b1ff890942c0a5c8e8a00e035490b39c43ff1d16fbd5423f02376c

Contents?: true

Size: 1.52 KB

Versions: 4

Compression:

Stored size: 1.52 KB

Contents

require 'cocoapods_acknowledgements/plist_generator'

module CocoaPodsAcknowledgements
  class SettingsPlistGenerator < PlistGenerator
    class << self

      def generate(target_description, sandbox, excluded)
        root_specs = target_description.specs.map(&:root).uniq.reject { |spec| excluded.include?(spec.name) }

        return nil if root_specs.empty?

        specs_metadata = [header]

        root_specs.each do |spec|
          pod_root = sandbox.pod_dir(spec.name)
          platform = Pod::Platform.new(target_description.platform_name)
          file_accessor = file_accessor(spec, platform, sandbox)
          license_text = license_text(spec, file_accessor)

          spec_metadata = {
            "Title" => spec.name,
            "Type" => "PSGroupSpecifier",
            "FooterText" => license_text
          }
          specs_metadata << spec_metadata
        end

        specs_metadata << footer
        metadata = {
          "PreferenceSpecifiers" => specs_metadata,
          "Title" => "Acknowledgements",
          "StringsTable" => "Acknowledgements"
        }
      end

      def header
        header = {
          "FooterText" => "This application makes use of the following third party libraries:",
          "Title" => "Acknowledgements",
          "Type" => "PSGroupSpecifier"
        }
      end

      def footer
        footer = {
          "FooterText" => "Generated by CocoaPods - http://cocoapods.org",
          "Title" => nil,
          "Type" => "PSGroupSpecifier"
        }
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
cocoapods-acknowledgements-1.1.3 lib/cocoapods_acknowledgements/settings_plist_generator.rb
cocoapods-acknowledgements-1.1.2 lib/cocoapods_acknowledgements/settings_plist_generator.rb
cocoapods-acknowledgements-1.1.1 lib/cocoapods_acknowledgements/settings_plist_generator.rb
cocoapods-acknowledgements-1.1.0 lib/cocoapods_acknowledgements/settings_plist_generator.rb