require 'cocoapods_acknowledgements/plist_generator' module CocoaPodsAcknowledgements class SettingsPlistGenerator < PlistGenerator class << self def generate(target_description, sandbox) root_specs = target_description.specs.map(&:root).uniq 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