cocoapods 0.36.0.beta.1 → 0.36.0.beta.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +67 -5
  3. data/bin/pod +11 -10
  4. data/bin/sandbox-pod +1 -1
  5. data/lib/cocoapods.rb +1 -1
  6. data/lib/cocoapods/command/lib.rb +0 -1
  7. data/lib/cocoapods/command/outdated.rb +1 -3
  8. data/lib/cocoapods/command/repo.rb +5 -267
  9. data/lib/cocoapods/command/repo/add.rb +53 -0
  10. data/lib/cocoapods/command/repo/lint.rb +73 -0
  11. data/lib/cocoapods/command/repo/list.rb +95 -0
  12. data/lib/cocoapods/command/repo/remove.rb +36 -0
  13. data/lib/cocoapods/command/repo/update.rb +27 -0
  14. data/lib/cocoapods/command/setup.rb +1 -1
  15. data/lib/cocoapods/command/spec.rb +5 -546
  16. data/lib/cocoapods/command/spec/cat.rb +51 -0
  17. data/lib/cocoapods/command/spec/create.rb +279 -0
  18. data/lib/cocoapods/command/spec/edit.rb +87 -0
  19. data/lib/cocoapods/command/spec/lint.rb +105 -0
  20. data/lib/cocoapods/command/spec/which.rb +43 -0
  21. data/lib/cocoapods/downloader.rb +0 -2
  22. data/lib/cocoapods/external_sources/podspec_source.rb +13 -3
  23. data/lib/cocoapods/gem_version.rb +1 -1
  24. data/lib/cocoapods/generator/copy_resources_script.rb +22 -11
  25. data/lib/cocoapods/generator/embed_frameworks_script.rb +3 -0
  26. data/lib/cocoapods/generator/header.rb +3 -3
  27. data/lib/cocoapods/generator/target_environment_header.rb +1 -1
  28. data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +7 -7
  29. data/lib/cocoapods/generator/xcconfig/public_pod_xcconfig.rb +1 -1
  30. data/lib/cocoapods/hooks_manager.rb +4 -4
  31. data/lib/cocoapods/installer.rb +17 -4
  32. data/lib/cocoapods/installer/analyzer.rb +19 -12
  33. data/lib/cocoapods/installer/pod_source_installer.rb +1 -1
  34. data/lib/cocoapods/installer/target_installer.rb +1 -1
  35. data/lib/cocoapods/installer/target_installer/aggregate_target_installer.rb +9 -8
  36. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +2 -2
  37. data/lib/cocoapods/sandbox.rb +0 -2
  38. data/lib/cocoapods/sandbox/headers_store.rb +1 -1
  39. data/lib/cocoapods/sources_manager.rb +8 -7
  40. data/lib/cocoapods/target.rb +1 -1
  41. data/lib/cocoapods/target/aggregate_target.rb +1 -0
  42. data/lib/cocoapods/target/pod_target.rb +1 -1
  43. data/lib/cocoapods/user_interface/error_report.rb +10 -0
  44. data/lib/cocoapods/validator.rb +15 -4
  45. metadata +17 -6
@@ -48,7 +48,7 @@ module Pod
48
48
  product.path = product_name
49
49
 
50
50
  target.user_build_configurations.each do |bc_name, type|
51
- configuration = @native_target.add_build_configuration(bc_name, type)
51
+ @native_target.add_build_configuration(bc_name, type)
52
52
  end
53
53
 
54
54
  @native_target.build_configurations.each do |configuration|
@@ -114,14 +114,15 @@ module Pod
114
114
  library_targets = target.pod_targets.reject do |pod_target|
115
115
  pod_target.should_build? && pod_target.requires_frameworks?
116
116
  end
117
- file_accessors = library_targets.flat_map(&:file_accessors)
118
- resource_paths = file_accessors.flat_map { |accessor| accessor.resources.flat_map { |res| res.relative_path_from(project.path.dirname) } }
119
- resource_bundles = file_accessors.flat_map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name}.bundle" } }
120
- resources = []
121
- resources.concat(resource_paths)
122
- resources.concat(resource_bundles)
123
- resources << bridge_support_file if bridge_support_file
124
- generator = Generator::CopyResourcesScript.new(resources, target.platform)
117
+ resources_by_config = {}
118
+ target.user_build_configurations.keys.each do |config|
119
+ file_accessors = library_targets.select { |t| t.include_in_build_config?(config) }.flat_map(&:file_accessors)
120
+ resource_paths = file_accessors.flat_map { |accessor| accessor.resources.flat_map { |res| res.relative_path_from(project.path.dirname) } }
121
+ resource_bundles = file_accessors.flat_map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name}.bundle" } }
122
+ resources_by_config[config] = resource_paths + resource_bundles
123
+ resources_by_config[config] << bridge_support_file if bridge_support_file
124
+ end
125
+ generator = Generator::CopyResourcesScript.new(resources_by_config, target.platform)
125
126
  generator.save_as(path)
126
127
  add_file_to_support_group(path)
127
128
  end
@@ -38,7 +38,7 @@ module Pod
38
38
  add_copy_resources_script_phase
39
39
  add_check_manifest_lock_script_phase
40
40
  true
41
- end
41
+ end,
42
42
  ].any?
43
43
 
44
44
  if project_is_dirty
@@ -179,7 +179,7 @@ module Pod
179
179
  def add_copy_resources_script_phase
180
180
  phase_name = 'Copy Pods Resources'
181
181
  native_targets_to_integrate.each do |native_target|
182
- phase = native_target.shell_script_build_phases.select { |bp| bp.name == phase_name }.first
182
+ phase = native_target.shell_script_build_phases.find { |bp| bp.name == phase_name }
183
183
  phase ||= native_target.new_shell_script_build_phase(phase_name)
184
184
  script_path = target.copy_resources_script_relative_path
185
185
  phase.shell_script = %("#{script_path}"\n)
@@ -231,8 +231,6 @@ module Pod
231
231
  path = specifications_root + "#{name}.podspec.json"
232
232
  if path.exist?
233
233
  path
234
- else
235
- nil
236
234
  end
237
235
  end
238
236
  end
@@ -96,7 +96,7 @@ module Pod
96
96
  # @return [void]
97
97
  #
98
98
  def add_search_path(path, platform)
99
- @search_paths << {:platform => platform, :path => (Pathname.new(@relative_path) + path) }
99
+ @search_paths << { :platform => platform, :path => (Pathname.new(@relative_path) + path) }
100
100
  end
101
101
 
102
102
  #-----------------------------------------------------------------------#
@@ -44,7 +44,7 @@ module Pod
44
44
  argv = [name, url]
45
45
  argv << '--shallow' if name =~ /^master(-\d+)?$/
46
46
  Command::Repo::Add.new(CLAide::ARGV.new(argv)).run
47
- rescue Informative => e
47
+ rescue Informative
48
48
  raise Informative, "Unable to add a source with url `#{url}` " \
49
49
  "named `#{name}`.\nYou can try adding it manually in " \
50
50
  '`~/.cocoapods/repos` or via `pod repo add`.'
@@ -144,6 +144,7 @@ module Pod
144
144
  def updated_search_index
145
145
  unless @updated_search_index
146
146
  if search_index_path.exist?
147
+ require 'yaml'
147
148
  stored_index = YAML.load(search_index_path.read)
148
149
  if stored_index && stored_index.is_a?(Hash)
149
150
  search_index = aggregate.update_search_index(stored_index)
@@ -197,7 +198,7 @@ module Pod
197
198
  begin
198
199
  output = git!('pull --ff-only')
199
200
  UI.puts output if show_output && !config.verbose?
200
- rescue Informative => e
201
+ rescue Informative
201
202
  UI.warn 'CocoaPods was not able to update the ' \
202
203
  "`#{source.name}` repo. If this is an unexpected issue " \
203
204
  'and persists you can inspect it running ' \
@@ -314,7 +315,7 @@ module Pod
314
315
  return {} unless yaml_file.exist?
315
316
  begin
316
317
  YAMLHelper.load_file(yaml_file)
317
- rescue Informative => e
318
+ rescue Informative
318
319
  raise Informative, "There was an error reading '#{yaml_file}'.\n" \
319
320
  'Please consult http://blog.cocoapods.org/' \
320
321
  'Repairing-Our-Broken-Specs-Repository/ ' \
@@ -415,7 +416,7 @@ module Pod
415
416
  # # sourceforge-artsy-specs
416
417
  #
417
418
  # @example A file URL
418
- #
419
+ #
419
420
  # name_for_url('file:///Artsy/Specs.git')
420
421
  # # artsy-specs
421
422
  #
@@ -432,8 +433,8 @@ module Pod
432
433
  else
433
434
  base = ''
434
435
  end
435
- base += path.gsub(/.git$/, '').gsub(/^\//, '').
436
- split('/').join('-')
436
+
437
+ base + path.gsub(/.git$/, '').gsub(/^\//, '').split('/').join('-')
437
438
  end
438
439
 
439
440
  case url.to_s.downcase
@@ -441,7 +442,7 @@ module Pod
441
442
  base = 'master'
442
443
  when %r{github.com[:/]+(.+)/(.+)}
443
444
  base = Regexp.last_match[1]
444
- when %r{^\S+@(\S+)[:/]+(.+)$}
445
+ when /^\S+@(\S+)[:\/]+(.+)$/
445
446
  host, path = Regexp.last_match.captures
446
447
  base = base_from_host_and_path[host, path]
447
448
  when URI.regexp
@@ -195,7 +195,7 @@ module Pod
195
195
  # @return [Pathname] the absolute path of the Info.plist file.
196
196
  #
197
197
  def info_plist_path
198
- support_files_dir + "Info.plist"
198
+ support_files_dir + 'Info.plist'
199
199
  end
200
200
 
201
201
  # @return [Pathname] the path of the dummy source generated by CocoaPods
@@ -55,6 +55,7 @@ module Pod
55
55
  # will be integrated by this target.
56
56
  #
57
57
  def user_targets(project = nil)
58
+ return [] unless user_project_path
58
59
  project ||= Xcodeproj::Project.open(user_project_path)
59
60
  user_target_uuids.map do |uuid|
60
61
  native_target = project.objects_by_uuid[uuid]
@@ -66,7 +66,7 @@ module Pod
66
66
  #
67
67
  def uses_swift?
68
68
  file_accessors.any? do |file_accessor|
69
- file_accessor.source_files.any? { |sf| sf.extname == ".swift" }
69
+ file_accessor.source_files.any? { |sf| sf.extname == '.swift' }
70
70
  end
71
71
  end
72
72
 
@@ -12,6 +12,12 @@ module Pod
12
12
 
13
13
  #{'――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――'.reversed}
14
14
 
15
+ ### Command
16
+
17
+ ```
18
+ #{original_command}
19
+ ```
20
+
15
21
  ### Report
16
22
 
17
23
  * What did you do?
@@ -137,6 +143,10 @@ EOS
137
143
  end
138
144
  end
139
145
  end
146
+
147
+ def original_command
148
+ "#{$PROGRAM_NAME} #{ARGV.join(' ')}"
149
+ end
140
150
  end
141
151
  end
142
152
  end
@@ -167,7 +167,8 @@ module Pod
167
167
  types = results.map(&:type).uniq
168
168
  if types.include?(:error) then :error
169
169
  elsif types.include?(:warning) then :warning
170
- else :note end
170
+ else :note
171
+ end
171
172
  end
172
173
 
173
174
  # @return [Symbol]
@@ -344,8 +345,10 @@ module Pod
344
345
  next
345
346
  end
346
347
 
347
- if message.include?('error: ')
348
+ if message =~ /\S+:\d+:\d+: error:/
348
349
  error('xcodebuild', message)
350
+ elsif message =~ /\S+:\d+:\d+: warning:/
351
+ warning('xcodebuild', message)
349
352
  else
350
353
  note('xcodebuild', message)
351
354
  end
@@ -507,7 +510,7 @@ module Pod
507
510
  l.include?('note: ') && (l !~ /expanded from macro/)
508
511
  end
509
512
  selected_lines.map do |l|
510
- new = l.gsub(/\/tmp\/CocoaPods\/Lint\/Pods\//, '')
513
+ new = l.gsub(%r{/tmp/CocoaPods/Lint/Pods/}, '')
511
514
  new.gsub!(/^ */, ' ')
512
515
  end
513
516
  end
@@ -517,7 +520,15 @@ module Pod
517
520
  #
518
521
  def xcodebuild
519
522
  UI.puts 'xcodebuild clean build -target Pods' if config.verbose?
520
- `xcodebuild clean build -target Pods 2>&1`
523
+ output = `xcodebuild clean build -target Pods 2>&1`
524
+
525
+ unless $?.success?
526
+ message = 'Returned a unsuccessful exit code.'
527
+ message += ' You can use `--verbose` for more information.' unless config.verbose?
528
+ error('xcodebuild', message)
529
+ end
530
+
531
+ output
521
532
  end
522
533
 
523
534
  #-------------------------------------------------------------------------#
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.36.0.beta.1
4
+ version: 0.36.0.beta.2
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-12-25 00:00:00.000000000 Z
12
+ date: 2015-01-28 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.36.0.beta.1
20
+ version: 0.36.0.beta.2
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.36.0.beta.1
27
+ version: 0.36.0.beta.2
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.21.0
48
+ version: 0.21.2
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.21.0
55
+ version: 0.21.2
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: cocoapods-downloader
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -256,10 +256,20 @@ files:
256
256
  - lib/cocoapods/command/list.rb
257
257
  - lib/cocoapods/command/outdated.rb
258
258
  - lib/cocoapods/command/project.rb
259
+ - lib/cocoapods/command/repo/add.rb
260
+ - lib/cocoapods/command/repo/lint.rb
261
+ - lib/cocoapods/command/repo/list.rb
259
262
  - lib/cocoapods/command/repo/push.rb
263
+ - lib/cocoapods/command/repo/remove.rb
264
+ - lib/cocoapods/command/repo/update.rb
260
265
  - lib/cocoapods/command/repo.rb
261
266
  - lib/cocoapods/command/search.rb
262
267
  - lib/cocoapods/command/setup.rb
268
+ - lib/cocoapods/command/spec/cat.rb
269
+ - lib/cocoapods/command/spec/create.rb
270
+ - lib/cocoapods/command/spec/edit.rb
271
+ - lib/cocoapods/command/spec/lint.rb
272
+ - lib/cocoapods/command/spec/which.rb
263
273
  - lib/cocoapods/command/spec.rb
264
274
  - lib/cocoapods/command.rb
265
275
  - lib/cocoapods/config.rb
@@ -353,3 +363,4 @@ signing_key:
353
363
  specification_version: 3
354
364
  summary: The Cocoa library package manager.
355
365
  test_files: []
366
+ has_rdoc: