cocoapods 0.37.2 → 0.38.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (56) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +136 -1
  3. data/lib/cocoapods.rb +0 -5
  4. data/lib/cocoapods/command.rb +3 -0
  5. data/lib/cocoapods/command/cache.rb +28 -0
  6. data/lib/cocoapods/command/cache/clean.rb +90 -0
  7. data/lib/cocoapods/command/cache/list.rb +69 -0
  8. data/lib/cocoapods/command/lib.rb +11 -4
  9. data/lib/cocoapods/command/list.rb +4 -4
  10. data/lib/cocoapods/command/outdated.rb +1 -10
  11. data/lib/cocoapods/command/project.rb +3 -2
  12. data/lib/cocoapods/command/spec.rb +0 -17
  13. data/lib/cocoapods/command/spec/cat.rb +1 -1
  14. data/lib/cocoapods/command/spec/create.rb +1 -0
  15. data/lib/cocoapods/command/spec/edit.rb +1 -1
  16. data/lib/cocoapods/command/spec/lint.rb +10 -4
  17. data/lib/cocoapods/config.rb +6 -0
  18. data/lib/cocoapods/downloader/cache.rb +48 -1
  19. data/lib/cocoapods/executable.rb +27 -6
  20. data/lib/cocoapods/gem_version.rb +1 -1
  21. data/lib/cocoapods/generator/copy_resources_script.rb +1 -0
  22. data/lib/cocoapods/generator/embed_frameworks_script.rb +23 -28
  23. data/lib/cocoapods/generator/header.rb +5 -1
  24. data/lib/cocoapods/generator/umbrella_header.rb +1 -1
  25. data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +139 -33
  26. data/lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb +2 -2
  27. data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +3 -3
  28. data/lib/cocoapods/installer.rb +64 -109
  29. data/lib/cocoapods/installer/analyzer.rb +167 -336
  30. data/lib/cocoapods/installer/analyzer/analysis_result.rb +46 -0
  31. data/lib/cocoapods/installer/analyzer/specs_state.rb +76 -0
  32. data/lib/cocoapods/installer/analyzer/target_inspection_result.rb +41 -0
  33. data/lib/cocoapods/installer/analyzer/target_inspector.rb +203 -0
  34. data/lib/cocoapods/installer/file_references_installer.rb +48 -13
  35. data/lib/cocoapods/installer/podfile_validator.rb +86 -0
  36. data/lib/cocoapods/installer/{hooks_context.rb → post_install_hooks_context.rb} +3 -3
  37. data/lib/cocoapods/installer/pre_install_hooks_context.rb +41 -0
  38. data/lib/cocoapods/installer/target_installer.rb +1 -7
  39. data/lib/cocoapods/installer/target_installer/aggregate_target_installer.rb +15 -17
  40. data/lib/cocoapods/installer/target_installer/pod_target_installer.rb +4 -4
  41. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +16 -16
  42. data/lib/cocoapods/sandbox/file_accessor.rb +20 -2
  43. data/lib/cocoapods/sandbox/path_list.rb +15 -13
  44. data/lib/cocoapods/sandbox/podspec_finder.rb +1 -0
  45. data/lib/cocoapods/sources_manager.rb +2 -0
  46. data/lib/cocoapods/target.rb +7 -37
  47. data/lib/cocoapods/target/aggregate_target.rb +25 -1
  48. data/lib/cocoapods/target/pod_target.rb +106 -10
  49. data/lib/cocoapods/user_interface.rb +26 -0
  50. data/lib/cocoapods/user_interface/error_report.rb +6 -0
  51. data/lib/cocoapods/validator.rb +22 -0
  52. metadata +21 -16
  53. data/lib/cocoapods/generator/target_environment_header.rb +0 -171
  54. data/lib/cocoapods/hooks/installer_representation.rb +0 -133
  55. data/lib/cocoapods/hooks/library_representation.rb +0 -93
  56. data/lib/cocoapods/hooks/pod_representation.rb +0 -70
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4ed679b638bf5ed300ac3daccdab5a2a743e05fd
4
- data.tar.gz: dc94976d0009a55f4ddda7263b22bb6d911b6f41
3
+ metadata.gz: 2feed1ca56697903e9fd3849cded89caf79d34f2
4
+ data.tar.gz: e1394343cb071b7a16c575f401fdbc6cc338afe2
5
5
  SHA512:
6
- metadata.gz: 0a898eb51485877f897b2356dcfdd77b8cfe730c7545b464a08a5fae673e0643f5fab8ca68d9ffdc9bb5ff22096767379d5c20213237c0d9f1ab34eda4dbbcab
7
- data.tar.gz: 76ee168bc5a7100dac38cc99e61418c9f6e6a1b43f35c4302d59e1b3af7cf3bd9549e0fedc15ad81574519aa4a65b60fbedac5a32772ff9ce47855b706220990
6
+ metadata.gz: b35df5747f1ab5083110017ab5409d10e7222b7be3c9c83f358d3b7f3768cc94c8b37476c51ba7e34e3259bf54ee5a8e7dcc11aedafa596d80beaaf0a424a4ac
7
+ data.tar.gz: 9c6bfce82407c052d93e9670afafce88dff908329cbd92f7be63e1f5dad74c7e90aeca8ff9fc26ca022d21439f8f4fbbd83786b2579a66bfd9c7b5636312f393
@@ -4,6 +4,142 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
4
4
 
5
5
  To install release candidates run `[sudo] gem install cocoapods --pre`
6
6
 
7
+ ## 0.38.0.beta.1
8
+
9
+ ##### Highlighted Enhancement That Needs Testing
10
+
11
+ * De-duplicate Pod Targets: CocoaPods now recognizes when a dependency is used
12
+ multiple times across different user targets, but needs to be built only once.
13
+ The targets in `Pods.xcodeproj` need to be duplicated when one of the following
14
+ applies:
15
+ * They are used on different platforms.
16
+ * They are used with differents sets of subspecs.
17
+ * They have any dependency which needs to be duplicated.
18
+
19
+ You can opt-out of this behavior installation-wise, by setting the following
20
+ option in your ``~/.cocoapods/config.yaml`:
21
+ ```yaml
22
+ deduplicate_targets: false
23
+ ```
24
+
25
+ [Marius Rackwitz](https://github.com/mrackwitz)
26
+ [#3550](https://github.com/CocoaPods/CocoaPods/issues/3550)
27
+
28
+ ##### Breaking
29
+
30
+ * The CocoaPods environment header has been removed.
31
+ [Samuel Giddins](https://github.com/segiddins)
32
+ [#2390](https://github.com/CocoaPods/CocoaPods/issues/2390)
33
+
34
+ * The `Installer` is passed directly to the `pre_install` and `post_install`
35
+ hooks defined in the Podfile, instead of the previously used
36
+ `Hooks::InstallerRepresentation`.
37
+ [Marius Rackwitz](https://github.com/mrackwitz)
38
+ [#3648](https://github.com/CocoaPods/CocoaPods/issues/3648)
39
+
40
+ * Deprecate the `xcconfig` attribute in the Podspec DSL, which is replaced by
41
+ the new attributes `pod_target_xcconfig` and `user_target_xcconfig`.
42
+ [Marius Rackwitz](https://github.com/mrackwitz)
43
+ [CocoaPods#3465](https://github.com/CocoaPods/CocoaPods/issues/3465)
44
+
45
+ ##### Enhancements
46
+
47
+ * The notice about a new version being available will now include our
48
+ recommendation of using the latest stable version.
49
+ [Hugo Tunius](https://github.com/k0nserv)
50
+
51
+ * New commands `pod cache list` and `pod cache clean` allows you to see the
52
+ contents of the cache and clean it.
53
+ [Olivier Halligon](https://github.com/AliSoftware)
54
+ [#3508](https://github.com/CocoaPods/CocoaPods/issues/3508)
55
+
56
+ * The download cache will automatically be reset when changing CocoaPods
57
+ versions.
58
+ [Samuel Giddins](https://github.com/segiddins)
59
+ [#3542](https://github.com/CocoaPods/CocoaPods/issues/3542)
60
+
61
+ * Supports running pre-install hooks in plugins. This happens before the resolver
62
+ does its work, and offers easy access to the sandbox, podfile and lockfile via a
63
+ `PreInstallHooksContext` object. This also renames the post-install hooks from `HooksContext`
64
+ to `PostInstallHooksContext`.
65
+ [Orta Therox](https://github.com/orta)
66
+ [#3540](https://github.com/CocoaPods/cocoapods/issues/3409)
67
+
68
+ * Allow passing additional arguments to `pod lib create`, which then get passed
69
+ as-is to the `configure` scripts.
70
+ [Samuel Giddins](https://github.com/segiddins)
71
+ [#2160](https://github.com/CocoaPods/CocoaPods/issues/2160)
72
+
73
+ * Use `-analyzer-disable-all-checks` to disable static analyzer for
74
+ pods with `inhibit_warnings` enabled (requires Xcode >= 6.1).
75
+ [Dieter Komendera](https://github.com/kommen)
76
+ [#2402](https://github.com/CocoaPods/CocoaPods/issues/2402)
77
+
78
+ * Cache globbing in `PathList` to speed up `pod install`.
79
+ [Vincent Isambart](https://github.com/vincentisambart)
80
+
81
+ * CocoaPods will validate your podfile and try to identify problems
82
+ and conflicts in how you've specified the dependencies.
83
+ [Hugo Tunius](https://github.com/k0nserv)
84
+ [#995](https://github.com/CocoaPods/CocoaPods/issues/995)
85
+
86
+ * `pod update` will now accept root pod names, even when only subspecs are
87
+ installed.
88
+ [Samuel Giddins](https://github.com/segiddins)
89
+ [#3689](https://github.com/CocoaPods/CocoaPods/issues/3689)
90
+
91
+ * Support for the new `watchos` platform.
92
+ [Boris Bügling](https://github.com/neonichu)
93
+ [#3681](https://github.com/CocoaPods/CocoaPods/pull/3681)
94
+
95
+ ##### Bug Fixes
96
+
97
+ * Added recursive support to the public headers of vendored frameworks
98
+ that are automatically linked in the sandbox. This fixes and issue
99
+ for framework header directories that contain sub-directories.
100
+ [Todd Casey](https://github.com/vhariable)
101
+ [#3161](https://github.com/CocoaPods/CocoaPods/issues/3161)
102
+
103
+ * Public headers of vendored frameworks are now automatically linked in
104
+ the sandbox. That allows transitive inclusion of headers from other pods.
105
+ [Vincent Isambart](https://github.com/vincentisambart)
106
+ [#3161](https://github.com/CocoaPods/CocoaPods/issues/3161)
107
+
108
+ * Fixes an issue that prevented static libraries from building. `OTHER_LIBTOOLFLAGS`
109
+ is no longer set to the value of `OTHER_LDFLAGS`. If you want to create a static
110
+ library that includes all dependencies for (internal/external) distribution then
111
+ you should use a tool like `cocoapods-packager`.
112
+ [Michael Moscardini](https://github.com/themackworth)
113
+ [#2747](https://github.com/CocoaPods/CocoaPods/issues/2747)
114
+ [#2704](https://github.com/CocoaPods/CocoaPods/issues/2704)
115
+
116
+ * The embed frameworks script will now properly filter out symlinks to the
117
+ directories that are filtered, which fixes an issue when submitting to the
118
+ Mac App Store.
119
+ [Samuel Giddins](https://github.com/segiddins)
120
+
121
+ * The error report template is now more robust against missing executables.
122
+ [Samuel Giddins](https://github.com/segiddins)
123
+ [#3719](https://github.com/CocoaPods/CocoaPods/issues/3719)
124
+
125
+ * Attempting to specify a `git` source where a Podspec for the requested pod is
126
+ not found will have a more helpful error message.
127
+ [Samuel Giddins](https://github.com/segiddins)
128
+
129
+ * `pod outdated` will now accept the `--no-repo-update` and `--no-integrate`
130
+ options.
131
+ [Samuel Giddins](https://github.com/segiddins)
132
+
133
+ * Fixes an issue which prevented using a custom `CONFIGURATION_BUILD_DIR` when
134
+ integrating CocoaPods via dynamic frameworks.
135
+ [Tim Rosenblatt](https://github.com/timrosenblatt)
136
+ [#3675](https://github.com/CocoaPods/CocoaPods/pull/3675)
137
+
138
+ * Pods frameworks in codesigned Mac apps are now signed.
139
+ [Nikolaj Schumacher](https://github.com/nschum)
140
+ [#3646](https://github.com/CocoaPods/CocoaPods/issues/3646)
141
+
142
+
7
143
  ## 0.37.2
8
144
 
9
145
  ##### Enhancements
@@ -32,7 +168,6 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
32
168
  [Boris Bügling](https://github.com/neonichu)
33
169
  [#3500](https://github.com/CocoaPods/CocoaPods/issues/3500)
34
170
 
35
-
36
171
  ## 0.37.1
37
172
 
38
173
  ##### Bug Fixes
@@ -64,7 +64,6 @@ module Pod
64
64
  autoload :InfoPlistFile, 'cocoapods/generator/info_plist_file'
65
65
  autoload :ModuleMap, 'cocoapods/generator/module_map'
66
66
  autoload :PrefixHeader, 'cocoapods/generator/prefix_header'
67
- autoload :TargetEnvironmentHeader, 'cocoapods/generator/target_environment_header'
68
67
  autoload :UmbrellaHeader, 'cocoapods/generator/umbrella_header'
69
68
  autoload :XCConfig, 'cocoapods/generator/xcconfig'
70
69
  end
@@ -75,7 +74,3 @@ module Pod
75
74
  autoload :PodRepresentation, 'cocoapods/hooks/pod_representation'
76
75
  end
77
76
  end
78
-
79
- if ENV['COCOA_PODS_ENV'] == 'development'
80
- # require 'awesome_print'
81
- end
@@ -24,6 +24,7 @@ module Pod
24
24
  require 'cocoapods/command/setup'
25
25
  require 'cocoapods/command/spec'
26
26
  require 'cocoapods/command/init'
27
+ require 'cocoapods/command/cache'
27
28
 
28
29
  self.abstract_command = true
29
30
  self.command = 'pod'
@@ -32,6 +33,7 @@ module Pod
32
33
  self.plugin_prefixes = %w(claide cocoapods)
33
34
 
34
35
  [Install, Update, Outdated, IPC::Podfile, IPC::Repl].each { |c| c.send(:include, ProjectDirectory) }
36
+ [Outdated].each { |c| c.send(:include, Project) }
35
37
 
36
38
  def self.options
37
39
  [
@@ -44,6 +46,7 @@ module Pod
44
46
  verify_xcode_license_approved!
45
47
 
46
48
  super(argv)
49
+ ensure
47
50
  UI.print_warnings
48
51
  end
49
52
 
@@ -0,0 +1,28 @@
1
+ require 'cocoapods/downloader'
2
+ require 'cocoapods/command/cache/list'
3
+ require 'cocoapods/command/cache/clean'
4
+
5
+ module Pod
6
+ class Command
7
+ class Cache < Command
8
+ self.abstract_command = true
9
+ self.summary = 'Manipulate the CocoaPods cache'
10
+
11
+ self.description = <<-DESC
12
+ Manipulate the download cache for pods, like printing the cache content
13
+ or cleaning the pods cache.
14
+ DESC
15
+
16
+ def initialize(argv)
17
+ @cache = Downloader::Cache.new(Config.instance.cache_root + 'Pods')
18
+ super
19
+ end
20
+
21
+ private
22
+
23
+ def pod_type(pod_cache_descriptor)
24
+ pod_cache_descriptor[:release] ? 'Release' : 'External'
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,90 @@
1
+ module Pod
2
+ class Command
3
+ class Cache < Command
4
+ class Clean < Cache
5
+ self.summary = 'Remove the cache for pods'
6
+
7
+ self.description = <<-DESC
8
+ Remove the cache for a given pod, or clear the cache completely.
9
+
10
+ If there is multiple cache for various versions of the requested pod,
11
+ you will be asked which one to clean. Use `--all` to clean them all.
12
+
13
+ If you don't give a pod `NAME`, you need to specify the `--all`
14
+ flag (this is to avoid cleaning all the cache by mistake).
15
+ DESC
16
+
17
+ self.arguments = [
18
+ CLAide::Argument.new('NAME', false),
19
+ ]
20
+
21
+ def self.options
22
+ [[
23
+ '--all', 'Remove all the cached pods without asking'
24
+ ]].concat(super)
25
+ end
26
+
27
+ def initialize(argv)
28
+ @pod_name = argv.shift_argument
29
+ @wipe_all = argv.flag?('all')
30
+ super
31
+ end
32
+
33
+ def run
34
+ if @pod_name.nil?
35
+ # Note: at that point, @wipe_all is always true (thanks to `validate!`)
36
+ # Remove all
37
+ clear_cache
38
+ else
39
+ # Remove only cache for this pod
40
+ cache_descriptors = @cache.cache_descriptors_per_pod[@pod_name]
41
+ if cache_descriptors.nil?
42
+ UI.notice("No cache for pod named #{@pod_name} found")
43
+ elsif cache_descriptors.count > 1 && !@wipe_all
44
+ # Ask which to remove
45
+ choices = cache_descriptors.map { |c| "#{@pod_name} v#{c[:version]} (#{pod_type(c)})" }
46
+ index = UI.choose_from_array(choices, 'Which pod cache do you want to remove?')
47
+ remove_caches([cache_descriptors[index]])
48
+ else
49
+ # Remove all found cache of this pod
50
+ remove_caches(cache_descriptors)
51
+ end
52
+ end
53
+ end
54
+
55
+ def validate!
56
+ super
57
+ if @pod_name.nil? && !@wipe_all
58
+ # Security measure, to avoid removing the pod cache too agressively by mistake
59
+ help! 'You should either specify a pod name or use the --all flag'
60
+ end
61
+ end
62
+
63
+ private
64
+
65
+ # Removes the specified cache
66
+ #
67
+ # @param [Array<Hash>] cache_descriptors
68
+ # An array of caches to remove, each specified with the same
69
+ # hash as cache_descriptors_per_pod especially :spec_file and :slug
70
+ #
71
+ def remove_caches(cache_descriptors)
72
+ cache_descriptors.each do |desc|
73
+ UI.message("Removing spec #{desc[:spec_file]} (v#{desc[:version]})") do
74
+ FileUtils.rm(desc[:spec_file])
75
+ end
76
+ UI.message("Removing cache #{desc[:slug]}") do
77
+ FileUtils.rm_rf(desc[:slug])
78
+ end
79
+ end
80
+ end
81
+
82
+ def clear_cache
83
+ UI.message("Removing the whole cache dir #{@cache.root}") do
84
+ FileUtils.rm_rf(@cache.root)
85
+ end
86
+ end
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,69 @@
1
+ module Pod
2
+ class Command
3
+ class Cache < Command
4
+ class List < Cache
5
+ self.summary = 'List the paths of pod caches for each known pod'
6
+
7
+ self.description = <<-DESC
8
+ Shows the content of the pods cache as a YAML tree output, organized by pod.
9
+ If `NAME` is given, only the caches for that pod will be included in the output.
10
+ DESC
11
+
12
+ self.arguments = [
13
+ CLAide::Argument.new('NAME', false),
14
+ ]
15
+
16
+ def self.options
17
+ [[
18
+ '--short', 'Only print the path relative to the cache root'
19
+ ]].concat(super)
20
+ end
21
+
22
+ def initialize(argv)
23
+ @pod_name = argv.shift_argument
24
+ @short_output = argv.flag?('short')
25
+ super
26
+ end
27
+
28
+ def run
29
+ UI.puts("$CACHE_ROOT: #{@cache.root}") if @short_output
30
+ if @pod_name.nil? # Print all
31
+ @cache.cache_descriptors_per_pod.each do |pod_name, cache_descriptors|
32
+ print_pod_cache_infos(pod_name, cache_descriptors)
33
+ end
34
+ else # Print only for the requested pod
35
+ cache_descriptors = @cache.cache_descriptors_per_pod[@pod_name]
36
+ if cache_descriptors.nil?
37
+ UI.notice("No cache for pod named #{@pod_name} found")
38
+ else
39
+ print_pod_cache_infos(@pod_name, cache_descriptors)
40
+ end
41
+ end
42
+ end
43
+
44
+ private
45
+
46
+ # Prints the list of specs & pod cache dirs for a single pod name.
47
+ #
48
+ # This output is valid YAML so it can be parsed with 3rd party tools
49
+ #
50
+ # @param [Array<Hash>] cache_descriptors
51
+ # The various infos about a pod cache. Keys are
52
+ # :spec_file, :version, :release and :slug
53
+ #
54
+ def print_pod_cache_infos(pod_name, cache_descriptors)
55
+ UI.puts "#{pod_name}:"
56
+ cache_descriptors.each do |desc|
57
+ if @short_output
58
+ [:spec_file, :slug].each { |k| desc[k] = desc[k].relative_path_from(@cache.root) }
59
+ end
60
+ UI.puts(" - Version: #{desc[:version]}")
61
+ UI.puts(" Type: #{pod_type(desc)}")
62
+ UI.puts(" Spec: #{desc[:spec_file]}")
63
+ UI.puts(" Pod: #{desc[:slug]}")
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
69
+ end
@@ -18,13 +18,20 @@ module Pod
18
18
 
19
19
  self.arguments = [
20
20
  CLAide::Argument.new('NAME', true),
21
- CLAide::Argument.new('TEMPLATE_URL', false),
22
21
  ]
23
22
 
23
+ def self.options
24
+ [
25
+ ['--template-url=URL', 'The URL of the git repo containing a ' \
26
+ 'compatible template'],
27
+ ].concat(super)
28
+ end
29
+
24
30
  def initialize(argv)
25
31
  @name = argv.shift_argument
26
- @template_url = argv.shift_argument
32
+ @template_url = argv.option('template-url', TEMPLATE_REPO)
27
33
  super
34
+ @additional_args = argv.remainder!
28
35
  end
29
36
 
30
37
  def validate!
@@ -72,7 +79,7 @@ module Pod
72
79
  UI.section("Configuring #{@name} template.") do
73
80
  Dir.chdir(@name) do
74
81
  if File.exist?('configure')
75
- system("./configure #{@name}")
82
+ system('./configure', @name, *@additional_args)
76
83
  else
77
84
  UI.warn 'Template does not have a configure file.'
78
85
  end
@@ -160,7 +167,7 @@ module Pod
160
167
  else
161
168
  spec_name = podspec
162
169
  spec_name = validator.spec.name if validator.spec
163
- message = "#{spec_name} did not pass validation."
170
+ message = "#{spec_name} did not pass validation, due to #{validator.failure_reason}."
164
171
 
165
172
  if @clean
166
173
  message << "\nYou can use the `--no-clean` option to inspect " \
@@ -5,10 +5,10 @@ module Pod
5
5
  self.description = 'Lists all available pods.'
6
6
 
7
7
  def self.options
8
- [[
9
- '--update', 'Run `pod repo update` before listing',
10
- '--stats', 'Show additional stats (like GitHub watchers and forks)'
11
- ]].concat(super)
8
+ [
9
+ ['--update', 'Run `pod repo update` before listing'],
10
+ ['--stats', 'Show additional stats (like GitHub watchers and forks)'],
11
+ ].concat(super)
12
12
  end
13
13
 
14
14
  def initialize(argv)