cocoapods 0.9.2 → 0.10.0

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.
@@ -1,3 +1,23 @@
1
+ ## 0.10.0 (Unreleased)
2
+
3
+ [CocoaPods](http://git.io/4i75YA)
4
+
5
+ ###### Enhancements
6
+
7
+ - Added a `--local-only` option to `pod push` so that developers can push locally and test before pushing to a remote. [#405](http://git.io/0ILJEw)
8
+ - Added line number information for errors generated in the Podfile. [#408](http://git.io/fWQvMg)
9
+ - Pods stored in git repositories now initialize submodules. [#406](http://git.io/L9ssSw)
10
+
11
+
12
+ ###### Bug fixes
13
+
14
+ - Removed note about the post install hook form the linter.
15
+ - Improved xcodebuild error detection in the linter.
16
+ - Ensure the git cache exists, before updating it, when trying to install the ‘bleeding edge’ of a pod. [#426](http://git.io/d4eqRA)
17
+ - Clean downloaded external pods **after** resolving and activating (sub)specs. [#414](http://git.io/i77q_w)
18
+ - Support `tar.gz` as filename in a HTTP source. [#428](http://git.io/qhwKkA)
19
+
20
+
1
21
  ## 0.9.2
2
22
 
3
23
  [CocoaPods](http://git.io/AVlRKg) • [Xcodeproj](http://git.io/xHbc0w)
@@ -135,9 +155,9 @@ configurations are based on the `Release` configuration, to base them on the
135
155
  `Debug` configuration you will have to explicitely specify them as can be seen
136
156
  above in the following line:
137
157
 
138
- ``ruby
158
+ ```ruby
139
159
  xcodeproj 'TestProject', 'Test' => :debug
140
- ``
160
+ ```
141
161
 
142
162
 
143
163
  ### Documentation
@@ -147,16 +167,16 @@ CocoaPods will now generate documentation for every library with the
147
167
 
148
168
  You can customize the settings used like so:
149
169
 
150
- ``ruby
170
+ ```ruby
151
171
  s.documentation = { :appledoc => ['--product-name', 'My awesome project!'] }
152
- ``
172
+ ```
153
173
 
154
174
  Alternatively, you can specify a URL where an HTML version of the documentation
155
175
  can be found:
156
176
 
157
- ``ruby
177
+ ```ruby
158
178
  s.documentation = { :html => 'http://example.com/docs/index.html' }
159
- ``
179
+ ```
160
180
 
161
181
  See [#149](https://github.com/CocoaPods/CocoaPods/issues/149) and
162
182
  [#151](https://github.com/CocoaPods/CocoaPods/issues/151) for more info.
@@ -177,18 +197,18 @@ If you're not happy with the default boilerplate text generated for the title, h
177
197
  and footnotes in the files, it's possible to customise these by overriding the methods
178
198
  that generate the text in your `Podfile` like this:
179
199
 
180
- ``ruby
200
+ ```ruby
181
201
  class ::Pod::Generator::Acknowledgements
182
202
  def header_text
183
203
  "My custom header text"
184
204
  end
185
205
  end
186
- ``
206
+ ```
187
207
 
188
208
  You can even go one step further and customise the text on a per target basis by
189
209
  checking against the target name, like this:
190
210
 
191
- ``ruby
211
+ ```ruby
192
212
  class ::Pod::Generator::Acknowledgements
193
213
  def header_text
194
214
  if @target_definition.label.end_with?("MyTargetName")
@@ -198,16 +218,16 @@ class ::Pod::Generator::Acknowledgements
198
218
  end
199
219
  end
200
220
  end
201
- ``
221
+ ```
202
222
 
203
223
  Finally, here's a list of the methods that are available to override:
204
224
 
205
- ``ruby
225
+ ```ruby
206
226
  header_title
207
227
  header_text
208
228
  footnote_title
209
229
  footnote_text
210
- ``
230
+ ```
211
231
 
212
232
 
213
233
  ### Introduced two new classes: LocalPod and Sandbox.
@@ -318,7 +338,7 @@ different sets of depedencies. This means that you can create a separate
318
338
  library which contains all dependencies, including extra ones that you only use
319
339
  in, for instance, a debug or test build. [[docs][1]]
320
340
 
321
- ``ruby
341
+ ```ruby
322
342
  # This Podfile will build three static libraries:
323
343
  # * libPods.a
324
344
  # * libPods-debug.a
@@ -339,7 +359,7 @@ target :test, :exclusive => true do
339
359
  # the `libPods-test.a` library.
340
360
  dependency 'Kiwi'
341
361
  end
342
- ``
362
+ ```
343
363
 
344
364
  ### Install libraries from anywhere
345
365
 
@@ -347,7 +367,7 @@ A dependency can take a git url if the repo contains a podspec file in its
347
367
  root, or a podspec can be loaded from a file or HTTP location. If no podspec is
348
368
  available, a specification can be defined inline in the Podfile. [[docs][2]]
349
369
 
350
- ``ruby
370
+ ```ruby
351
371
  # From a spec repo.
352
372
  dependency 'SSToolkit'
353
373
 
@@ -378,14 +398,14 @@ dependency do |s|
378
398
  end
379
399
  end
380
400
  end
381
- ``
401
+ ```
382
402
 
383
403
  ### Add a `post_install` hook to the Podfile class
384
404
 
385
405
  This allows the user to customize, for instance, the generated Xcode project
386
406
  _before_ it’s written to disk. [[docs][3]]
387
407
 
388
- ``ruby
408
+ ```ruby
389
409
  # Enable garbage collection support for MacRuby applications.
390
410
  post_install do |installer|
391
411
  installer.project.targets.each do |target|
@@ -394,14 +414,14 @@ post_install do |installer|
394
414
  end
395
415
  end
396
416
  end
397
- ``
417
+ ```
398
418
 
399
419
  ### Manifest
400
420
 
401
421
  Generate a Podfile.lock file next to the Podfile, which contains a manifest of
402
422
  your application’s dependencies and their dependencies.
403
423
 
404
- ``
424
+ ```
405
425
  PODS:
406
426
  - JSONKit (1.4)
407
427
  - LibComponentLogging-Core (1.1.4)
@@ -423,7 +443,7 @@ DOWNLOAD_ONLY:
423
443
  DEPENDENCIES:
424
444
  - RestKit-JSON-JSONKit
425
445
  - RestKit-ObjectMapping
426
- ``
446
+ ```
427
447
 
428
448
  ### Generate Xcode projects from scratch
429
449
 
@@ -13,7 +13,7 @@ unless Gem::Version::Requirement.new('>= 1.4.0').satisfied_by?(Gem::Version.new(
13
13
  end
14
14
 
15
15
  module Pod
16
- VERSION = '0.9.2'
16
+ VERSION = '0.10.0'
17
17
 
18
18
  class PlainInformative < StandardError
19
19
  end
@@ -14,7 +14,8 @@ module Pod
14
14
  end
15
15
 
16
16
  def self.options
17
- [["--allow-warnings", "Allows to push if warnings are not evitable"]].concat(super)
17
+ [ ["--allow-warnings", "Allows to push if warnings are not evitable"],
18
+ ["--local-only", "Does not perform the step of pushing REPO to its remote"] ].concat(super)
18
19
  end
19
20
 
20
21
  extend Executable
@@ -22,6 +23,7 @@ module Pod
22
23
 
23
24
  def initialize(argv)
24
25
  @allow_warnings = argv.option('--allow-warnings')
26
+ @local_only = argv.option('--local-only')
25
27
  @repo = argv.shift_argument
26
28
  @podspec = argv.shift_argument
27
29
  super unless argv.empty? && @repo
@@ -32,7 +34,7 @@ module Pod
32
34
  check_repo_status
33
35
  update_repo
34
36
  add_specs_to_repo
35
- push_repo
37
+ push_repo unless @local_only
36
38
  puts
37
39
  end
38
40
 
@@ -205,7 +205,6 @@ module Pod
205
205
  @platform_notes[platform] << "#{platform.name} [!] Fatal errors found skipping the rest of the validation"
206
206
  else
207
207
  @platform_warnings[platform] += podspec_warnings + deprecation_warnings
208
- @platform_notes[platform] += podspec_notes
209
208
  peform_extensive_analysis unless quick
210
209
  end
211
210
  end
@@ -360,14 +359,6 @@ module Pod
360
359
  @spec.source && @spec.source[:git] =~ /github.com/
361
360
  end
362
361
 
363
- # @return [Array<String>] List of the comments detected in the podspec
364
- def podspec_notes
365
- text = @file.read
366
- deprecations = []
367
- deprecations << "The `post_install' hook is reserved for edge cases" if text. =~ /post_install/
368
- deprecations
369
- end
370
-
371
362
  # It reads a podspec file and checks for strings corresponding
372
363
  # to features that are or will be deprecated
373
364
  #
@@ -399,7 +390,7 @@ module Pod
399
390
  def process_xcode_build_output(output)
400
391
  output_by_line = output.split("\n")
401
392
  selected_lines = output_by_line.select do |l|
402
- l.include?('error: ') && (l !~ /errors? generated\./) \
393
+ l.include?('error: ') && (l !~ /errors? generated\./) && (l !~ /error: \(null\)/)\
403
394
  || l.include?('warning: ') && (l !~ /warnings? generated\./)\
404
395
  || l.include?('note: ') && (l !~ /expanded from macro/)
405
396
  end
@@ -146,16 +146,20 @@ module Pod
146
146
  end
147
147
 
148
148
  def specification_from_sandbox(sandbox, platform)
149
+ specification_from_local(sandbox, platform) || specification_from_external(sandbox, platform)
150
+ end
151
+
152
+ def specification_from_local(sandbox, platform)
149
153
  if local_pod = sandbox.installed_pod_named(name, platform)
150
154
  local_pod.top_specification
151
- else
152
- copy_external_source_into_sandbox(sandbox)
153
- local_pod = sandbox.installed_pod_named(name, platform)
154
- local_pod.clean if config.clean? && local_pod.exists?
155
- local_pod.top_specification
156
155
  end
157
156
  end
158
157
 
158
+ def specification_from_external(sandbox, platform)
159
+ copy_external_source_into_sandbox(sandbox, platform)
160
+ specification_from_local(sandbox, platform)
161
+ end
162
+
159
163
  def ==(other_source)
160
164
  return if other_source.nil?
161
165
  name == other_source.name && params == other_source.params
@@ -163,10 +167,12 @@ module Pod
163
167
  end
164
168
 
165
169
  class GitSource < AbstractExternalSource
166
- def copy_external_source_into_sandbox(sandbox)
170
+ def copy_external_source_into_sandbox(sandbox, platform)
167
171
  puts " * Pre-downloading: '#{name}'" unless config.silent?
168
- Downloader.for_target(sandbox.root + name, @params).tap do |downloader|
169
- downloader.download
172
+ downloader = Downloader.for_target(sandbox.root + name, @params)
173
+ downloader.download
174
+ if local_pod = sandbox.installed_pod_named(name, platform)
175
+ local_pod.downloaded = true
170
176
  end
171
177
  end
172
178
 
@@ -181,7 +187,7 @@ module Pod
181
187
 
182
188
  # can be http, file, etc
183
189
  class PodspecSource < AbstractExternalSource
184
- def copy_external_source_into_sandbox(sandbox)
190
+ def copy_external_source_into_sandbox(sandbox, _)
185
191
  output_path = sandbox.root + "Local Podspecs/#{name}.podspec"
186
192
  output_path.dirname.mkpath
187
193
  puts " * Fetching podspec for `#{name}' from: #{@params[:podspec]}" unless config.silent?
@@ -76,6 +76,7 @@ module Pod
76
76
  git "reset --hard HEAD"
77
77
  git "clean -d -x -f"
78
78
  git "pull"
79
+ git "submodule update"
79
80
  end
80
81
  end
81
82
 
@@ -99,7 +100,11 @@ module Pod
99
100
  end
100
101
 
101
102
  def download_head
102
- update_cache
103
+ if cache_exist?
104
+ update_cache
105
+ else
106
+ create_cache
107
+ end
103
108
  clone(clone_url, target_path)
104
109
  end
105
110
 
@@ -111,6 +116,7 @@ module Pod
111
116
  git "fetch origin tags/#{options[:tag]}"
112
117
  git "reset --hard FETCH_HEAD"
113
118
  git "checkout -b activated-pod-commit"
119
+ git "submodule update --init"
114
120
  end
115
121
  end
116
122
 
@@ -135,6 +141,9 @@ module Pod
135
141
 
136
142
  def clone(from, to)
137
143
  git "clone \"#{from}\" \"#{to}\""
144
+ Dir.chdir(to) do
145
+ git "submodule update --init"
146
+ end
138
147
  end
139
148
  end
140
149
 
@@ -29,7 +29,7 @@ module Pod
29
29
  def type_with_url(url)
30
30
  if url =~ /.zip$/
31
31
  :zip
32
- elsif url =~ /.tgz$/
32
+ elsif url =~ /.(tgz|tar\.gz)$/
33
33
  :tgz
34
34
  elsif url =~ /.tar$/
35
35
  :tar
@@ -57,12 +57,17 @@ module Pod
57
57
  puts marker << ( pod.exists? ? "Using #{name}" : "Installing #{name}".green )
58
58
  end
59
59
 
60
- unless pod.exists?
61
- download_pod(pod)
62
- # The docs need to be generated before cleaning because
63
- # the documentation is created for all the subspecs.
60
+ download_pod(pod) unless pod.exists?
61
+
62
+ # This will not happen if the pod existed before we started the install
63
+ # process.
64
+ if pod.downloaded?
65
+ # The docs need to be generated before cleaning because the
66
+ # documentation is created for all the subspecs.
64
67
  generate_docs(pod)
65
- pod.clean if config.clean
68
+ # Here we clean pod's that just have been downloaded or have been
69
+ # pre-downloaded in AbstractExternalSource#specification_from_sandbox.
70
+ pod.clean! if config.clean?
66
71
  end
67
72
  end
68
73
  end
@@ -74,10 +79,12 @@ module Pod
74
79
  if downloader.respond_to?(:download_head)
75
80
  downloader.download_head
76
81
  else
82
+ raise Informative, "The downloader of class `#{downloader.class.name}' does not support the `:head' option."
77
83
  end
78
84
  else
79
85
  downloader.download
80
86
  end
87
+ pod.downloaded = true
81
88
  end
82
89
 
83
90
  #TODO: move to generator ?
@@ -206,18 +213,12 @@ module Pod
206
213
  specs_by_target.each do |target_definition, specs|
207
214
  @pods_by_spec[target_definition.platform] = {}
208
215
  result[target_definition] = specs.map do |spec|
209
- pod = pod_for_spec(spec, target_definition.platform)
210
- pod.add_specification(spec)
211
- pod
216
+ @sandbox.local_pod_for_spec(spec, target_definition.platform)
212
217
  end.uniq.compact
213
218
  end
214
219
  result
215
220
  end
216
221
 
217
- def pod_for_spec(spec, platform)
218
- @pods_by_spec[platform][spec.top_level_parent.name] ||= LocalPod.new(spec, @sandbox, platform)
219
- end
220
-
221
222
  private
222
223
 
223
224
  def print_title(title, only_verbose = true)
@@ -38,6 +38,13 @@ module Pod
38
38
  #
39
39
  attr_reader :platform
40
40
 
41
+ # @return [Boolean] Wether or not the pod has been downloaded in the
42
+ # current install process and still needs its docs
43
+ # generated and be cleaned.
44
+ #
45
+ attr_accessor :downloaded
46
+ alias_method :downloaded?, :downloaded
47
+
41
48
  # @param [Specification] specification
42
49
  # The first activated specification of the pod.
43
50
  # @param [Sandbox] sandbox
@@ -139,7 +146,7 @@ module Pod
139
146
  #
140
147
  # @return [void]
141
148
  #
142
- def clean
149
+ def clean!
143
150
  clean_paths.each { |path| FileUtils.rm_rf(path) }
144
151
  @cleaned = true
145
152
  end
@@ -299,8 +306,8 @@ module Pod
299
306
  #
300
307
  def all_specs_public_header_files
301
308
  if @cleaned
302
- raise Informative, "The pod is cleaned and cannot compute the all the "\
303
- "header files as they might be deleted."
309
+ raise Informative, "The pod is cleaned and cannot compute the " \
310
+ "header files, as some might have been deleted."
304
311
  end
305
312
 
306
313
  all_specs = [ top_specification ] + top_specification.subspecs
@@ -1,5 +1,19 @@
1
1
  module Pod
2
2
  class Podfile
3
+ class Informative < ::Pod::Informative
4
+ def podfile_line
5
+ @podfile_line ||= self.backtrace.find {|t| t =~ /Podfile/}
6
+ end
7
+
8
+ def message
9
+ if podfile_line
10
+ super + " (#{podfile_line})\n".red
11
+ else
12
+ super
13
+ end
14
+ end
15
+ end
16
+
3
17
  class UserProject
4
18
  include Config::Mixin
5
19
 
@@ -200,7 +214,7 @@ module Pod
200
214
  when :osx
201
215
  target = '10.6'
202
216
  else
203
- raise Informative, "Unsupported platform: platform must be one of [:ios, :osx]"
217
+ raise ::Pod::Podfile::Informative, "Unsupported platform: platform must be one of [:ios, :osx]"
204
218
  end
205
219
  end
206
220
  @target_definition.platform = Platform.new(name, target)
@@ -9,6 +9,7 @@ module Pod
9
9
  def initialize(path)
10
10
  @root = Pathname.new(path)
11
11
  @header_search_paths = [HEADERS_DIR]
12
+ @cached_local_pods = {}
12
13
 
13
14
  FileUtils.mkdir_p(@root)
14
15
  end
@@ -56,17 +57,25 @@ module Pod
56
57
  headers_root.rmtree if headers_root.exist?
57
58
  end
58
59
 
59
- def podspec_for_name(name)
60
- if spec_path = Dir[root + "#{name}/*.podspec"].first
61
- Pathname.new(spec_path)
62
- elsif spec_path = Dir[root + "Local Podspecs/#{name}.podspec"].first
63
- Pathname.new(spec_path)
60
+ def local_pod_for_spec(spec, platform)
61
+ key = [spec.top_level_parent.name, platform.to_sym]
62
+ (@cached_local_pods[key] ||= LocalPod.new(spec.top_level_parent, self, platform)).tap do |pod|
63
+ pod.add_specification(spec)
64
64
  end
65
65
  end
66
66
 
67
67
  def installed_pod_named(name, platform)
68
68
  if spec_path = podspec_for_name(name)
69
- LocalPod.from_podspec(spec_path, self, platform)
69
+ key = [name, platform.to_sym]
70
+ @cached_local_pods[key] ||= LocalPod.from_podspec(spec_path, self, platform)
71
+ end
72
+ end
73
+
74
+ def podspec_for_name(name)
75
+ if spec_path = Dir[root + "#{name}/*.podspec"].first
76
+ Pathname.new(spec_path)
77
+ elsif spec_path = Dir[root + "Local Podspecs/#{name}.podspec"].first
78
+ Pathname.new(spec_path)
70
79
  end
71
80
  end
72
81
  end
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.9.2
4
+ version: 0.10.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-16 00:00:00.000000000 Z
12
+ date: 2012-07-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday