cocoapods 1.4.0 → 1.5.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (48) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +149 -0
  3. data/lib/cocoapods.rb +1 -0
  4. data/lib/cocoapods/command/outdated.rb +2 -2
  5. data/lib/cocoapods/command/repo/push.rb +5 -0
  6. data/lib/cocoapods/command/update.rb +21 -5
  7. data/lib/cocoapods/gem_version.rb +1 -1
  8. data/lib/cocoapods/generator/acknowledgements.rb +6 -3
  9. data/lib/cocoapods/generator/constant.rb +19 -0
  10. data/lib/cocoapods/generator/copy_resources_script.rb +15 -3
  11. data/lib/cocoapods/generator/embed_frameworks_script.rb +11 -2
  12. data/lib/cocoapods/generator/module_map.rb +56 -5
  13. data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +19 -13
  14. data/lib/cocoapods/generator/xcconfig/pod_xcconfig.rb +4 -6
  15. data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +25 -2
  16. data/lib/cocoapods/installer.rb +17 -8
  17. data/lib/cocoapods/installer/analyzer.rb +48 -38
  18. data/lib/cocoapods/installer/analyzer/analysis_result.rb +11 -0
  19. data/lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb +7 -6
  20. data/lib/cocoapods/installer/analyzer/pod_variant.rb +8 -8
  21. data/lib/cocoapods/installer/analyzer/pod_variant_set.rb +3 -3
  22. data/lib/cocoapods/installer/analyzer/podfile_dependency_cache.rb +54 -0
  23. data/lib/cocoapods/installer/analyzer/specs_state.rb +16 -16
  24. data/lib/cocoapods/installer/analyzer/target_inspector.rb +7 -11
  25. data/lib/cocoapods/installer/pod_source_installer.rb +2 -3
  26. data/lib/cocoapods/installer/podfile_validator.rb +11 -10
  27. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +72 -28
  28. data/lib/cocoapods/installer/xcode/pods_project_generator.rb +8 -2
  29. data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb +9 -0
  30. data/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb +32 -24
  31. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +97 -54
  32. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +9 -11
  33. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb +4 -9
  34. data/lib/cocoapods/installer/xcode/target_validator.rb +32 -18
  35. data/lib/cocoapods/project.rb +32 -17
  36. data/lib/cocoapods/resolver.rb +59 -31
  37. data/lib/cocoapods/resolver/lazy_specification.rb +28 -18
  38. data/lib/cocoapods/sandbox.rb +2 -4
  39. data/lib/cocoapods/sandbox/file_accessor.rb +25 -9
  40. data/lib/cocoapods/sandbox/headers_store.rb +31 -6
  41. data/lib/cocoapods/sandbox/path_list.rb +36 -46
  42. data/lib/cocoapods/target.rb +7 -4
  43. data/lib/cocoapods/target/aggregate_target.rb +10 -8
  44. data/lib/cocoapods/target/pod_target.rb +87 -20
  45. data/lib/cocoapods/user_interface/error_report.rb +1 -1
  46. data/lib/cocoapods/user_interface/inspector_reporter.rb +4 -4
  47. data/lib/cocoapods/validator.rb +40 -29
  48. metadata +11 -9
@@ -32,7 +32,7 @@ module Pod
32
32
 
33
33
  ```
34
34
  #{exception.class} - #{exception.message}
35
- #{exception.backtrace.join("\n")}
35
+ #{exception.backtrace.join("\n") if exception.backtrace}
36
36
  ```
37
37
 
38
38
  #{'――― TEMPLATE END ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――'.reversed}
@@ -19,7 +19,7 @@ module Pod
19
19
  UI.puts "Looking for related issues on #{inspector.repo_owner}/#{inspector.repo_name}..."
20
20
  end
21
21
 
22
- # Called once the inspector has recieved a report with more than one issue,
22
+ # Called once the inspector has received a report with more than one issue,
23
23
  # showing the top 3 issues, and offering a link to see more.
24
24
  #
25
25
  # @param [GhInspector::InspectionReport] report
@@ -30,7 +30,7 @@ module Pod
30
30
  #
31
31
  # @return [void]
32
32
  #
33
- def inspector_successfully_recieved_report(report, _)
33
+ def inspector_successfully_received_report(report, _)
34
34
  report.issues[0..2].each { |issue| print_issue_full(issue) }
35
35
 
36
36
  if report.issues.count > 3
@@ -39,7 +39,7 @@ module Pod
39
39
  end
40
40
  end
41
41
 
42
- # Called once the report has been recieved, but when there are no issues found.
42
+ # Called once the report has been received, but when there are no issues found.
43
43
  #
44
44
  # @param [GhInspector::InspectionReport] report
45
45
  # An empty report
@@ -49,7 +49,7 @@ module Pod
49
49
  #
50
50
  # @return [void]
51
51
  #
52
- def inspector_recieved_empty_report(_, inspector)
52
+ def inspector_received_empty_report(_, inspector)
53
53
  UI.puts 'Found no similar issues. To create a new issue, please visit:'
54
54
  UI.puts "https://github.com/#{inspector.repo_owner}/#{inspector.repo_name}/issues/new"
55
55
  end
@@ -398,8 +398,8 @@ module Pod
398
398
  #
399
399
  def validate_source_url(spec)
400
400
  return if spec.source.nil? || spec.source[:http].nil?
401
- url = spec.source[:http]
402
- return if url.downcase.start_with?('https://')
401
+ url = URI(spec.source[:http])
402
+ return if url.scheme == 'https' || url.scheme == 'file'
403
403
  warning('http', "The URL (`#{url}`) doesn't use the encrypted HTTPs protocol. " \
404
404
  'It is crucial for Pods to be transferred over a secure protocol to protect your users from man-in-the-middle attacks. '\
405
405
  'This will be an error in future releases. Please update the URL to use https.')
@@ -506,13 +506,10 @@ module Pod
506
506
  end
507
507
 
508
508
  def configure_pod_targets(targets, deployment_target)
509
+ test_only_pod_targets = @installer.pod_targets - targets.flat_map(&:pod_targets)
509
510
  targets.each do |target|
510
511
  target.pod_targets.each do |pod_target|
511
- next unless (native_target = pod_target.native_target)
512
- native_target.build_configuration_list.build_configurations.each do |build_configuration|
513
- (build_configuration.build_settings['OTHER_CFLAGS'] ||= '$(inherited)') << ' -Wincomplete-umbrella'
514
- build_configuration.build_settings['SWIFT_VERSION'] = (pod_target.swift_version || swift_version) if pod_target.uses_swift?
515
- end
512
+ update_pod_target_build_settings(pod_target)
516
513
  if pod_target.uses_swift?
517
514
  pod_target.test_native_targets.each do |test_native_target|
518
515
  test_native_target.build_configuration_list.build_configurations.each do |build_configuration|
@@ -527,6 +524,20 @@ module Pod
527
524
  error('swift', 'Swift support uses dynamic frameworks and is therefore only supported on iOS > 8.') unless uses_xctest
528
525
  end
529
526
  end
527
+ # Wire up Swift version to pod targets used only by tests.
528
+ test_only_pod_targets.each do |test_pod_target|
529
+ update_pod_target_build_settings(test_pod_target)
530
+ end
531
+ end
532
+
533
+ def update_pod_target_build_settings(pod_target)
534
+ native_target = pod_target.native_target
535
+ unless native_target.nil?
536
+ native_target.build_configuration_list.build_configurations.each do |build_configuration|
537
+ (build_configuration.build_settings['OTHER_CFLAGS'] ||= '$(inherited)') << ' -Wincomplete-umbrella'
538
+ build_configuration.build_settings['SWIFT_VERSION'] = (pod_target.swift_version || swift_version) if pod_target.uses_swift?
539
+ end
540
+ end
530
541
  end
531
542
 
532
543
  def validate_vendored_dynamic_frameworks
@@ -545,46 +556,49 @@ module Pod
545
556
  # Performs platform specific analysis. It requires to download the source
546
557
  # at each iteration
547
558
  #
548
- # @note Xcode warnings are treaded as notes because the spec maintainer
559
+ # @note Xcode warnings are treated as notes because the spec maintainer
549
560
  # might not be the author of the library
550
561
  #
551
562
  # @return [void]
552
563
  #
553
564
  def build_pod
554
565
  if !xcodebuild_available?
555
- UI.warn "Skipping compilation with `xcodebuild' because it can't be found.\n".yellow
566
+ UI.warn "Skipping compilation with `xcodebuild` because it can't be found.\n".yellow
556
567
  else
557
- UI.message "\nBuilding with xcodebuild.\n".yellow do
568
+ UI.message "\nBuilding with `xcodebuild`.\n".yellow do
558
569
  scheme = if skip_import_validation?
559
- @installer.pod_targets.find { |pt| pt.pod_name == spec.root.name }.label
570
+ pod_target = @installer.pod_targets.find { |pt| pt.pod_name == spec.root.name }
571
+ pod_target.label if pod_target.should_build?
560
572
  else
561
573
  'App'
562
574
  end
563
- output = xcodebuild('build', scheme, 'Release')
564
- UI.puts output
565
- parsed_output = parse_xcodebuild_output(output)
566
- translate_output_to_linter_messages(parsed_output)
575
+ if scheme.nil?
576
+ UI.warn "Skipping compilation with `xcodebuild` because target contains no sources.\n".yellow
577
+ else
578
+ output = xcodebuild('build', scheme, 'Release')
579
+ parsed_output = parse_xcodebuild_output(output)
580
+ translate_output_to_linter_messages(parsed_output)
581
+ end
567
582
  end
568
583
  end
569
584
  end
570
585
 
571
586
  # Builds and runs all test sources associated with the current specification being validated.
572
587
  #
573
- # @note Xcode warnings are treaded as notes because the spec maintainer
588
+ # @note Xcode warnings are treated as notes because the spec maintainer
574
589
  # might not be the author of the library
575
590
  #
576
591
  # @return [void]
577
592
  #
578
593
  def test_pod
579
594
  if !xcodebuild_available?
580
- UI.warn "Skipping test validation with `xcodebuild' because it can't be found.\n".yellow
595
+ UI.warn "Skipping test validation with `xcodebuild` because it can't be found.\n".yellow
581
596
  else
582
- UI.message "\nTesting with xcodebuild.\n".yellow do
597
+ UI.message "\nTesting with `xcodebuild`.\n".yellow do
583
598
  pod_target = @installer.pod_targets.find { |pt| pt.pod_name == spec.root.name }
584
599
  consumer.spec.test_specs.each do |test_spec|
585
600
  scheme = pod_target.native_target_for_spec(test_spec)
586
601
  output = xcodebuild('test', scheme, 'Debug')
587
- UI.puts output
588
602
  parsed_output = parse_xcodebuild_output(output)
589
603
  translate_output_to_linter_messages(parsed_output)
590
604
  end
@@ -857,25 +871,22 @@ module Pod
857
871
  command += Fourflusher::SimControl.new.destination(:oldest, 'tvOS', deployment_target)
858
872
  end
859
873
 
860
- output, status = _xcodebuild(command)
861
-
862
- unless status.success?
874
+ begin
875
+ _xcodebuild(command, true)
876
+ rescue => e
863
877
  message = 'Returned an unsuccessful exit code.'
864
878
  message += ' You can use `--verbose` for more information.' unless config.verbose?
865
879
  error('xcodebuild', message)
880
+ e.message
866
881
  end
867
-
868
- output
869
882
  end
870
883
 
871
884
  # Executes the given command in the current working directory.
872
885
  #
873
- # @return [(String, Status)] The output of the given command and its
874
- # resulting status.
886
+ # @return [String] The output of the given command
875
887
  #
876
- def _xcodebuild(command)
877
- UI.puts 'xcodebuild ' << command.join(' ') if config.verbose
878
- Executable.capture_command('xcodebuild', command, :capture => :merge)
888
+ def _xcodebuild(command, raise_on_failure = false)
889
+ Executable.execute_command('xcodebuild', command, raise_on_failure)
879
890
  end
880
891
 
881
892
  #-------------------------------------------------------------------------#
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: 1.4.0
4
+ version: 1.5.0.beta.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2018-01-18 00:00:00.000000000 Z
14
+ date: 2018-03-22 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cocoapods-core
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.4.0
22
+ version: 1.5.0.beta.1
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.4.0
29
+ version: 1.5.0.beta.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: claide
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -193,21 +193,21 @@ dependencies:
193
193
  requirements:
194
194
  - - "~>"
195
195
  - !ruby/object:Gem::Version
196
- version: 0.6.4
196
+ version: 0.6.5
197
197
  type: :runtime
198
198
  prerelease: false
199
199
  version_requirements: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - "~>"
202
202
  - !ruby/object:Gem::Version
203
- version: 0.6.4
203
+ version: 0.6.5
204
204
  - !ruby/object:Gem::Dependency
205
205
  name: xcodeproj
206
206
  requirement: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
- version: 1.5.4
210
+ version: 1.5.7
211
211
  - - "<"
212
212
  - !ruby/object:Gem::Version
213
213
  version: '2.0'
@@ -217,7 +217,7 @@ dependencies:
217
217
  requirements:
218
218
  - - ">="
219
219
  - !ruby/object:Gem::Version
220
- version: 1.5.4
220
+ version: 1.5.7
221
221
  - - "<"
222
222
  - !ruby/object:Gem::Version
223
223
  version: '2.0'
@@ -445,6 +445,7 @@ files:
445
445
  - lib/cocoapods/generator/acknowledgements/plist.rb
446
446
  - lib/cocoapods/generator/app_target_helper.rb
447
447
  - lib/cocoapods/generator/bridge_support.rb
448
+ - lib/cocoapods/generator/constant.rb
448
449
  - lib/cocoapods/generator/copy_resources_script.rb
449
450
  - lib/cocoapods/generator/dummy_source.rb
450
451
  - lib/cocoapods/generator/embed_frameworks_script.rb
@@ -464,6 +465,7 @@ files:
464
465
  - lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb
465
466
  - lib/cocoapods/installer/analyzer/pod_variant.rb
466
467
  - lib/cocoapods/installer/analyzer/pod_variant_set.rb
468
+ - lib/cocoapods/installer/analyzer/podfile_dependency_cache.rb
467
469
  - lib/cocoapods/installer/analyzer/sandbox_analyzer.rb
468
470
  - lib/cocoapods/installer/analyzer/specs_state.rb
469
471
  - lib/cocoapods/installer/analyzer/target_inspection_result.rb
@@ -524,7 +526,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
524
526
  version: '0'
525
527
  requirements: []
526
528
  rubyforge_project:
527
- rubygems_version: 2.7.4
529
+ rubygems_version: 2.7.6
528
530
  signing_key:
529
531
  specification_version: 3
530
532
  summary: The Cocoa library package manager.