cocoapods-acknowledgements 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab57b2637b279669a7dd0b4db49d6998da1ed244
4
- data.tar.gz: e982c6d053c1cc0b24c73bf96fde9b49054377d6
3
+ metadata.gz: 54435c0fb7730f387d1438481a57423e2413bc33
4
+ data.tar.gz: e569eaa1915a1ee46c297cb6f4c9900f642df897
5
5
  SHA512:
6
- metadata.gz: 25e5b279dcb470db443765d10eb684ad2b65f5952dbc410ee82eaafb7eee06f6641ce64d4050d10f7a2c59181f3d8c69c51c46515ed104bb78c2cf0daedf61b0
7
- data.tar.gz: e3c1fdead333ccd712641ca6f0209f7c89ab2bc4be92afa75a03d77f4e9c31d563a0f9e8a49ea8e07aeee06ae973e3933dbc7c9b5b87ac74d207544e33a11742
6
+ metadata.gz: 2917315ce1ad58239938d975d2e60647c5e07052be09878e9a7eaa90358b34611a2db36c3def382afa47dc5ce46d8353d0865abda526351aa91098c780f9e0b2
7
+ data.tar.gz: 7c689a4794cc670e1e26412f485575c4e3364ee8e8d446fefea90cc45fe1cd77f429ad32e0513e76a3edcb65d7968f08b9661c48f9ddb2999bb5c652141748bf
@@ -1,10 +1,24 @@
1
+ # Sets Travis to run the Ruby specs on OS X machines to be as close as possible
2
+ # to the user environment.
3
+ #
1
4
  language: objective-c
5
+ addons:
6
+ code_climate:
7
+ repo_token: 2926ae7ea0b2a6ced8b0d67efa235769ab85de1d9c9f6702f40d80bacec3c9c4
8
+
2
9
  env:
3
- # This is what 10.8.x comes with and we want to support that.
4
- - RVM_RUBY_VERSION=system NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo ln -s /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2' SSL_CERT_FILE=/usr/local/share/cacert.pem GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com PYTHONPATH=/usr/local/lib/python2.7/site-packages
5
- - RVM_RUBY_VERSION=2.0.0-p247 NOEXEC_DISABLE=1 RUBY_VERSION_SPECIFIC='sudo gem install bundler --no-ri --no-rdoc' GIT_AUTHOR_NAME=CocoaPods GIT_AUTHOR_EMAIL=cocoapods@example.com PYTHONPATH=/usr/local/lib/python2.7/site-packages
10
+ - RVM_RUBY_VERSION=system
11
+ # - RVM_RUBY_VERSION=1.8.7-p358
12
+
6
13
  before_install:
14
+ - export LANG=en_US.UTF-8
7
15
  - curl http://curl.haxx.se/ca/cacert.pem -o /usr/local/share/cacert.pem
8
- - source ~/.rvm/scripts/rvm && rvm use $RVM_RUBY_VERSION
9
- install: eval $RUBY_VERSION_SPECIFIC && rake bootstrap[use_bundle_dir]
10
- script: bundle exec rake spec:ci
16
+ - source ~/.rvm/scripts/rvm
17
+ - if [[ $RVM_RUBY_VERSION != 'system' ]]; then rvm install $RVM_RUBY_VERSION; fi
18
+ - rvm use $RVM_RUBY_VERSION
19
+ - if [[ $RVM_RUBY_VERSION == 'system' ]]; then sudo gem install bundler --no-ri --no-rdoc; else gem install bundler --no-ri --no-rdoc; fi
20
+
21
+ install:
22
+ - sudo bundle install --without=documentation
23
+
24
+ script: bundle exec rake spec
@@ -1,9 +1,41 @@
1
- # CocoaPods::Metadata Changelog
1
+ # CocoaPods Acknowledgements Changelog
2
2
 
3
3
  ## Master
4
4
 
5
5
  ##### Enhancements
6
6
 
7
+ * None.
8
+
9
+ ##### Bug Fixes
10
+
11
+ * None.
12
+
13
+
14
+ ## 1.1.0 (2016-03-08)
15
+
16
+ ##### Enhancements
17
+
18
+ * Exclude certain Pods from Acknowledgements.
19
+ [Marcelo Fabri](https://github.com/marcelofabri)
20
+ [#16](https://github.com/CocoaPods/cocoapods-acknowledgements/issues/16)
21
+
22
+ ##### Bug Fixes
23
+
24
+ * Supporting CocoaPods 1.0.
25
+ [Marcelo Fabri](https://github.com/marcelofabri)
26
+
27
+ * Fix adding same file multiple times to group.
28
+ [Marcelo Fabri](https://github.com/marcelofabri)
29
+
30
+ * Fix settings bundle style plists generation.
31
+ [Marcelo Fabri](https://github.com/marcelofabri)
32
+ [#20](https://github.com/CocoaPods/cocoapods-acknowledgements/issues/20)
33
+
34
+
35
+ ## 1.0
36
+
37
+ ##### Enhancements
38
+
7
39
  * Support Settings bundle style plists.
8
40
  [Marcelo Fabri](https://github.com/marcelofabri)
9
41
 
data/Gemfile CHANGED
@@ -7,6 +7,5 @@ group :development do
7
7
  gem 'bacon'
8
8
  gem 'mocha-on-bacon'
9
9
  gem 'mocha', '~> 0.11.4'
10
- gem 'rake'
11
- gem 'prettybacon', :git => 'https://github.com/irrationalfab/PrettyBacon.git', :branch => 'master'
10
+ gem 'prettybacon'
12
11
  end
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # CocoaPods Acknowledgements
2
2
 
3
- A CocoaPods plugin that generates a plist which includes the installation metadata. It supports generating two styles of dependency information.
3
+ A CocoaPods plugin that generates a plist which includes the installation metadata. It supports generating two styles of dependency information.
4
4
 
5
5
  * **Settings.bundle compatible plist** - This format is supported by a [large amount of pods](https://cocoapods.org/?q=acknow) and works with Apple's Settings.app.
6
6
 
@@ -27,10 +27,18 @@ plugin 'cocoapods-acknowledgements', :settings_bundle => true
27
27
  With a Settings.bundle compatible plist, offering the chance to run post-processing on the plist ( to add non-CocoaPods dependencies for example )
28
28
 
29
29
  ``` ruby
30
- plugin 'cocoapods-acknowledgements', :settings_bundle => true , :settings_post_process => Proc.new { |settings_plist_path, umbrella_target|
31
- puts settings_plist_path
30
+ plugin 'cocoapods-acknowledgements', :settings_bundle => true , :settings_post_process => Proc.new { |settings_plist_path, umbrella_target|
31
+ puts settings_plist_path
32
32
  puts umbrella_target.cocoapods_target_label
33
33
  }
34
34
  ```
35
35
 
36
- The plugin will search through the first two levels of your project to find a `Settings.bundle` file, and add the file to the bundle. If this is not enough for you, we'd love a PR.
36
+ The plugin will search through the first two levels of your project to find a `Settings.bundle` file, and add the file to the bundle. If this is not enough for you, we'd love a PR.
37
+
38
+ You can also exclude some dependencies so they won't be added to the generated plists. This is useful when you don't want to add private dependencies.
39
+
40
+ ```ruby
41
+ plugin 'cocoapods-acknowledgements', :settings_bundle => true, :exclude => 'PrivateKit'
42
+
43
+ plugin 'cocoapods-acknowledgements', :settings_bundle => true, :exclude => ['PrivateKit', 'SecretLib']
44
+ ```
@@ -3,7 +3,11 @@ module CocoaPodsAcknowledgements
3
3
  require 'cocoapods_acknowledgements/settings_plist_generator'
4
4
 
5
5
  def self.save_metadata(metadata, plist_path, project, sandbox, user_target_uuid)
6
- Xcodeproj.write_plist(metadata, plist_path)
6
+ if defined? Xcodeproj::Plist.write_to_path
7
+ Xcodeproj::Plist.write_to_path(metadata, plist_path)
8
+ else
9
+ Xcodeproj.write_plist(metadata, plist_path)
10
+ end
7
11
 
8
12
  # Find a root folder in the users Xcode Project called Pods, or make one
9
13
  cocoapods_group = project.main_group["Pods"]
@@ -12,7 +16,8 @@ module CocoaPodsAcknowledgements
12
16
  end
13
17
 
14
18
  # Add the example plist to the found CocoaPods group
15
- file_ref = cocoapods_group.files.find { |file| file.real_path == plist_path }
19
+ plist_pathname = Pathname.new(File.expand_path(plist_path))
20
+ file_ref = cocoapods_group.files.find { |file| file.real_path == plist_pathname }
16
21
  unless file_ref
17
22
  file_ref = cocoapods_group.new_file(plist_path)
18
23
  end
@@ -26,73 +31,73 @@ module CocoaPodsAcknowledgements
26
31
  project.save
27
32
 
28
33
  end
29
-
34
+
30
35
  # TODO: Code golf this
31
36
  def self.settings_bundle_in_project
32
37
  Dir.glob("**/*Settings.bundle").first
33
38
  end
34
-
39
+
35
40
  Pod::HooksManager.register('cocoapods-acknowledgements', :post_install) do |context, user_options|
36
41
  require 'cocoapods'
37
-
42
+ require 'set'
43
+
38
44
  # Until CocoaPods provides a HashWithIndifferentAccess, normalize the hash keys here.
39
45
  # See https://github.com/CocoaPods/CocoaPods/issues/3354
40
-
46
+
41
47
  user_options.inject({}) do |normalized_hash, (key, value)|
42
48
  normalized_hash[key.to_s] = value
43
49
  normalized_hash
44
50
  end
45
-
51
+
46
52
  Pod::UI.section 'Adding Acknowledgements' do
47
53
 
48
54
  should_include_settings = user_options["settings_bundle"] != nil
55
+ excluded_pods = Set.new(user_options["exclude"])
49
56
 
50
57
  sandbox = context.sandbox if defined? context.sandbox
51
58
  sandbox ||= Pod::Sandbox.new(context.sandbox_root)
52
59
 
53
60
  context.umbrella_targets.each do |umbrella_target|
54
61
  project = Xcodeproj::Project.open(umbrella_target.user_project_path)
55
-
62
+
56
63
  umbrella_target.user_target_uuids.each do |user_target_uuid|
57
-
64
+
58
65
  # Generate a plist representing all of the podspecs
59
- metadata = PlistGenerator.generate(umbrella_target, sandbox)
60
-
66
+ metadata = PlistGenerator.generate(umbrella_target, sandbox, excluded_pods)
67
+
61
68
  next unless metadata
62
-
69
+
63
70
  plist_path = sandbox.root + "#{umbrella_target.cocoapods_target_label}-metadata.plist"
64
71
  save_metadata(metadata, plist_path, project, sandbox, user_target_uuid)
65
-
72
+
66
73
  if should_include_settings
67
74
  # Generate a plist in Settings format
68
- settings_metadata = SettingsPlistGenerator.generate(umbrella_target, sandbox)
75
+ settings_metadata = SettingsPlistGenerator.generate(umbrella_target, sandbox, excluded_pods)
69
76
 
70
77
  # We need to look for a Settings.bundle
71
78
  # and add this to the root of the bundle
72
-
79
+
73
80
  settings_bundle = settings_bundle_in_project
74
81
  if settings_bundle == nil
75
82
  Pod::UI.warn "Could not find a Settings.bundle to add the Pod Settings Plist to."
76
83
  else
77
84
  settings_plist_path = settings_bundle + "/#{umbrella_target.cocoapods_target_label}-settings-metadata.plist"
78
- FileUtils.cp(plist_path, settings_plist_path)
85
+ save_metadata(settings_metadata, settings_plist_path, project, sandbox, user_target_uuid)
79
86
  Pod::UI.info "Added Pod info to Settings.bundle for target #{umbrella_target.cocoapods_target_label}"
80
-
87
+
81
88
  # Support a callback for the key :settings_post_process
82
89
  if user_options["settings_post_process"]
83
- user_options["settings_post_process"].call(settings_plist_path, umbrella_target)
90
+ user_options["settings_post_process"].call(settings_plist_path, umbrella_target, excluded_pods)
84
91
  end
85
-
92
+
86
93
  end
87
94
  end
88
95
 
89
96
  end
90
-
97
+
91
98
  end
92
-
99
+
93
100
  end
94
-
101
+
95
102
  end
96
103
  end
97
-
98
-
@@ -8,8 +8,8 @@ module CocoaPodsAcknowledgements
8
8
  @markdown_parser ||= Redcarpet::Markdown.new(Redcarpet::Render::HTML)
9
9
  end
10
10
 
11
- def generate(target_description, sandbox)
12
- root_specs = target_description.specs.map(&:root).uniq
11
+ def generate(target_description, sandbox, excluded)
12
+ root_specs = target_description.specs.map(&:root).uniq.reject { |spec| excluded.include?(spec.name) }
13
13
 
14
14
  return nil if root_specs.empty?
15
15
 
@@ -84,4 +84,3 @@ module CocoaPodsAcknowledgements
84
84
  end
85
85
  end
86
86
  end
87
-
@@ -4,8 +4,8 @@ module CocoaPodsAcknowledgements
4
4
  class SettingsPlistGenerator < PlistGenerator
5
5
  class << self
6
6
 
7
- def generate(target_description, sandbox)
8
- root_specs = target_description.specs.map(&:root).uniq
7
+ def generate(target_description, sandbox, excluded)
8
+ root_specs = target_description.specs.map(&:root).uniq.reject { |spec| excluded.include?(spec.name) }
9
9
 
10
10
  return nil if root_specs.empty?
11
11
 
@@ -40,7 +40,7 @@ module CocoaPodsAcknowledgements
40
40
  "Type" => "PSGroupSpecifier"
41
41
  }
42
42
  end
43
-
43
+
44
44
  def footer
45
45
  footer = {
46
46
  "FooterText" => "Generated by CocoaPods - http://cocoapods.org",
@@ -51,4 +51,3 @@ module CocoaPodsAcknowledgements
51
51
  end
52
52
  end
53
53
  end
54
-
@@ -1,3 +1,3 @@
1
1
  module CocoaPodsAcknowledgements
2
- VERSION = "1.0.0"
2
+ VERSION = "1.1.0"
3
3
  end
@@ -1,2 +1 @@
1
1
  require 'cocoapods_acknowledgements'
2
-
@@ -0,0 +1,5 @@
1
+ require File.expand_path('../spec_helper.rb', __FILE__)
2
+
3
+ describe CocoaPodsAcknowledgements do
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ require File.expand_path('../spec_helper.rb', __FILE__)
2
+
3
+ describe CocoaPodsAcknowledgements::PlistGenerator do
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ require File.expand_path('../spec_helper.rb', __FILE__)
2
+
3
+ describe CocoaPodsAcknowledgements::SettingsPlistGenerator do
4
+
5
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-acknowledgements
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fabio Pelosin
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2015-11-19 00:00:00.000000000 Z
13
+ date: 2016-03-10 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: redcarpet
@@ -73,6 +73,9 @@ files:
73
73
  - lib/cocoapods_acknowledgements/settings_plist_generator.rb
74
74
  - lib/cocoapods_acknowledgements/version.rb
75
75
  - lib/cocoapods_plugin.rb
76
+ - spec/acknowledgement_spec.rb
77
+ - spec/plist_generator_spec.rb
78
+ - spec/settings_plist_generator_spec.rb
76
79
  - spec/spec_helper.rb
77
80
  homepage: https://github.com/CocoaPods/cocoapods-acknowledgements
78
81
  licenses:
@@ -94,11 +97,13 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
97
  version: '0'
95
98
  requirements: []
96
99
  rubyforge_project:
97
- rubygems_version: 2.2.2
100
+ rubygems_version: 2.6.1
98
101
  signing_key:
99
102
  specification_version: 4
100
103
  summary: CocoaPods plugin that generates an acknowledgements plist to make it easy
101
104
  to create tools to use in apps.
102
105
  test_files:
106
+ - spec/acknowledgement_spec.rb
107
+ - spec/plist_generator_spec.rb
108
+ - spec/settings_plist_generator_spec.rb
103
109
  - spec/spec_helper.rb
104
- has_rdoc: