Class: CocoaPodsAcknowledgements::SettingsPlistGenerator

Inherits:
PlistGenerator
  • Object
show all
Defined in:
lib/cocoapods_acknowledgements/settings_plist_generator.rb

Class Method Summary collapse

Methods inherited from PlistGenerator

file_accessor, license_text, markdown_parser, parse_markdown

Class Method Details



44
45
46
47
48
49
50
# File 'lib/cocoapods_acknowledgements/settings_plist_generator.rb', line 44

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

.generate(target_description, sandbox, excluded) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/cocoapods_acknowledgements/settings_plist_generator.rb', line 8

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?

   = [header]

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

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

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

.headerObject



36
37
38
39
40
41
42
# File 'lib/cocoapods_acknowledgements/settings_plist_generator.rb', line 36

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