cocoapods 0.34.4 → 0.35.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +108 -1
  3. data/bin/pod +20 -2
  4. data/lib/cocoapods.rb +1 -0
  5. data/lib/cocoapods/command.rb +17 -11
  6. data/lib/cocoapods/command/repo/push.rb +1 -1
  7. data/lib/cocoapods/command/search.rb +1 -0
  8. data/lib/cocoapods/gem_version.rb +1 -1
  9. data/lib/cocoapods/generator/acknowledgements/plist.rb +4 -10
  10. data/lib/cocoapods/generator/header.rb +75 -0
  11. data/lib/cocoapods/generator/prefix_header.rb +15 -34
  12. data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +2 -2
  13. data/lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb +4 -1
  14. data/lib/cocoapods/hooks/library_representation.rb +1 -1
  15. data/lib/cocoapods/installer.rb +3 -3
  16. data/lib/cocoapods/installer/analyzer.rb +35 -37
  17. data/lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb +72 -0
  18. data/lib/cocoapods/installer/file_references_installer.rb +10 -9
  19. data/lib/cocoapods/installer/target_installer.rb +21 -21
  20. data/lib/cocoapods/installer/target_installer/aggregate_target_installer.rb +17 -17
  21. data/lib/cocoapods/installer/target_installer/pod_target_installer.rb +19 -19
  22. data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +7 -3
  23. data/lib/cocoapods/project.rb +1 -1
  24. data/lib/cocoapods/resolver.rb +235 -98
  25. data/lib/cocoapods/resolver/lazy_specification.rb +60 -0
  26. data/lib/cocoapods/sandbox.rb +2 -1
  27. data/lib/cocoapods/sandbox/file_accessor.rb +26 -19
  28. data/lib/cocoapods/sandbox/headers_store.rb +12 -7
  29. data/lib/cocoapods/sources_manager.rb +6 -6
  30. data/lib/cocoapods/target.rb +1 -1
  31. data/lib/cocoapods/target/pod_target.rb +2 -2
  32. data/lib/cocoapods/user_interface.rb +1 -1
  33. data/lib/cocoapods/user_interface/error_report.rb +3 -0
  34. data/lib/cocoapods/validator.rb +2 -2
  35. metadata +21 -26
  36. data/lib/cocoapods/command/push.rb +0 -21
@@ -0,0 +1,60 @@
1
+ module Pod
2
+ class Specification
3
+ class Set
4
+ class LazySpecification < BasicObject
5
+ attr_reader :name, :version, :source
6
+
7
+ def initialize(name, version, source)
8
+ @name = name
9
+ @version = version
10
+ @source = source
11
+ end
12
+
13
+ def method_missing(method, *args, &block)
14
+ specification.send(method, *args, &block)
15
+ end
16
+
17
+ def subspec_by_name(name = nil, raise_if_missing = true)
18
+ if !name || name == self.name
19
+ self
20
+ else
21
+ specification.subspec_by_name(name, raise_if_missing)
22
+ end
23
+ end
24
+
25
+ def specification
26
+ @specification ||= source.specification(name, version)
27
+ end
28
+ end
29
+
30
+ class External
31
+ def all_specifications
32
+ [specification]
33
+ end
34
+ end
35
+
36
+ def all_specifications
37
+ @all_specifications ||= begin
38
+ sources_by_version = {}
39
+ versions_by_source.each do |source, versions|
40
+ versions.each { |v| (sources_by_version[v] ||= []) << source }
41
+ sources_by_version
42
+ end
43
+
44
+ duplicate_versions = sources_by_version.select { |_version, sources| sources.count > 1 }
45
+
46
+ duplicate_versions.each do |version, sources|
47
+ UI.warn "Found multiple specifications for `#{name} (#{version})`:\n" +
48
+ sources.
49
+ map { |s| s.specification_path(name, version) }.
50
+ map { |v| "- #{v}" }.join("\n")
51
+ end
52
+
53
+ versions_by_source.map do |source, versions|
54
+ versions.map { |version| LazySpecification.new(name, version, source) }
55
+ end.flatten
56
+ end
57
+ end
58
+ end
59
+ end
60
+ end
@@ -219,6 +219,7 @@ module Pod
219
219
  # @return [Nil] if the podspec is not stored.
220
220
  #
221
221
  def specification_path(name)
222
+ name = Specification.root_name(name)
222
223
  path = specifications_root + "#{name}.podspec"
223
224
  if path.exist?
224
225
  path
@@ -378,7 +379,7 @@ module Pod
378
379
  end
379
380
 
380
381
  # @return [Hash{String=>String}] The path of the Pods with a local source
381
- # grouped by their name.
382
+ # grouped by their root name.
382
383
  #
383
384
  # @todo Rename (e.g. `pods_with_local_path`)
384
385
  #
@@ -9,6 +9,13 @@ module Pod
9
9
  class FileAccessor
10
10
  HEADER_EXTENSIONS = Xcodeproj::Constants::HEADER_FILES_EXTENSIONS
11
11
 
12
+ GLOB_PATTERNS = {
13
+ :readme => 'readme{*,.*}'.freeze,
14
+ :license => 'licen{c,s}e{*,.*}'.freeze,
15
+ :source_files => '*.{h,hpp,hh,m,mm,c,cpp}'.freeze,
16
+ :public_header_files => "*{#{HEADER_EXTENSIONS.join(',')}}".freeze,
17
+ }.freeze
18
+
12
19
  # @return [Sandbox::PathList] the directory where the source of the Pod
13
20
  # is located.
14
21
  #
@@ -78,9 +85,13 @@ module Pod
78
85
  source_files.select { |f| extensions.include?(f.extname) }
79
86
  end
80
87
 
88
+ # @param [Boolean] include_frameworks
89
+ # Whether or not to include the headers of the vendored frameworks.
90
+ # Defaults to not include them.
91
+ #
81
92
  # @return [Array<Pathname>] the public headers of the specification.
82
93
  #
83
- def public_headers
94
+ def public_headers(include_frameworks = false)
84
95
  public_headers = paths_for_attribute(:public_header_files)
85
96
  private_headers = paths_for_attribute(:private_header_files)
86
97
  if public_headers.nil? || public_headers.empty?
@@ -88,6 +99,7 @@ module Pod
88
99
  else
89
100
  header_files = public_headers
90
101
  end
102
+ header_files += vendored_frameworks_headers if include_frameworks
91
103
  header_files - private_headers
92
104
  end
93
105
 
@@ -111,6 +123,16 @@ module Pod
111
123
  paths_for_attribute(:vendored_frameworks, true)
112
124
  end
113
125
 
126
+ # @return [Array<Pathname>] The paths of the framework headers that come
127
+ # shipped with the Pod.
128
+ #
129
+ def vendored_frameworks_headers
130
+ vendored_frameworks.map do |framework|
131
+ headers_dir = (framework + 'Headers').realpath
132
+ Pathname.glob(headers_dir + GLOB_PATTERNS[:public_header_files])
133
+ end.flatten.uniq
134
+ end
135
+
114
136
  # @return [Array<Pathname>] The paths of the library bundles that come
115
137
  # shipped with the Pod.
116
138
  #
@@ -149,7 +171,7 @@ module Pod
149
171
  # @return [Pathname] The path of the auto-detected README file.
150
172
  #
151
173
  def readme
152
- path_list.glob(%w( readme{*,.*} )).first
174
+ path_list.glob([GLOB_PATTERNS[:readme]]).first
153
175
  end
154
176
 
155
177
  # @return [Pathname] The path of the license file as indicated in the
@@ -159,7 +181,7 @@ module Pod
159
181
  if spec_consumer.spec.root.license[:file]
160
182
  path_list.root + spec_consumer.spec.root.license[:file]
161
183
  else
162
- path_list.glob(%w( licen{c,s}e{*,.*} )).first
184
+ path_list.glob([GLOB_PATTERNS[:license]]).first
163
185
  end
164
186
  end
165
187
 
@@ -182,27 +204,12 @@ module Pod
182
204
  file_patterns = spec_consumer.send(attribute)
183
205
  options = {
184
206
  :exclude_patterns => spec_consumer.exclude_files,
185
- :dir_pattern => glob_for_attribute(attribute),
207
+ :dir_pattern => GLOB_PATTERNS[attribute],
186
208
  :include_dirs => include_dirs,
187
209
  }
188
210
  expanded_paths(file_patterns, options)
189
211
  end
190
212
 
191
- # Returns the pattern to use to glob a directory for an attribute.
192
- #
193
- # @param [Symbol] attribute
194
- # the name of the attribute
195
- #
196
- # @return [String] the glob pattern.
197
- #
198
- def glob_for_attribute(attrbute)
199
- globs = {
200
- :source_files => '*.{h,hpp,hh,m,mm,c,cpp}'.freeze,
201
- :public_header_files => "*.{#{ HEADER_EXTENSIONS * ',' }}".freeze,
202
- }
203
- globs[attrbute]
204
- end
205
-
206
213
  # Matches the given patterns to the file present in the root of the path
207
214
  # list.
208
215
  #
@@ -23,16 +23,18 @@ module Pod
23
23
  def initialize(sandbox, relative_path)
24
24
  @sandbox = sandbox
25
25
  @relative_path = relative_path
26
- @search_paths = [relative_path]
26
+ @search_paths = []
27
27
  end
28
28
 
29
29
  # @return [Array<String>] All the search paths of the header directory in
30
30
  # xcconfig format. The paths are specified relative to the pods
31
31
  # root with the `${PODS_ROOT}` variable.
32
32
  #
33
- def search_paths
33
+ def search_paths(platform)
34
+ platform_search_paths = @search_paths.select { |entry| entry[:platform] == platform }
35
+
34
36
  headers_dir = root.relative_path_from(sandbox.root).dirname
35
- @search_paths.uniq.map { |path| "${PODS_ROOT}/#{headers_dir}/#{path}" }
37
+ ["${PODS_ROOT}/#{headers_dir}/#{@relative_path}"] + platform_search_paths.uniq.map { |entry| "${PODS_ROOT}/#{headers_dir}/#{entry[:path]}" }
36
38
  end
37
39
 
38
40
  # Removes the directory as it is regenerated from scratch during each
@@ -64,8 +66,8 @@ module Pod
64
66
  #
65
67
  # @return [Pathname]
66
68
  #
67
- def add_files(namespace, relative_header_paths)
68
- add_search_path(namespace)
69
+ def add_files(namespace, relative_header_paths, platform)
70
+ add_search_path(namespace, platform)
69
71
  namespaced_path = root + namespace
70
72
  namespaced_path.mkpath unless File.exist?(namespaced_path)
71
73
 
@@ -84,10 +86,13 @@ module Pod
84
86
  # @param [Pathname] path
85
87
  # the path tho add.
86
88
  #
89
+ # @param [String] platform
90
+ # the platform the search path applies to
91
+ #
87
92
  # @return [void]
88
93
  #
89
- def add_search_path(path)
90
- @search_paths << Pathname.new(@relative_path) + path
94
+ def add_search_path(path, platform)
95
+ @search_paths << {:platform => platform, :path => (Pathname.new(@relative_path) + path) }
91
96
  end
92
97
 
93
98
  #-----------------------------------------------------------------------#
@@ -433,16 +433,16 @@ module Pod
433
433
  end
434
434
 
435
435
  case url.to_s.downcase
436
- when %r{github.com(:|/)cocoapods/specs}
436
+ when %r{github.com[:/]+cocoapods/specs}
437
437
  base = 'master'
438
- when %r{github.com(:|/)(.+)/(.+)}
439
- base = Regexp.last_match[2]
438
+ when %r{github.com[:/]+(.+)/(.+)}
439
+ base = Regexp.last_match[1]
440
+ when %r{^\S+@(\S+)[:/]+(.+)$}
441
+ host, path = Regexp.last_match.captures
442
+ base = base_from_host_and_path[host, path]
440
443
  when URI.regexp
441
444
  url = URI(url.downcase)
442
445
  base = base_from_host_and_path[url.host, url.path]
443
- when %r{^\S+@(\S+)[:/](.+)$}
444
- host, path = Regexp.last_match.captures
445
- base = base_from_host_and_path[host, path]
446
446
  else
447
447
  base = url.to_s.downcase
448
448
  end
@@ -52,7 +52,7 @@ module Pod
52
52
  # @return [PBXNativeTarget] the target generated in the Pods project for
53
53
  # this library.
54
54
  #
55
- attr_accessor :target
55
+ attr_accessor :native_target
56
56
 
57
57
  # @return [Platform] the platform for this library.
58
58
  #
@@ -57,8 +57,8 @@ module Pod
57
57
  # depends.
58
58
  #
59
59
  def dependencies
60
- specs.map do |spec|
61
- spec.consumer(platform).dependencies.map { |dep| Specification.root_name(dep.name) }
60
+ spec_consumers.map do |consumer|
61
+ consumer.dependencies.map { |dep| Specification.root_name(dep.name) }
62
62
  end.flatten
63
63
  end
64
64
 
@@ -140,7 +140,7 @@ module Pod
140
140
  end
141
141
 
142
142
  # Returns a string containing relative location of a path from the Podfile.
143
- # The returned path is quoted. If the argument is nit it returns the
143
+ # The returned path is quoted. If the argument is nil it returns the
144
144
  # empty string.
145
145
  #
146
146
  def path(pathname)
@@ -57,6 +57,9 @@ Repositories : #{repo_information.join("\n ")}
57
57
  #{'If none exists, create a ticket, with the template displayed above, on:'.yellow}
58
58
  https://github.com/CocoaPods/CocoaPods/issues/new
59
59
 
60
+ #{'Be sure to first read the contributing guide for details on how to properly submit a ticket:'.yellow}
61
+ https://github.com/CocoaPods/CocoaPods/blob/master/CONTRIBUTING.md
62
+
60
63
  Don't forget to anonymize any private data!
61
64
 
62
65
  EOS
@@ -192,7 +192,7 @@ module Pod
192
192
  #
193
193
  def perform_linting
194
194
  linter.lint
195
- @results.concat(linter.results)
195
+ @results.concat(linter.results.to_a)
196
196
  end
197
197
 
198
198
  # Perform analysis for a given spec (or subspec)
@@ -401,7 +401,7 @@ module Pod
401
401
 
402
402
  # Specialized Result to support subspecs aggregation
403
403
  #
404
- class Result < Specification::Linter::Result
404
+ class Result < Specification::Linter::Results::Result
405
405
  def initialize(type, message)
406
406
  super(type, message)
407
407
  @subspecs = []
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.34.4
4
+ version: 0.35.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-10-18 00:00:00.000000000 Z
12
+ date: 2014-11-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cocoapods-core
@@ -17,14 +17,14 @@ dependencies:
17
17
  requirements:
18
18
  - - '='
19
19
  - !ruby/object:Gem::Version
20
- version: 0.34.4
20
+ version: 0.35.0.rc1
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
25
  - - '='
26
26
  - !ruby/object:Gem::Version
27
- version: 0.34.4
27
+ version: 0.35.0.rc1
28
28
  - !ruby/object:Gem::Dependency
29
29
  name: claide
30
30
  requirement: !ruby/object:Gem::Requirement
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - ~>
47
47
  - !ruby/object:Gem::Version
48
- version: 0.19.4
48
+ version: 0.20.1
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - ~>
54
54
  - !ruby/object:Gem::Version
55
- version: 0.19.4
55
+ version: 0.20.1
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: cocoapods-downloader
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -87,14 +87,14 @@ dependencies:
87
87
  requirements:
88
88
  - - ~>
89
89
  - !ruby/object:Gem::Version
90
- version: 0.4.1
90
+ version: 0.4.2
91
91
  type: :runtime
92
92
  prerelease: false
93
93
  version_requirements: !ruby/object:Gem::Requirement
94
94
  requirements:
95
95
  - - ~>
96
96
  - !ruby/object:Gem::Version
97
- version: 0.4.1
97
+ version: 0.4.2
98
98
  - !ruby/object:Gem::Dependency
99
99
  name: cocoapods-trunk
100
100
  requirement: !ruby/object:Gem::Requirement
@@ -110,47 +110,47 @@ dependencies:
110
110
  - !ruby/object:Gem::Version
111
111
  version: 0.3.1
112
112
  - !ruby/object:Gem::Dependency
113
- name: colored
113
+ name: molinillo
114
114
  requirement: !ruby/object:Gem::Requirement
115
115
  requirements:
116
116
  - - ~>
117
117
  - !ruby/object:Gem::Version
118
- version: '1.2'
118
+ version: 0.1.0
119
119
  type: :runtime
120
120
  prerelease: false
121
121
  version_requirements: !ruby/object:Gem::Requirement
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: '1.2'
125
+ version: 0.1.0
126
126
  - !ruby/object:Gem::Dependency
127
- name: escape
127
+ name: colored
128
128
  requirement: !ruby/object:Gem::Requirement
129
129
  requirements:
130
130
  - - ~>
131
131
  - !ruby/object:Gem::Version
132
- version: 0.0.4
132
+ version: '1.2'
133
133
  type: :runtime
134
134
  prerelease: false
135
135
  version_requirements: !ruby/object:Gem::Requirement
136
136
  requirements:
137
137
  - - ~>
138
138
  - !ruby/object:Gem::Version
139
- version: 0.0.4
139
+ version: '1.2'
140
140
  - !ruby/object:Gem::Dependency
141
- name: json_pure
141
+ name: escape
142
142
  requirement: !ruby/object:Gem::Requirement
143
143
  requirements:
144
144
  - - ~>
145
145
  - !ruby/object:Gem::Version
146
- version: '1.8'
146
+ version: 0.0.4
147
147
  type: :runtime
148
148
  prerelease: false
149
149
  version_requirements: !ruby/object:Gem::Requirement
150
150
  requirements:
151
151
  - - ~>
152
152
  - !ruby/object:Gem::Version
153
- version: '1.8'
153
+ version: 0.0.4
154
154
  - !ruby/object:Gem::Dependency
155
155
  name: open4
156
156
  requirement: !ruby/object:Gem::Requirement
@@ -172,9 +172,6 @@ dependencies:
172
172
  - - '>='
173
173
  - !ruby/object:Gem::Version
174
174
  version: 3.2.15
175
- - - <
176
- - !ruby/object:Gem::Version
177
- version: '4'
178
175
  type: :runtime
179
176
  prerelease: false
180
177
  version_requirements: !ruby/object:Gem::Requirement
@@ -182,9 +179,6 @@ dependencies:
182
179
  - - '>='
183
180
  - !ruby/object:Gem::Version
184
181
  version: 3.2.15
185
- - - <
186
- - !ruby/object:Gem::Version
187
- version: '4'
188
182
  - !ruby/object:Gem::Dependency
189
183
  name: nap
190
184
  requirement: !ruby/object:Gem::Requirement
@@ -262,7 +256,6 @@ files:
262
256
  - lib/cocoapods/command/list.rb
263
257
  - lib/cocoapods/command/outdated.rb
264
258
  - lib/cocoapods/command/project.rb
265
- - lib/cocoapods/command/push.rb
266
259
  - lib/cocoapods/command/repo/push.rb
267
260
  - lib/cocoapods/command/repo.rb
268
261
  - lib/cocoapods/command/search.rb
@@ -284,6 +277,7 @@ files:
284
277
  - lib/cocoapods/generator/bridge_support.rb
285
278
  - lib/cocoapods/generator/copy_resources_script.rb
286
279
  - lib/cocoapods/generator/dummy_source.rb
280
+ - lib/cocoapods/generator/header.rb
287
281
  - lib/cocoapods/generator/prefix_header.rb
288
282
  - lib/cocoapods/generator/target_environment_header.rb
289
283
  - lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
@@ -295,6 +289,7 @@ files:
295
289
  - lib/cocoapods/hooks/library_representation.rb
296
290
  - lib/cocoapods/hooks/pod_representation.rb
297
291
  - lib/cocoapods/hooks_manager.rb
292
+ - lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb
298
293
  - lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
299
294
  - lib/cocoapods/installer/analyzer.rb
300
295
  - lib/cocoapods/installer/file_references_installer.rb
@@ -310,6 +305,7 @@ files:
310
305
  - lib/cocoapods/installer.rb
311
306
  - lib/cocoapods/open_uri.rb
312
307
  - lib/cocoapods/project.rb
308
+ - lib/cocoapods/resolver/lazy_specification.rb
313
309
  - lib/cocoapods/resolver.rb
314
310
  - lib/cocoapods/sandbox/file_accessor.rb
315
311
  - lib/cocoapods/sandbox/headers_store.rb
@@ -340,7 +336,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
340
336
  requirements:
341
337
  - - '>='
342
338
  - !ruby/object:Gem::Version
343
- version: 1.8.7
339
+ version: 2.0.0
344
340
  required_rubygems_version: !ruby/object:Gem::Requirement
345
341
  requirements:
346
342
  - - '>='
@@ -353,4 +349,3 @@ signing_key:
353
349
  specification_version: 3
354
350
  summary: An Objective-C library package manager.
355
351
  test_files: []
356
- has_rdoc: