cocoapods 1.10.1 → 1.11.0.rc.1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +224 -5
- data/README.md +11 -11
- data/lib/cocoapods/command/outdated.rb +12 -1
- data/lib/cocoapods/command/repo/push.rb +17 -0
- data/lib/cocoapods/command/spec/cat.rb +3 -1
- data/lib/cocoapods/command/spec/lint.rb +1 -1
- data/lib/cocoapods/command/spec/which.rb +3 -1
- data/lib/cocoapods/command/spec.rb +18 -9
- data/lib/cocoapods/config.rb +1 -1
- data/lib/cocoapods/downloader/cache.rb +95 -6
- data/lib/cocoapods/downloader.rb +4 -2
- data/lib/cocoapods/external_sources/podspec_source.rb +1 -1
- data/lib/cocoapods/gem_version.rb +1 -1
- data/lib/cocoapods/generator/acknowledgements.rb +1 -1
- data/lib/cocoapods/generator/app_target_helper.rb +7 -3
- data/lib/cocoapods/generator/copy_dsyms_script.rb +4 -4
- data/lib/cocoapods/generator/copy_xcframework_script.rb +4 -48
- data/lib/cocoapods/generator/embed_frameworks_script.rb +2 -1
- data/lib/cocoapods/generator/script_phase_constants.rb +1 -0
- data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +31 -4
- data/lib/cocoapods/installer/analyzer.rb +12 -8
- data/lib/cocoapods/installer/podfile_validator.rb +2 -2
- data/lib/cocoapods/installer/pre_integrate_hooks_context.rb +9 -0
- data/lib/cocoapods/installer/project_cache/project_cache_analyzer.rb +9 -2
- data/lib/cocoapods/installer/project_cache/project_installation_cache.rb +15 -2
- data/lib/cocoapods/installer/project_cache/target_cache_key.rb +7 -4
- data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +149 -9
- data/lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb +10 -3
- data/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb +25 -6
- data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_dependency_installer.rb +6 -19
- data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +70 -58
- data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +48 -6
- data/lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb +2 -2
- data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb +2 -5
- data/lib/cocoapods/installer/xcode/pods_project_generator.rb +1 -1
- data/lib/cocoapods/installer.rb +52 -4
- data/lib/cocoapods/resolver.rb +4 -4
- data/lib/cocoapods/sandbox/file_accessor.rb +57 -10
- data/lib/cocoapods/sandbox/headers_store.rb +3 -1
- data/lib/cocoapods/sandbox/path_list.rb +1 -1
- data/lib/cocoapods/sandbox/pod_dir_cleaner.rb +1 -1
- data/lib/cocoapods/sources_manager.rb +14 -8
- data/lib/cocoapods/target/aggregate_target.rb +23 -1
- data/lib/cocoapods/target/build_settings.rb +45 -36
- data/lib/cocoapods/target/pod_target.rb +47 -22
- data/lib/cocoapods/user_interface.rb +4 -0
- data/lib/cocoapods/validator.rb +25 -5
- data/lib/cocoapods/version_metadata.rb +1 -1
- data/lib/cocoapods/xcode/xcframework.rb +8 -3
- metadata +28 -21
@@ -140,12 +140,12 @@ module Pod
|
|
140
140
|
end
|
141
141
|
private_class_method :define_build_settings_method
|
142
142
|
|
143
|
-
# @param [XCFramework] xcframework the xcframework
|
143
|
+
# @param [XCFramework] xcframework the xcframework slice that will be copied to the intermediates dir
|
144
144
|
#
|
145
145
|
# @return [String] the path to the directory containing the xcframework slice
|
146
146
|
#
|
147
147
|
def self.xcframework_intermediate_dir(xcframework)
|
148
|
-
"#{XCFRAMEWORKS_BUILD_DIR_VARIABLE}/#{xcframework.
|
148
|
+
"#{XCFRAMEWORKS_BUILD_DIR_VARIABLE}/#{xcframework.target_name}"
|
149
149
|
end
|
150
150
|
|
151
151
|
class << self
|
@@ -346,18 +346,26 @@ module Pod
|
|
346
346
|
#
|
347
347
|
# @param [Boolean] test_bundle
|
348
348
|
#
|
349
|
-
def _ld_runpath_search_paths(requires_host_target: false, test_bundle: false)
|
349
|
+
def _ld_runpath_search_paths(requires_host_target: false, test_bundle: false, uses_swift: false)
|
350
|
+
paths = []
|
351
|
+
if uses_swift
|
352
|
+
paths << '/usr/lib/swift'
|
353
|
+
paths << '$(PLATFORM_DIR)/Developer/Library/Frameworks' if test_bundle
|
354
|
+
end
|
350
355
|
if target.platform.symbolic_name == :osx
|
351
|
-
|
352
|
-
|
356
|
+
paths << "'@executable_path/../Frameworks'"
|
357
|
+
paths << if test_bundle
|
358
|
+
"'@loader_path/../Frameworks'"
|
359
|
+
else
|
360
|
+
"'@loader_path/Frameworks'"
|
361
|
+
end
|
362
|
+
paths << '${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}' if uses_swift
|
353
363
|
else
|
354
|
-
paths
|
355
|
-
|
356
|
-
"'@loader_path/Frameworks'",
|
357
|
-
]
|
364
|
+
paths << "'@executable_path/Frameworks'"
|
365
|
+
paths << "'@loader_path/Frameworks'"
|
358
366
|
paths << "'@executable_path/../../Frameworks'" if requires_host_target
|
359
|
-
paths
|
360
367
|
end
|
368
|
+
paths
|
361
369
|
end
|
362
370
|
private :_ld_runpath_search_paths
|
363
371
|
|
@@ -500,12 +508,14 @@ module Pod
|
|
500
508
|
pod_targets - subset_targets
|
501
509
|
end
|
502
510
|
|
511
|
+
# @param [String] target_name the name of the target this xcframework belongs to
|
512
|
+
#
|
503
513
|
# @param [Pathname,String] path the path to the xcframework bundle
|
504
514
|
#
|
505
515
|
# @return [Xcode::XCFramework] the xcframework at the given path
|
506
516
|
#
|
507
|
-
def load_xcframework(path)
|
508
|
-
Xcode::XCFramework.new(path)
|
517
|
+
def load_xcframework(target_name, path)
|
518
|
+
Xcode::XCFramework.new(target_name, path)
|
509
519
|
end
|
510
520
|
|
511
521
|
# A subclass that generates build settings for a {PodTarget}
|
@@ -616,9 +626,15 @@ module Pod
|
|
616
626
|
select { |xcf| xcf.build_type.static_framework? }.
|
617
627
|
map(&:name).
|
618
628
|
uniq
|
629
|
+
|
630
|
+
# Include direct dynamic dependencies to the linker flags. We used to add those in the 'Link Binary With Libraries'
|
631
|
+
# phase but we no longer do since we cannot differentiate between debug or release configurations within
|
632
|
+
# that phase.
|
633
|
+
frameworks.concat target.dependent_targets_by_config[@configuration].flat_map { |pt| pt.build_settings[@configuration].dynamic_frameworks_to_import }
|
634
|
+
else
|
635
|
+
# Also include any vendored dynamic frameworks of dependencies.
|
636
|
+
frameworks.concat dependent_targets.reject(&:should_build?).flat_map { |pt| pt.build_settings[@configuration].dynamic_frameworks_to_import }
|
619
637
|
end
|
620
|
-
# Also include any vendored dynamic frameworks of dependencies.
|
621
|
-
frameworks.concat dependent_targets.reject(&:should_build?).flat_map { |pt| pt.build_settings[@configuration].dynamic_frameworks_to_import }
|
622
638
|
else
|
623
639
|
frameworks.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings[@configuration].frameworks_to_import }
|
624
640
|
end
|
@@ -721,7 +737,9 @@ module Pod
|
|
721
737
|
|
722
738
|
# @return [Array<Xcode::XCFramework>]
|
723
739
|
define_build_settings_method :vendored_xcframeworks, :memoized => true do
|
724
|
-
file_accessors.flat_map
|
740
|
+
file_accessors.flat_map do |file_accessor|
|
741
|
+
file_accessor.vendored_xcframeworks.map { |path| load_xcframework(file_accessor.spec.name, path) }
|
742
|
+
end
|
725
743
|
end
|
726
744
|
|
727
745
|
# @return [Array<String>]
|
@@ -840,10 +858,15 @@ module Pod
|
|
840
858
|
|
841
859
|
# @return [Array<String>]
|
842
860
|
define_build_settings_method :library_search_paths_to_import, :memoized => true do
|
843
|
-
|
844
|
-
|
861
|
+
search_paths = vendored_static_library_search_paths + vendored_dynamic_library_search_paths
|
862
|
+
if target.uses_swift? || other_swift_flags_without_swift?
|
863
|
+
search_paths << '/usr/lib/swift'
|
864
|
+
search_paths << '${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}'
|
865
|
+
search_paths << '$(PLATFORM_DIR)/Developer/Library/Frameworks' if test_xcconfig?
|
866
|
+
end
|
867
|
+
return search_paths if target.build_as_framework? || !target.should_build?
|
845
868
|
|
846
|
-
|
869
|
+
search_paths << target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)
|
847
870
|
end
|
848
871
|
|
849
872
|
#-------------------------------------------------------------------------#
|
@@ -948,7 +971,8 @@ module Pod
|
|
948
971
|
# @return [Array<String>]
|
949
972
|
define_build_settings_method :ld_runpath_search_paths, :build_setting => true, :memoized => true do
|
950
973
|
return if library_xcconfig?
|
951
|
-
_ld_runpath_search_paths(:test_bundle => test_xcconfig
|
974
|
+
_ld_runpath_search_paths(:test_bundle => test_xcconfig?,
|
975
|
+
:uses_swift => other_swift_flags_without_swift? || dependent_targets.any?(&:uses_swift?))
|
952
976
|
end
|
953
977
|
|
954
978
|
#-------------------------------------------------------------------------#
|
@@ -1251,7 +1275,8 @@ module Pod
|
|
1251
1275
|
return unless pod_targets.any?(&:build_as_dynamic?) || any_vendored_dynamic_artifacts?
|
1252
1276
|
symbol_type = target.user_targets.map(&:symbol_type).uniq.first
|
1253
1277
|
test_bundle = symbol_type == :octest_bundle || symbol_type == :unit_test_bundle || symbol_type == :ui_test_bundle
|
1254
|
-
_ld_runpath_search_paths(:requires_host_target => target.requires_host_target?, :test_bundle => test_bundle
|
1278
|
+
_ld_runpath_search_paths(:requires_host_target => target.requires_host_target?, :test_bundle => test_bundle,
|
1279
|
+
:uses_swift => pod_targets.any?(&:uses_swift?))
|
1255
1280
|
end
|
1256
1281
|
|
1257
1282
|
# @return [Boolean]
|
@@ -1263,24 +1288,8 @@ module Pod
|
|
1263
1288
|
end
|
1264
1289
|
end
|
1265
1290
|
|
1266
|
-
# @return [Boolean]
|
1267
|
-
define_build_settings_method :any_vendored_static_xcframeworks?, :memoized => true do
|
1268
|
-
pod_targets.any? do |pt|
|
1269
|
-
pt.build_settings.any? do |bs|
|
1270
|
-
if bs.respond_to?(:vendored_xcframeworks)
|
1271
|
-
bs.vendored_xcframeworks.any? do |xcf|
|
1272
|
-
xcf.build_type == BuildType.static_framework
|
1273
|
-
end
|
1274
|
-
end
|
1275
|
-
end
|
1276
|
-
end
|
1277
|
-
end
|
1278
|
-
|
1279
1291
|
# @return [Boolean]
|
1280
1292
|
define_build_settings_method :any_vendored_static_artifacts?, :memoized => true do
|
1281
|
-
if any_vendored_static_xcframeworks?
|
1282
|
-
return true
|
1283
|
-
end
|
1284
1293
|
pod_targets.any? do |pt|
|
1285
1294
|
pt.file_accessors.any? do |fa|
|
1286
1295
|
!fa.vendored_static_artifacts.empty?
|
@@ -203,7 +203,7 @@ module Pod
|
|
203
203
|
end
|
204
204
|
end
|
205
205
|
|
206
|
-
# @return [Array<
|
206
|
+
# @return [Array<Pathname>] The list of all files tracked.
|
207
207
|
#
|
208
208
|
def all_files
|
209
209
|
Sandbox::FileAccessor.all_files(file_accessors)
|
@@ -268,6 +268,23 @@ module Pod
|
|
268
268
|
root_spec.module_name
|
269
269
|
end
|
270
270
|
|
271
|
+
# @param [Specification] spec the specification
|
272
|
+
#
|
273
|
+
# @return [String] the product basename of the specification's target
|
274
|
+
def product_basename_for_spec(spec)
|
275
|
+
user_specified = build_settings_by_config_for_spec(spec).
|
276
|
+
each_value.
|
277
|
+
map { |settings| settings.merged_pod_target_xcconfigs['PRODUCT_NAME'] }.
|
278
|
+
compact.
|
279
|
+
uniq
|
280
|
+
|
281
|
+
if user_specified.size == 1
|
282
|
+
user_specified.first
|
283
|
+
else
|
284
|
+
spec_label(spec)
|
285
|
+
end
|
286
|
+
end
|
287
|
+
|
271
288
|
# @return [Bool] Whether or not this target should be built.
|
272
289
|
#
|
273
290
|
# A target should not be built if it has no source files.
|
@@ -294,22 +311,26 @@ module Pod
|
|
294
311
|
test_specs.map { |test_spec| test_spec.consumer(platform) }
|
295
312
|
end
|
296
313
|
|
297
|
-
# @return [Array<Specification::Consumer>] the
|
314
|
+
# @return [Array<Specification::Consumer>] the app specification consumers for
|
298
315
|
# the target.
|
299
316
|
#
|
300
317
|
def app_spec_consumers
|
301
318
|
app_specs.map { |app_spec| app_spec.consumer(platform) }
|
302
319
|
end
|
303
320
|
|
304
|
-
#
|
321
|
+
# Checks whether the target itself plus its specs uses Swift code.
|
322
|
+
# This check excludes source files from non library specs.
|
323
|
+
# Note that if a target does not need to be built (no source code),
|
324
|
+
# we fallback to check whether it indicates a swift version.
|
325
|
+
#
|
326
|
+
# @return [Boolean] Whether the target uses Swift code.
|
305
327
|
#
|
306
328
|
def uses_swift?
|
307
329
|
return @uses_swift if defined? @uses_swift
|
308
|
-
@uses_swift =
|
330
|
+
@uses_swift = (!should_build? && !spec_swift_versions.empty?) ||
|
309
331
|
file_accessors.select { |a| a.spec.library_specification? }.any? do |file_accessor|
|
310
332
|
uses_swift_for_spec?(file_accessor.spec)
|
311
333
|
end
|
312
|
-
end
|
313
334
|
end
|
314
335
|
|
315
336
|
# Checks whether a specification uses Swift or not.
|
@@ -373,7 +394,7 @@ module Pod
|
|
373
394
|
!test_specs.empty?
|
374
395
|
end
|
375
396
|
|
376
|
-
# @return [Boolean] Whether the target has any
|
397
|
+
# @return [Boolean] Whether the target has any app specifications.
|
377
398
|
#
|
378
399
|
def contains_app_specifications?
|
379
400
|
!app_specs.empty?
|
@@ -422,7 +443,7 @@ module Pod
|
|
422
443
|
@xcframeworks ||= begin
|
423
444
|
file_accessors.each_with_object({}) do |file_accessor, hash|
|
424
445
|
frameworks = file_accessor.vendored_xcframeworks.map do |framework_path|
|
425
|
-
Xcode::XCFramework.new(framework_path)
|
446
|
+
Xcode::XCFramework.new(file_accessor.spec.name, framework_path)
|
426
447
|
end
|
427
448
|
hash[file_accessor.spec.name] = frameworks
|
428
449
|
end
|
@@ -455,7 +476,7 @@ module Pod
|
|
455
476
|
prefix = Pod::Target::BuildSettings::CONFIGURATION_BUILD_DIR_VARIABLE
|
456
477
|
prefix = configuration_build_dir unless file_accessor.spec.test_specification?
|
457
478
|
resource_bundle_paths = file_accessor.resource_bundles.keys.map { |name| "#{prefix}/#{name.shellescape}.bundle" }
|
458
|
-
hash[file_accessor.spec.name] = resource_paths + resource_bundle_paths
|
479
|
+
hash[file_accessor.spec.name] = (resource_paths + resource_bundle_paths).map(&:to_s)
|
459
480
|
end
|
460
481
|
end
|
461
482
|
end
|
@@ -512,7 +533,7 @@ module Pod
|
|
512
533
|
# @return [Specification] The root specification for the target.
|
513
534
|
#
|
514
535
|
def root_spec
|
515
|
-
specs.first.root
|
536
|
+
@root_spec ||= specs.first.root
|
516
537
|
end
|
517
538
|
|
518
539
|
# @return [String] The name of the Pod that this target refers to.
|
@@ -619,13 +640,16 @@ module Pod
|
|
619
640
|
end
|
620
641
|
end
|
621
642
|
|
622
|
-
def
|
643
|
+
def spec_label(spec)
|
623
644
|
case spec.spec_type
|
645
|
+
when :library then label
|
624
646
|
when :test then test_target_label(spec)
|
625
647
|
when :app then app_target_label(spec)
|
626
648
|
else raise ArgumentError, "Unhandled spec type #{spec.spec_type.inspect} for #{spec.inspect}"
|
627
649
|
end
|
628
650
|
end
|
651
|
+
# for backwards compatibility
|
652
|
+
alias non_library_spec_label spec_label
|
629
653
|
|
630
654
|
# @param [Specification] spec
|
631
655
|
# The spec to return scheme configuration for.
|
@@ -645,7 +669,7 @@ module Pod
|
|
645
669
|
# @return [Pathname] The absolute path of the copy resources script for the given spec.
|
646
670
|
#
|
647
671
|
def copy_resources_script_path_for_spec(spec)
|
648
|
-
support_files_dir + "#{
|
672
|
+
support_files_dir + "#{spec_label(spec)}-resources.sh"
|
649
673
|
end
|
650
674
|
|
651
675
|
# @param [Specification] spec
|
@@ -654,7 +678,7 @@ module Pod
|
|
654
678
|
# @return [Pathname] The absolute path of the copy resources script input file list for the given spec.
|
655
679
|
#
|
656
680
|
def copy_resources_script_input_files_path_for_spec(spec)
|
657
|
-
support_files_dir + "#{
|
681
|
+
support_files_dir + "#{spec_label(spec)}-resources-input-files.xcfilelist"
|
658
682
|
end
|
659
683
|
|
660
684
|
# @param [Specification] spec
|
@@ -663,7 +687,7 @@ module Pod
|
|
663
687
|
# @return [Pathname] The absolute path of the copy resources script output file list for the given spec.
|
664
688
|
#
|
665
689
|
def copy_resources_script_output_files_path_for_spec(spec)
|
666
|
-
support_files_dir + "#{
|
690
|
+
support_files_dir + "#{spec_label(spec)}-resources-output-files.xcfilelist"
|
667
691
|
end
|
668
692
|
|
669
693
|
# @param [Specification] spec
|
@@ -672,7 +696,7 @@ module Pod
|
|
672
696
|
# @return [Pathname] The absolute path of the embed frameworks script for the given spec.
|
673
697
|
#
|
674
698
|
def embed_frameworks_script_path_for_spec(spec)
|
675
|
-
support_files_dir + "#{
|
699
|
+
support_files_dir + "#{spec_label(spec)}-frameworks.sh"
|
676
700
|
end
|
677
701
|
|
678
702
|
# @param [Specification] spec
|
@@ -681,7 +705,7 @@ module Pod
|
|
681
705
|
# @return [Pathname] The absolute path of the embed frameworks script input file list for the given spec.
|
682
706
|
#
|
683
707
|
def embed_frameworks_script_input_files_path_for_spec(spec)
|
684
|
-
support_files_dir + "#{
|
708
|
+
support_files_dir + "#{spec_label(spec)}-frameworks-input-files.xcfilelist"
|
685
709
|
end
|
686
710
|
|
687
711
|
# @param [Specification] spec
|
@@ -690,7 +714,7 @@ module Pod
|
|
690
714
|
# @return [Pathname] The absolute path of the embed frameworks script output file list for the given spec.
|
691
715
|
#
|
692
716
|
def embed_frameworks_script_output_files_path_for_spec(spec)
|
693
|
-
support_files_dir + "#{
|
717
|
+
support_files_dir + "#{spec_label(spec)}-frameworks-output-files.xcfilelist"
|
694
718
|
end
|
695
719
|
|
696
720
|
# @return [Pathname] The absolute path of the copy xcframeworks script.
|
@@ -721,7 +745,7 @@ module Pod
|
|
721
745
|
# @todo Remove in 2.0
|
722
746
|
#
|
723
747
|
def prepare_artifacts_script_path_for_spec(spec)
|
724
|
-
support_files_dir + "#{
|
748
|
+
support_files_dir + "#{spec_label(spec)}-artifacts.sh"
|
725
749
|
end
|
726
750
|
|
727
751
|
# @param [Specification] spec
|
@@ -734,7 +758,7 @@ module Pod
|
|
734
758
|
# @todo Remove in 2.0
|
735
759
|
#
|
736
760
|
def prepare_artifacts_script_input_files_path_for_spec(spec)
|
737
|
-
support_files_dir + "#{
|
761
|
+
support_files_dir + "#{spec_label(spec)}-artifacts-input-files.xcfilelist"
|
738
762
|
end
|
739
763
|
|
740
764
|
# @param [Specification] spec
|
@@ -747,7 +771,7 @@ module Pod
|
|
747
771
|
# @todo Remove in 2.0
|
748
772
|
#
|
749
773
|
def prepare_artifacts_script_output_files_path_for_spec(spec)
|
750
|
-
support_files_dir + "#{
|
774
|
+
support_files_dir + "#{spec_label(spec)}-artifacts-output-files.xcfilelist"
|
751
775
|
end
|
752
776
|
|
753
777
|
# @return [Pathname] The absolute path of the copy dSYMs script.
|
@@ -774,7 +798,7 @@ module Pod
|
|
774
798
|
# @return [Pathname] The absolute path of the Info.plist for the given spec.
|
775
799
|
#
|
776
800
|
def info_plist_path_for_spec(spec)
|
777
|
-
support_files_dir + "#{
|
801
|
+
support_files_dir + "#{spec_label(spec)}-Info.plist"
|
778
802
|
end
|
779
803
|
|
780
804
|
# @param [Specification] spec
|
@@ -783,7 +807,7 @@ module Pod
|
|
783
807
|
# @return [Pathname] the absolute path of the prefix header file for the given spec.
|
784
808
|
#
|
785
809
|
def prefix_header_path_for_spec(spec)
|
786
|
-
support_files_dir + "#{
|
810
|
+
support_files_dir + "#{spec_label(spec)}-prefix.pch"
|
787
811
|
end
|
788
812
|
|
789
813
|
# @return [Array<String>] The names of the Pods on which this target
|
@@ -1054,7 +1078,8 @@ module Pod
|
|
1054
1078
|
#
|
1055
1079
|
def uses_modular_headers?(only_if_defines_modules = true)
|
1056
1080
|
return false if only_if_defines_modules && !defines_module?
|
1057
|
-
|
1081
|
+
return @uses_modular_headers if defined? @uses_modular_headers
|
1082
|
+
@uses_modular_headers = spec_consumers.none?(&:header_mappings_dir) && spec_consumers.none?(&:header_dir)
|
1058
1083
|
end
|
1059
1084
|
|
1060
1085
|
private
|
@@ -137,6 +137,10 @@ module Pod
|
|
137
137
|
# The indentation level relative to the current,
|
138
138
|
# when the message is printed.
|
139
139
|
#
|
140
|
+
# @yield The action, this block is always executed.
|
141
|
+
#
|
142
|
+
# @return [void]
|
143
|
+
#
|
140
144
|
def message(message, verbose_prefix = '', relative_indentation = 2)
|
141
145
|
message = verbose_prefix + message if config.verbose?
|
142
146
|
puts_indented message if config.verbose?
|
data/lib/cocoapods/validator.rb
CHANGED
@@ -118,7 +118,7 @@ module Pod
|
|
118
118
|
# Replace default spec with a subspec if asked for
|
119
119
|
a_spec = spec
|
120
120
|
if spec && @only_subspec
|
121
|
-
subspec_name = @only_subspec.start_with?(spec.root.name) ? @only_subspec : "#{spec.root.name}/#{@only_subspec}"
|
121
|
+
subspec_name = @only_subspec.start_with?("#{spec.root.name}/") ? @only_subspec : "#{spec.root.name}/#{@only_subspec}"
|
122
122
|
a_spec = spec.subspec_by_name(subspec_name, true, true)
|
123
123
|
@subspec_name = a_spec.name
|
124
124
|
end
|
@@ -443,7 +443,7 @@ module Pod
|
|
443
443
|
if !resp
|
444
444
|
warning('url', "There was a problem validating the URL #{url}.", true)
|
445
445
|
elsif !resp.success?
|
446
|
-
|
446
|
+
note('url', "The URL (#{url}) is not reachable.", true)
|
447
447
|
end
|
448
448
|
|
449
449
|
resp
|
@@ -581,6 +581,9 @@ module Pod
|
|
581
581
|
def create_app_project
|
582
582
|
app_project = Xcodeproj::Project.new(validation_dir + 'App.xcodeproj')
|
583
583
|
app_target = Pod::Generator::AppTargetHelper.add_app_target(app_project, consumer.platform_name, deployment_target)
|
584
|
+
sandbox = Sandbox.new(config.sandbox_root)
|
585
|
+
info_plist_path = app_project.path.dirname.+('App/App-Info.plist')
|
586
|
+
Pod::Installer::Xcode::PodsProjectGenerator::TargetInstallerHelper.create_info_plist_file_with_sandbox(sandbox, info_plist_path, app_target, '1.0.0', Platform.new(consumer.platform_name), :appl)
|
584
587
|
Pod::Generator::AppTargetHelper.add_swift_version(app_target, derived_swift_version)
|
585
588
|
# Lint will fail if a AppIcon is set but no image is found with such name
|
586
589
|
# Happens only with Static Frameworks enabled but shouldn't be set anyway
|
@@ -712,8 +715,9 @@ module Pod
|
|
712
715
|
if scheme.nil?
|
713
716
|
UI.warn "Skipping compilation with `xcodebuild` because target contains no sources.\n".yellow
|
714
717
|
else
|
718
|
+
requested_configuration = configuration ? configuration : 'Release'
|
715
719
|
if analyze
|
716
|
-
output = xcodebuild('analyze', scheme,
|
720
|
+
output = xcodebuild('analyze', scheme, requested_configuration, :deployment_target => deployment_target)
|
717
721
|
find_output = Executable.execute_command('find', [validation_dir, '-name', '*.html'], false)
|
718
722
|
if find_output != ''
|
719
723
|
message = 'Static Analysis failed.'
|
@@ -722,7 +726,7 @@ module Pod
|
|
722
726
|
error('build_pod', message)
|
723
727
|
end
|
724
728
|
else
|
725
|
-
output = xcodebuild('build', scheme,
|
729
|
+
output = xcodebuild('build', scheme, requested_configuration, :deployment_target => deployment_target)
|
726
730
|
end
|
727
731
|
parsed_output = parse_xcodebuild_output(output)
|
728
732
|
translate_output_to_linter_messages(parsed_output)
|
@@ -774,7 +778,7 @@ module Pod
|
|
774
778
|
|
775
779
|
FILE_PATTERNS = %i(source_files resources preserve_paths vendored_libraries
|
776
780
|
vendored_frameworks public_header_files preserve_paths
|
777
|
-
private_header_files resource_bundles).freeze
|
781
|
+
project_header_files private_header_files resource_bundles).freeze
|
778
782
|
|
779
783
|
# It checks that every file pattern specified in a spec yields
|
780
784
|
# at least one file. It requires the pods to be already present
|
@@ -810,6 +814,22 @@ module Pod
|
|
810
814
|
add_result(message_type, 'file patterns', "The `#{attr_name}` pattern did not match any file.")
|
811
815
|
end
|
812
816
|
|
817
|
+
def _validate_vendored_libraries
|
818
|
+
file_accessor.vendored_libraries.each do |lib|
|
819
|
+
basename = File.basename(lib)
|
820
|
+
lib_name = basename.downcase
|
821
|
+
unless lib_name.end_with?('.a') && lib_name.start_with?('lib')
|
822
|
+
warning('vendored_libraries', "`#{basename}` does not match the expected static library name format `lib[name].a`")
|
823
|
+
end
|
824
|
+
end
|
825
|
+
validate_nonempty_patterns(:vendored_libraries, :warning)
|
826
|
+
end
|
827
|
+
|
828
|
+
def _validate_project_header_files
|
829
|
+
_validate_header_files(:project_header_files)
|
830
|
+
validate_nonempty_patterns(:project_header_files, :warning)
|
831
|
+
end
|
832
|
+
|
813
833
|
def _validate_private_header_files
|
814
834
|
_validate_header_files(:private_header_files)
|
815
835
|
validate_nonempty_patterns(:private_header_files, :warning)
|