cocoapods 1.8.4 → 1.9.0.beta.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 +69 -1
- data/lib/cocoapods.rb +1 -0
- data/lib/cocoapods/command/setup.rb +1 -0
- data/lib/cocoapods/executable.rb +1 -1
- data/lib/cocoapods/gem_version.rb +1 -1
- data/lib/cocoapods/generator/embed_frameworks_script.rb +36 -6
- data/lib/cocoapods/generator/prepare_artifacts_script.rb +244 -0
- data/lib/cocoapods/installer.rb +6 -5
- data/lib/cocoapods/installer/analyzer.rb +137 -59
- data/lib/cocoapods/installer/analyzer/pod_variant.rb +27 -12
- data/lib/cocoapods/installer/analyzer/pod_variant_set.rb +11 -2
- data/lib/cocoapods/installer/project_cache/project_cache_analyzer.rb +10 -2
- data/lib/cocoapods/installer/project_cache/project_installation_cache.rb +15 -2
- data/lib/cocoapods/installer/project_cache/target_cache_key.rb +7 -5
- data/lib/cocoapods/installer/user_project_integrator.rb +1 -10
- data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +100 -19
- data/lib/cocoapods/installer/xcode/pods_project_generator.rb +3 -0
- data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb +29 -4
- data/lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb +7 -2
- data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +106 -45
- data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +68 -1
- data/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb +29 -14
- data/lib/cocoapods/sandbox/file_accessor.rb +32 -21
- data/lib/cocoapods/sources_manager.rb +9 -2
- data/lib/cocoapods/target.rb +11 -14
- data/lib/cocoapods/target/aggregate_target.rb +78 -18
- data/lib/cocoapods/target/build_settings.rb +64 -31
- data/lib/cocoapods/target/pod_target.rb +236 -87
- data/lib/cocoapods/user_interface/error_report.rb +14 -4
- data/lib/cocoapods/validator.rb +2 -0
- data/lib/cocoapods/xcode.rb +7 -0
- data/lib/cocoapods/{target → xcode}/framework_paths.rb +14 -1
- data/lib/cocoapods/xcode/linkage_analyzer.rb +22 -0
- data/lib/cocoapods/xcode/xcframework.rb +81 -0
- data/lib/cocoapods/xcode/xcframework/xcframework_slice.rb +51 -0
- metadata +12 -8
- data/lib/cocoapods/target/build_type.rb +0 -139
@@ -119,7 +119,7 @@ module Pod
|
|
119
119
|
|
120
120
|
retval = retval.dup if dup_before_freeze && retval.frozen?
|
121
121
|
|
122
|
-
retval.concat(pod_targets_to_link.flat_map { |pod_target| pod_target.
|
122
|
+
retval.concat(pod_targets_to_link.flat_map { |pod_target| pod_target.build_settings_for_spec(pod_target.root_spec, :configuration => configuration_name).public_send("#{method_name}_to_import") }) if from_pod_targets_to_link
|
123
123
|
retval.concat(search_paths_aggregate_target_pod_target_build_settings.flat_map(&from_search_paths_aggregate_targets)) if from_search_paths_aggregate_targets
|
124
124
|
|
125
125
|
retval.compact! if compacted
|
@@ -515,7 +515,10 @@ module Pod
|
|
515
515
|
# @param [Specification] non_library_spec
|
516
516
|
# see {#non_library_spec}
|
517
517
|
#
|
518
|
-
|
518
|
+
# @param [Symbol] configuration
|
519
|
+
# see {#configuration}
|
520
|
+
#
|
521
|
+
def initialize(target, non_library_spec = nil, configuration: nil)
|
519
522
|
super(target)
|
520
523
|
if @non_library_spec = non_library_spec
|
521
524
|
@test_xcconfig = non_library_spec.test_specification?
|
@@ -527,6 +530,7 @@ module Pod
|
|
527
530
|
@xcconfig_spec_type = :library
|
528
531
|
@library_xcconfig = true
|
529
532
|
end
|
533
|
+
(@configuration = configuration) || raise("No configuration for #{self}.")
|
530
534
|
end
|
531
535
|
|
532
536
|
# @return [Xcodeproj::Xconfig]
|
@@ -567,11 +571,14 @@ module Pod
|
|
567
571
|
if library_xcconfig?
|
568
572
|
# We know that this library target is being built dynamically based
|
569
573
|
# on the guard above, so include any vendored static frameworks.
|
570
|
-
|
574
|
+
if target.should_build?
|
575
|
+
frameworks.concat vendored_static_frameworks.map { |l| File.basename(l, '.framework') }
|
576
|
+
frameworks.concat vendored_xcframeworks.map(&:name)
|
577
|
+
end
|
571
578
|
# Also include any vendored dynamic frameworks of dependencies.
|
572
|
-
frameworks.concat dependent_targets.reject(&:should_build?).flat_map { |pt| pt.build_settings.dynamic_frameworks_to_import }
|
579
|
+
frameworks.concat dependent_targets.reject(&:should_build?).flat_map { |pt| pt.build_settings[@configuration].dynamic_frameworks_to_import }
|
573
580
|
else
|
574
|
-
frameworks.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings.frameworks_to_import }
|
581
|
+
frameworks.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings[@configuration].frameworks_to_import }
|
575
582
|
end
|
576
583
|
|
577
584
|
frameworks
|
@@ -581,6 +588,12 @@ module Pod
|
|
581
588
|
define_build_settings_method :static_frameworks_to_import, :memoized => true do
|
582
589
|
static_frameworks_to_import = []
|
583
590
|
static_frameworks_to_import.concat vendored_static_frameworks.map { |f| File.basename(f, '.framework') } unless target.should_build? && target.build_as_dynamic?
|
591
|
+
unless target.should_build? && target.build_as_dynamic?
|
592
|
+
static_frameworks_to_import.concat vendored_xcframeworks.
|
593
|
+
select(&:includes_static_slices?).
|
594
|
+
map(&:name).
|
595
|
+
uniq
|
596
|
+
end
|
584
597
|
static_frameworks_to_import << target.product_basename if target.should_build? && target.build_as_static_framework?
|
585
598
|
static_frameworks_to_import
|
586
599
|
end
|
@@ -588,6 +601,10 @@ module Pod
|
|
588
601
|
# @return [Array<String>]
|
589
602
|
define_build_settings_method :dynamic_frameworks_to_import, :memoized => true do
|
590
603
|
dynamic_frameworks_to_import = vendored_dynamic_frameworks.map { |f| File.basename(f, '.framework') }
|
604
|
+
dynamic_frameworks_to_import.concat vendored_xcframeworks.
|
605
|
+
select(&:includes_dynamic_slices?).
|
606
|
+
map(&:name).
|
607
|
+
uniq
|
591
608
|
dynamic_frameworks_to_import << target.product_basename if target.should_build? && target.build_as_dynamic_framework?
|
592
609
|
dynamic_frameworks_to_import.concat consumer_frameworks
|
593
610
|
dynamic_frameworks_to_import
|
@@ -598,7 +615,7 @@ module Pod
|
|
598
615
|
return [] if target.build_as_static? && library_xcconfig?
|
599
616
|
|
600
617
|
weak_frameworks = spec_consumers.flat_map(&:weak_frameworks)
|
601
|
-
weak_frameworks.concat dependent_targets.flat_map { |pt| pt.build_settings.weak_frameworks_to_import }
|
618
|
+
weak_frameworks.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].weak_frameworks_to_import }
|
602
619
|
weak_frameworks
|
603
620
|
end
|
604
621
|
|
@@ -615,7 +632,7 @@ module Pod
|
|
615
632
|
# @return [Array<String>]
|
616
633
|
define_build_settings_method :framework_search_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do
|
617
634
|
paths = super().dup
|
618
|
-
paths.concat dependent_targets.flat_map { |
|
635
|
+
paths.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].framework_search_paths_to_import }
|
619
636
|
paths.concat framework_search_paths_to_import
|
620
637
|
paths.delete(target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)) if library_xcconfig?
|
621
638
|
paths
|
@@ -629,7 +646,17 @@ module Pod
|
|
629
646
|
|
630
647
|
# @return [Array<String>]
|
631
648
|
define_build_settings_method :vendored_framework_search_paths, :memoized => true do
|
632
|
-
|
649
|
+
search_paths = []
|
650
|
+
search_paths.concat file_accessors.
|
651
|
+
flat_map(&:vendored_frameworks).
|
652
|
+
map { |f| File.join '${PODS_ROOT}', f.dirname.relative_path_from(target.sandbox.root) }
|
653
|
+
# Include each slice in the framework search paths.
|
654
|
+
# Xcode will not search inside an .xcframework for headers within each slice
|
655
|
+
search_paths.concat vendored_xcframeworks.
|
656
|
+
flat_map(&:slices).
|
657
|
+
select { |slice| slice.platform.symbolic_name == target.platform.symbolic_name }.
|
658
|
+
flat_map { |slice| File.join '${PODS_ROOT}', slice.path.dirname.relative_path_from(target.sandbox.root) }
|
659
|
+
search_paths
|
633
660
|
end
|
634
661
|
|
635
662
|
# @return [Array<String>]
|
@@ -651,6 +678,11 @@ module Pod
|
|
651
678
|
file_accessors.flat_map(&:vendored_dynamic_frameworks)
|
652
679
|
end
|
653
680
|
|
681
|
+
# @return [Array<Xcode::XCFramework>]
|
682
|
+
define_build_settings_method :vendored_xcframeworks, :memoized => true do
|
683
|
+
file_accessors.flat_map(&:vendored_xcframeworks).map { |path| Xcode::XCFramework.new(path) }
|
684
|
+
end
|
685
|
+
|
654
686
|
#-------------------------------------------------------------------------#
|
655
687
|
|
656
688
|
# @!group Libraries
|
@@ -676,8 +708,8 @@ module Pod
|
|
676
708
|
libraries.concat libraries_to_import
|
677
709
|
end
|
678
710
|
if non_library_xcconfig?
|
679
|
-
libraries.concat dependent_targets.flat_map { |pt| pt.build_settings.dynamic_libraries_to_import }
|
680
|
-
libraries.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings.static_libraries_to_import }
|
711
|
+
libraries.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].dynamic_libraries_to_import }
|
712
|
+
libraries.concat dependent_targets_to_link.flat_map { |pt| pt.build_settings[@configuration].static_libraries_to_import }
|
681
713
|
end
|
682
714
|
libraries
|
683
715
|
end
|
@@ -708,11 +740,11 @@ module Pod
|
|
708
740
|
return [] if library_xcconfig? && target.build_as_static?
|
709
741
|
|
710
742
|
vendored = library_search_paths_to_import.dup
|
711
|
-
vendored.concat dependent_targets.flat_map { |
|
743
|
+
vendored.concat dependent_targets.flat_map { |pt| pt.build_settings[@configuration].vendored_dynamic_library_search_paths }
|
712
744
|
if library_xcconfig?
|
713
745
|
vendored.delete(target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE))
|
714
746
|
else
|
715
|
-
vendored.concat(dependent_targets.flat_map { |
|
747
|
+
vendored.concat(dependent_targets.flat_map { |pt| pt.build_settings[@configuration].library_search_paths_to_import })
|
716
748
|
end
|
717
749
|
vendored
|
718
750
|
end
|
@@ -751,7 +783,7 @@ module Pod
|
|
751
783
|
|
752
784
|
# @return [Array<String>]
|
753
785
|
define_build_settings_method :module_map_files, :memoized => true do
|
754
|
-
dependent_targets.map { |
|
786
|
+
dependent_targets.map { |pt| pt.build_settings[@configuration].module_map_file_to_import }.compact.sort
|
755
787
|
end
|
756
788
|
|
757
789
|
# @return [Array<String>]
|
@@ -770,12 +802,12 @@ module Pod
|
|
770
802
|
|
771
803
|
# @return [Array<String>]
|
772
804
|
define_build_settings_method :header_search_paths, :build_setting => true, :memoized => true, :sorted => true do
|
773
|
-
target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig? && non_library_spec, :include_dependent_targets_for_app_spec => app_xcconfig? && non_library_spec)
|
805
|
+
target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig? && non_library_spec, :include_dependent_targets_for_app_spec => app_xcconfig? && non_library_spec, :configuration => @configuration)
|
774
806
|
end
|
775
807
|
|
776
808
|
# @return [Array<String>]
|
777
809
|
define_build_settings_method :public_header_search_paths, :memoized => true, :sorted => true do
|
778
|
-
target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig? && non_library_spec, :include_dependent_targets_for_app_spec => app_xcconfig? && non_library_spec, :include_private_headers => false)
|
810
|
+
target.header_search_paths(:include_dependent_targets_for_test_spec => test_xcconfig? && non_library_spec, :include_dependent_targets_for_app_spec => app_xcconfig? && non_library_spec, :include_private_headers => false, :configuration => @configuration)
|
779
811
|
end
|
780
812
|
|
781
813
|
#-------------------------------------------------------------------------#
|
@@ -803,7 +835,7 @@ module Pod
|
|
803
835
|
|
804
836
|
# @return [Array<String>]
|
805
837
|
define_build_settings_method :swift_include_paths, :build_setting => true, :memoized => true, :sorted => true, :uniqued => true do
|
806
|
-
paths = dependent_targets.flat_map { |
|
838
|
+
paths = dependent_targets.flat_map { |pt| pt.build_settings[@configuration].swift_include_paths_to_import }
|
807
839
|
paths.concat swift_include_paths_to_import if non_library_xcconfig?
|
808
840
|
paths
|
809
841
|
end
|
@@ -873,11 +905,11 @@ module Pod
|
|
873
905
|
define_build_settings_method :dependent_targets, :memoized => true do
|
874
906
|
select_maximal_pod_targets(
|
875
907
|
if test_xcconfig?
|
876
|
-
target.dependent_targets_for_test_spec(non_library_spec)
|
908
|
+
target.dependent_targets_for_test_spec(non_library_spec, :configuration => @configuration)
|
877
909
|
elsif app_xcconfig?
|
878
|
-
target.dependent_targets_for_app_spec(non_library_spec)
|
910
|
+
target.dependent_targets_for_app_spec(non_library_spec, :configuration => @configuration)
|
879
911
|
else
|
880
|
-
target.recursive_dependent_targets
|
912
|
+
target.recursive_dependent_targets(:configuration => @configuration)
|
881
913
|
end,
|
882
914
|
)
|
883
915
|
end
|
@@ -886,7 +918,7 @@ module Pod
|
|
886
918
|
define_build_settings_method :dependent_targets_to_link, :memoized => true do
|
887
919
|
if test_xcconfig?
|
888
920
|
# we're embedding into an app defined by an app spec
|
889
|
-
host_targets = target.app_host_dependent_targets_for_spec(non_library_spec)
|
921
|
+
host_targets = target.app_host_dependent_targets_for_spec(non_library_spec, :configuration => @configuration)
|
890
922
|
dependent_targets - host_targets
|
891
923
|
else
|
892
924
|
dependent_targets
|
@@ -913,7 +945,7 @@ module Pod
|
|
913
945
|
#
|
914
946
|
define_build_settings_method :merged_pod_target_xcconfigs, :memoized => true do
|
915
947
|
merged_xcconfigs(pod_target_xcconfig_values_by_consumer_by_key, :pod_target_xcconfig,
|
916
|
-
:overriding => non_library_xcconfig? ? target.build_settings.merged_pod_target_xcconfigs : {})
|
948
|
+
:overriding => non_library_xcconfig? ? target.build_settings[@configuration].merged_pod_target_xcconfigs : {})
|
917
949
|
end
|
918
950
|
|
919
951
|
# @return [Array<Sandbox::FileAccessor>]
|
@@ -948,21 +980,22 @@ module Pod
|
|
948
980
|
@build_settings_names | BuildSettings.build_settings_names
|
949
981
|
end
|
950
982
|
|
951
|
-
# @return [
|
983
|
+
# @return [Symbol]
|
952
984
|
# The build configuration these settings will be used for
|
953
985
|
attr_reader :configuration_name
|
954
986
|
|
955
|
-
#
|
987
|
+
# Initializes a new instance
|
956
988
|
#
|
957
989
|
# @param [AggregateTarget] target
|
958
990
|
# see {#target}
|
959
991
|
#
|
960
|
-
# @param [
|
992
|
+
# @param [Symbol] configuration_name
|
961
993
|
# see {#configuration_name}
|
962
994
|
#
|
963
|
-
def initialize(target, configuration_name)
|
995
|
+
def initialize(target, configuration_name, configuration: nil)
|
964
996
|
super(target)
|
965
997
|
@configuration_name = configuration_name
|
998
|
+
(@configuration = configuration) || raise("No configuration for #{self}.")
|
966
999
|
end
|
967
1000
|
|
968
1001
|
# @return [Xcodeproj::Config] xcconfig
|
@@ -1034,7 +1067,7 @@ module Pod
|
|
1034
1067
|
# brackets, @import, etc.)
|
1035
1068
|
paths.concat pod_targets.
|
1036
1069
|
select { |pt| pt.build_as_framework? && pt.should_build? }.
|
1037
|
-
map { |pt| pt.build_settings.framework_header_search_path }
|
1070
|
+
map { |pt| pt.build_settings[@configuration].framework_header_search_path }
|
1038
1071
|
|
1039
1072
|
paths.concat target.search_paths_aggregate_targets.flat_map { |at| at.build_settings(configuration_name).header_search_paths }
|
1040
1073
|
|
@@ -1051,11 +1084,11 @@ module Pod
|
|
1051
1084
|
silenced_frameworks = []
|
1052
1085
|
pod_targets_inhibiting_warnings.each do |pt|
|
1053
1086
|
if pt.build_as_framework? && pt.should_build?
|
1054
|
-
silenced_headers.append pt.build_settings.framework_header_search_path
|
1087
|
+
silenced_headers.append pt.build_settings[@configuration].framework_header_search_path
|
1055
1088
|
else
|
1056
|
-
silenced_headers.concat pt.build_settings.public_header_search_paths
|
1089
|
+
silenced_headers.concat pt.build_settings[@configuration].public_header_search_paths
|
1057
1090
|
end
|
1058
|
-
silenced_frameworks.concat pt.build_settings.framework_search_paths_to_import
|
1091
|
+
silenced_frameworks.concat pt.build_settings[@configuration].framework_search_paths_to_import
|
1059
1092
|
end
|
1060
1093
|
|
1061
1094
|
flags += silenced_headers.uniq.flat_map { |p| ['-isystem', p] }
|
@@ -1066,7 +1099,7 @@ module Pod
|
|
1066
1099
|
|
1067
1100
|
# @return [Array<String>]
|
1068
1101
|
define_build_settings_method :module_map_files, :memoized => true, :sorted => true, :uniqued => true, :compacted => true, :from_search_paths_aggregate_targets => :module_map_file_to_import do
|
1069
|
-
pod_targets.map { |
|
1102
|
+
pod_targets.map { |pt| pt.build_settings[@configuration].module_map_file_to_import }
|
1070
1103
|
end
|
1071
1104
|
|
1072
1105
|
#-------------------------------------------------------------------------#
|
@@ -1180,7 +1213,7 @@ module Pod
|
|
1180
1213
|
define_build_settings_method :search_paths_aggregate_target_pod_target_build_settings, :memoized => true, :uniqued => true do
|
1181
1214
|
pod_targets = target.search_paths_aggregate_targets.flat_map { |at| at.build_settings(configuration_name).pod_targets }
|
1182
1215
|
pod_targets = select_maximal_pod_targets(pod_targets)
|
1183
|
-
pod_targets.
|
1216
|
+
pod_targets.map { |pt| pt.build_settings[@configuration] }
|
1184
1217
|
end
|
1185
1218
|
|
1186
1219
|
# Returns the +user_target_xcconfig+ for all pod targets and their spec
|
@@ -1,4 +1,5 @@
|
|
1
|
-
require 'cocoapods/
|
1
|
+
require 'cocoapods/xcode/framework_paths'
|
2
|
+
require 'cocoapods/xcode/xcframework'
|
2
3
|
|
3
4
|
module Pod
|
4
5
|
# Stores the information relative to the target used to compile a single Pod.
|
@@ -48,15 +49,59 @@ module Pod
|
|
48
49
|
# @return [Array<PodTarget>] the targets that this target has a dependency
|
49
50
|
# upon.
|
50
51
|
#
|
51
|
-
|
52
|
+
attr_reader :dependent_targets
|
53
|
+
attr_reader :dependent_targets_by_config
|
54
|
+
|
55
|
+
# @deprecated
|
56
|
+
def dependent_targets=(dependent_targets)
|
57
|
+
@dependent_targets = dependent_targets
|
58
|
+
@dependent_targets_by_config = { :debug => dependent_targets, :release => dependent_targets }
|
59
|
+
end
|
60
|
+
|
61
|
+
def dependent_targets_by_config=(dependent_targets_by_config)
|
62
|
+
@dependent_targets_by_config = dependent_targets_by_config
|
63
|
+
@dependent_targets = dependent_targets_by_config.each_value.reduce([], &:|)
|
64
|
+
end
|
52
65
|
|
53
66
|
# @return [Hash{String=>Array<PodTarget>}] all target dependencies by test spec name.
|
54
67
|
#
|
55
|
-
|
68
|
+
attr_reader :test_dependent_targets_by_spec_name
|
69
|
+
attr_reader :test_dependent_targets_by_spec_name_by_config
|
70
|
+
|
71
|
+
# @deprecated
|
72
|
+
def test_dependent_targets_by_spec_name=(test_dependent_targets_by_spec_name)
|
73
|
+
@test_dependent_targets_by_spec_name = test_dependent_targets_by_spec_name
|
74
|
+
@test_dependent_targets_by_spec_name_by_config = Hash[test_dependent_targets_by_spec_name.map do |k, v|
|
75
|
+
[k, { :debug => v, :release => v }]
|
76
|
+
end]
|
77
|
+
end
|
78
|
+
|
79
|
+
def test_dependent_targets_by_spec_name_by_config=(test_dependent_targets_by_spec_name_by_config)
|
80
|
+
@test_dependent_targets_by_spec_name_by_config = test_dependent_targets_by_spec_name_by_config
|
81
|
+
@test_dependent_targets_by_spec_name = Hash[test_dependent_targets_by_spec_name_by_config.map do |k, v|
|
82
|
+
[k, v.each_value.reduce(Set.new, &:|).to_a]
|
83
|
+
end]
|
84
|
+
end
|
56
85
|
|
57
86
|
# @return [Hash{String=>Array<PodTarget>}] all target dependencies by app spec name.
|
58
87
|
#
|
59
|
-
|
88
|
+
attr_reader :app_dependent_targets_by_spec_name
|
89
|
+
attr_reader :app_dependent_targets_by_spec_name_by_config
|
90
|
+
|
91
|
+
# @deprecated
|
92
|
+
def app_dependent_targets_by_spec_name=(app_dependent_targets_by_spec_name)
|
93
|
+
@app_dependent_targets_by_spec_name = app_dependent_targets_by_spec_name
|
94
|
+
@app_dependent_targets_by_spec_name_by_config = Hash[app_dependent_targets_by_spec_name.map do |k, v|
|
95
|
+
[k, { :debug => v, :release => v }]
|
96
|
+
end]
|
97
|
+
end
|
98
|
+
|
99
|
+
def app_dependent_targets_by_spec_name_by_config=(app_dependent_targets_by_spec_name_by_config)
|
100
|
+
@app_dependent_targets_by_spec_name_by_config = app_dependent_targets_by_spec_name_by_config
|
101
|
+
@app_dependent_targets_by_spec_name = Hash[app_dependent_targets_by_spec_name_by_config.map do |k, v|
|
102
|
+
[k, v.each_value.reduce(Set.new, &:|).to_a]
|
103
|
+
end]
|
104
|
+
end
|
60
105
|
|
61
106
|
# @return [Hash{String => (Specification,PodTarget)}] tuples of app specs and pod targets by test spec name.
|
62
107
|
#
|
@@ -65,15 +110,21 @@ module Pod
|
|
65
110
|
# @return [Hash{String => BuildSettings}] the test spec build settings for this target.
|
66
111
|
#
|
67
112
|
attr_reader :test_spec_build_settings
|
113
|
+
attr_reader :test_spec_build_settings_by_config
|
68
114
|
|
69
115
|
# @return [Hash{String => BuildSettings}] the app spec build settings for this target.
|
70
116
|
#
|
71
117
|
attr_reader :app_spec_build_settings
|
118
|
+
attr_reader :app_spec_build_settings_by_config
|
119
|
+
|
120
|
+
# @return [String] the Swift version for this target.
|
121
|
+
#
|
122
|
+
attr_reader :swift_version
|
72
123
|
|
73
124
|
# Initialize a new instance
|
74
125
|
#
|
75
126
|
# @param [Sandbox] sandbox @see Target#sandbox
|
76
|
-
# @param [
|
127
|
+
# @param [BuildType] build_type @see Target#build_type
|
77
128
|
# @param [Hash{String=>Symbol}] user_build_configurations @see Target#user_build_configurations
|
78
129
|
# @param [Array<String>] archs @see Target#archs
|
79
130
|
# @param [Platform] platform @see Target#platform
|
@@ -81,12 +132,11 @@ module Pod
|
|
81
132
|
# @param [Array<TargetDefinition>] target_definitions @see #target_definitions
|
82
133
|
# @param [Array<Sandbox::FileAccessor>] file_accessors @see #file_accessors
|
83
134
|
# @param [String] scope_suffix @see #scope_suffix
|
84
|
-
# @param [
|
135
|
+
# @param [String] swift_version @see #swift_version
|
85
136
|
#
|
86
|
-
def initialize(sandbox,
|
87
|
-
|
88
|
-
|
89
|
-
super(sandbox, host_requires_frameworks, user_build_configurations, archs, platform, :build_type => build_type)
|
137
|
+
def initialize(sandbox, build_type, user_build_configurations, archs, platform, specs, target_definitions,
|
138
|
+
file_accessors = [], scope_suffix = nil, swift_version = nil)
|
139
|
+
super(sandbox, build_type, user_build_configurations, archs, platform)
|
90
140
|
raise "Can't initialize a PodTarget without specs!" if specs.nil? || specs.empty?
|
91
141
|
raise "Can't initialize a PodTarget without TargetDefinition!" if target_definitions.nil? || target_definitions.empty?
|
92
142
|
raise "Can't initialize a PodTarget with an empty string scope suffix!" if scope_suffix == ''
|
@@ -94,18 +144,19 @@ module Pod
|
|
94
144
|
@target_definitions = target_definitions
|
95
145
|
@file_accessors = file_accessors
|
96
146
|
@scope_suffix = scope_suffix
|
147
|
+
@swift_version = swift_version
|
97
148
|
all_specs_by_type = @specs.group_by(&:spec_type)
|
98
149
|
@library_specs = all_specs_by_type[:library] || []
|
99
150
|
@test_specs = all_specs_by_type[:test] || []
|
100
151
|
@app_specs = all_specs_by_type[:app] || []
|
101
152
|
@build_headers = Sandbox::HeadersStore.new(sandbox, 'Private', :private)
|
102
|
-
|
103
|
-
|
104
|
-
|
153
|
+
self.dependent_targets = []
|
154
|
+
self.test_dependent_targets_by_spec_name = Hash[test_specs.map { |ts| [ts.name, []] }]
|
155
|
+
self.app_dependent_targets_by_spec_name = Hash[app_specs.map { |as| [as.name, []] }]
|
105
156
|
@test_app_hosts_by_spec_name = {}
|
106
157
|
@build_config_cache = {}
|
107
|
-
@
|
108
|
-
@
|
158
|
+
@test_spec_build_settings_by_config = create_test_build_settings_by_config
|
159
|
+
@app_spec_build_settings_by_config = create_app_build_settings_by_config
|
109
160
|
end
|
110
161
|
|
111
162
|
# Scopes the current target based on the existing pod targets within the cache.
|
@@ -119,21 +170,20 @@ module Pod
|
|
119
170
|
target_definitions.map do |target_definition|
|
120
171
|
cache_key = [specs, target_definition]
|
121
172
|
cache[cache_key] ||= begin
|
122
|
-
target = PodTarget.new(sandbox,
|
123
|
-
|
124
|
-
:build_type => build_type)
|
173
|
+
target = PodTarget.new(sandbox, build_type, user_build_configurations, archs, platform, specs,
|
174
|
+
[target_definition], file_accessors, target_definition.label)
|
125
175
|
scope_dependent_targets = ->(dependent_targets) do
|
126
176
|
dependent_targets.flat_map do |pod_target|
|
127
177
|
pod_target.scoped(cache).select { |pt| pt.target_definitions == [target_definition] }
|
128
178
|
end
|
129
179
|
end
|
130
180
|
|
131
|
-
target.
|
132
|
-
target.
|
133
|
-
[spec_name, scope_dependent_targets[
|
181
|
+
target.dependent_targets_by_config = Hash[dependent_targets_by_config.map { |k, v| [k, scope_dependent_targets[v]] }]
|
182
|
+
target.test_dependent_targets_by_spec_name_by_config = Hash[test_dependent_targets_by_spec_name_by_config.map do |spec_name, test_pod_targets_by_config|
|
183
|
+
[spec_name, Hash[test_pod_targets_by_config.map { |k, v| [k, scope_dependent_targets[v]] }]]
|
134
184
|
end]
|
135
|
-
target.
|
136
|
-
[spec_name, scope_dependent_targets[
|
185
|
+
target.app_dependent_targets_by_spec_name_by_config = Hash[app_dependent_targets_by_spec_name_by_config.map do |spec_name, app_pod_targets_by_config|
|
186
|
+
[spec_name, Hash[app_pod_targets_by_config.map { |k, v| [k, scope_dependent_targets[v]] }]]
|
137
187
|
end]
|
138
188
|
target.test_app_hosts_by_spec_name = Hash[test_app_hosts_by_spec_name.map do |spec_name, (app_host_spec, app_pod_target)|
|
139
189
|
[spec_name, [app_host_spec, app_pod_target.scoped(cache).find { |pt| pt.target_definitions == [target_definition] }]]
|
@@ -187,32 +237,6 @@ module Pod
|
|
187
237
|
end]
|
188
238
|
end
|
189
239
|
|
190
|
-
# @return [String] the Swift version for the target. If the pod author has provided a set of Swift versions
|
191
|
-
# supported by their pod then the max Swift version across all of target definitions is chosen, unless
|
192
|
-
# a target definition specifies explicit requirements for supported Swift versions. Otherwise the Swift
|
193
|
-
# version is derived by the target definitions that integrate this pod as long as they are the same.
|
194
|
-
#
|
195
|
-
def swift_version
|
196
|
-
@swift_version ||= begin
|
197
|
-
if spec_swift_versions.empty?
|
198
|
-
target_definition_swift_version
|
199
|
-
else
|
200
|
-
spec_swift_versions.sort.reverse_each.find do |swift_version|
|
201
|
-
target_definitions.all? do |td|
|
202
|
-
td.supports_swift_version?(swift_version)
|
203
|
-
end
|
204
|
-
end.to_s
|
205
|
-
end
|
206
|
-
end
|
207
|
-
end
|
208
|
-
|
209
|
-
# @return [String] the Swift version derived from the target definitions that integrate this pod. This is used for
|
210
|
-
# legacy reasons and only if the pod author has not specified the Swift versions their pod supports.
|
211
|
-
#
|
212
|
-
def target_definition_swift_version
|
213
|
-
target_definitions.map(&:swift_version).compact.uniq.first
|
214
|
-
end
|
215
|
-
|
216
240
|
# @return [Array<Version>] the Swift versions supported. Might be empty if the author has not
|
217
241
|
# specified any versions, most likely due to legacy reasons.
|
218
242
|
#
|
@@ -355,7 +379,7 @@ module Pod
|
|
355
379
|
!app_specs.empty?
|
356
380
|
end
|
357
381
|
|
358
|
-
# @return [Hash{String=>Array<FrameworkPaths>}] The vendored and non vendored framework paths this target
|
382
|
+
# @return [Hash{String=>Array<Xcode::FrameworkPaths>}] The vendored and non vendored framework paths this target
|
359
383
|
# depends upon keyed by spec name. For the root spec and subspecs the framework path of the target itself
|
360
384
|
# is included.
|
361
385
|
#
|
@@ -381,10 +405,24 @@ module Pod
|
|
381
405
|
end
|
382
406
|
end
|
383
407
|
end
|
384
|
-
FrameworkPaths.new(framework_source, dsym_source, bcsymbolmap_paths)
|
408
|
+
Xcode::FrameworkPaths.new(framework_source, dsym_source, bcsymbolmap_paths)
|
385
409
|
end
|
386
410
|
if file_accessor.spec.library_specification? && should_build? && build_as_dynamic_framework?
|
387
|
-
frameworks << FrameworkPaths.new(build_product_path('${BUILT_PRODUCTS_DIR}'))
|
411
|
+
frameworks << Xcode::FrameworkPaths.new(build_product_path('${BUILT_PRODUCTS_DIR}'))
|
412
|
+
end
|
413
|
+
hash[file_accessor.spec.name] = frameworks
|
414
|
+
end
|
415
|
+
end
|
416
|
+
end
|
417
|
+
|
418
|
+
# @return [Hash{String=>Array<Xcode::XCFramework>}] The vendored xcframeworks this target
|
419
|
+
# depends upon keyed by spec name.
|
420
|
+
#
|
421
|
+
def xcframeworks
|
422
|
+
@xcframeworks ||= begin
|
423
|
+
file_accessors.each_with_object({}) do |file_accessor, hash|
|
424
|
+
frameworks = file_accessor.vendored_xcframeworks.map do |framework_path|
|
425
|
+
Xcode::XCFramework.new(framework_path)
|
388
426
|
end
|
389
427
|
hash[file_accessor.spec.name] = frameworks
|
390
428
|
end
|
@@ -556,16 +594,19 @@ module Pod
|
|
556
594
|
# @param [Specification] spec
|
557
595
|
# the spec to return app host dependencies for
|
558
596
|
#
|
597
|
+
# @param [String] configuration
|
598
|
+
# the configuration to retrieve the app host dependent targets for.
|
599
|
+
#
|
559
600
|
# @return [Array<PodTarget>] the app host dependent targets for the given spec.
|
560
601
|
#
|
561
|
-
def app_host_dependent_targets_for_spec(spec)
|
602
|
+
def app_host_dependent_targets_for_spec(spec, configuration: nil)
|
562
603
|
return [] unless spec.test_specification? && spec.consumer(platform).test_type == :unit
|
563
604
|
app_host_info = test_app_hosts_by_spec_name[spec.name]
|
564
605
|
if app_host_info.nil?
|
565
606
|
[]
|
566
607
|
else
|
567
608
|
app_spec, app_target = *app_host_info
|
568
|
-
app_target.dependent_targets_for_app_spec(app_spec)
|
609
|
+
app_target.dependent_targets_for_app_spec(app_spec, :configuration => configuration)
|
569
610
|
end
|
570
611
|
end
|
571
612
|
|
@@ -643,6 +684,33 @@ module Pod
|
|
643
684
|
support_files_dir + "#{non_library_spec_label(spec)}-frameworks-output-files.xcfilelist"
|
644
685
|
end
|
645
686
|
|
687
|
+
# @param [Specification] spec
|
688
|
+
# The spec this script path is for.
|
689
|
+
#
|
690
|
+
# @return [Pathname] The absolute path of the prepare artifacts script for the given spec.
|
691
|
+
#
|
692
|
+
def prepare_artifacts_script_path_for_spec(spec)
|
693
|
+
support_files_dir + "#{non_library_spec_label(spec)}-artifacts.sh"
|
694
|
+
end
|
695
|
+
|
696
|
+
# @param [Specification] spec
|
697
|
+
# The spec this script path is for.
|
698
|
+
#
|
699
|
+
# @return [Pathname] The absolute path of the prepare artifacts script input file list for the given spec.
|
700
|
+
#
|
701
|
+
def prepare_artifacts_script_input_files_path_for_spec(spec)
|
702
|
+
support_files_dir + "#{non_library_spec_label(spec)}-artifacts-input-files.xcfilelist"
|
703
|
+
end
|
704
|
+
|
705
|
+
# @param [Specification] spec
|
706
|
+
# The spec this script path is for.
|
707
|
+
#
|
708
|
+
# @return [Pathname] The absolute path of the prepare artifacts script output file list for the given spec.
|
709
|
+
#
|
710
|
+
def prepare_artifacts_script_output_files_path_for_spec(spec)
|
711
|
+
support_files_dir + "#{non_library_spec_label(spec)}-artifacts-output-files.xcfilelist"
|
712
|
+
end
|
713
|
+
|
646
714
|
# @param [Specification] spec
|
647
715
|
# The spec this Info.plist path is for.
|
648
716
|
#
|
@@ -670,16 +738,32 @@ module Pod
|
|
670
738
|
end.uniq
|
671
739
|
end
|
672
740
|
|
673
|
-
#
|
674
|
-
#
|
741
|
+
# Returns all dependent targets of this target. If a configuration is passed then the list can be scoped to a given
|
742
|
+
# configuration.
|
743
|
+
#
|
744
|
+
# @param [String] configuration
|
745
|
+
# The configuration to return the dependent targets for or `nil` if all configurations should be included.
|
675
746
|
#
|
676
|
-
|
677
|
-
|
747
|
+
# @return [Array<PodTarget>] the recursive targets that this target has a dependency upon.
|
748
|
+
#
|
749
|
+
def recursive_dependent_targets(configuration: nil)
|
750
|
+
@recursive_dependent_targets ||= begin
|
751
|
+
hash = Hash[config_variants.map do |config|
|
752
|
+
[config, _add_recursive_dependent_targets(Set.new, :configuration => config).delete(self).to_a.freeze]
|
753
|
+
end]
|
754
|
+
hash[nil] = hash.each_value.reduce(Set.new, &:|).to_a
|
755
|
+
hash
|
756
|
+
end
|
757
|
+
@recursive_dependent_targets.fetch(configuration) { raise ArgumentError, "No configuration #{configuration} for #{self}, known configurations are #{@recursive_dependent_targets.keys}" }
|
678
758
|
end
|
679
759
|
|
680
|
-
def _add_recursive_dependent_targets(set)
|
760
|
+
def _add_recursive_dependent_targets(set, configuration: nil)
|
761
|
+
if defined?(@recursive_dependent_targets)
|
762
|
+
return set.merge(@recursive_dependent_targets[configuration])
|
763
|
+
end
|
764
|
+
dependent_targets = configuration ? dependent_targets_by_config[configuration] : self.dependent_targets
|
681
765
|
dependent_targets.each do |target|
|
682
|
-
target._add_recursive_dependent_targets(set) if set.add?(target)
|
766
|
+
target._add_recursive_dependent_targets(set, :configuration => configuration) if set.add?(target)
|
683
767
|
end
|
684
768
|
|
685
769
|
set
|
@@ -689,20 +773,31 @@ module Pod
|
|
689
773
|
# @param [Specification] test_spec
|
690
774
|
# the test spec to scope dependencies for
|
691
775
|
#
|
776
|
+
# @param [String] configuration
|
777
|
+
# the configuration to retrieve the test dependent targets for.
|
778
|
+
#
|
692
779
|
# @return [Array<PodTarget>] the recursive targets that this target has a
|
693
780
|
# test dependency upon.
|
694
781
|
#
|
695
|
-
def recursive_test_dependent_targets(test_spec)
|
782
|
+
def recursive_test_dependent_targets(test_spec, configuration: nil)
|
696
783
|
@recursive_test_dependent_targets ||= {}
|
697
|
-
@recursive_test_dependent_targets[test_spec] ||=
|
784
|
+
@recursive_test_dependent_targets[test_spec] ||= begin
|
785
|
+
hash = Hash[config_variants.map do |config|
|
786
|
+
[config, _add_recursive_test_dependent_targets(test_spec, Set.new, :configuration => config).to_a.freeze]
|
787
|
+
end]
|
788
|
+
hash[nil] = hash.each_value.reduce(Set.new, &:|).to_a.freeze
|
789
|
+
hash
|
790
|
+
end
|
791
|
+
@recursive_test_dependent_targets[test_spec][configuration]
|
698
792
|
end
|
699
793
|
|
700
|
-
def _add_recursive_test_dependent_targets(test_spec, set)
|
794
|
+
def _add_recursive_test_dependent_targets(test_spec, set, configuration: nil)
|
701
795
|
raise ArgumentError, 'Must give a test spec' unless test_spec
|
702
|
-
|
796
|
+
dependent_targets = configuration ? test_dependent_targets_by_spec_name_by_config[test_spec.name][configuration] : test_dependent_targets_by_spec_name[test_spec.name]
|
797
|
+
raise ArgumentError, "Unable to find deps for #{test_spec} for config #{configuration.inspect} (out of #{test_dependent_targets_by_spec_name_by_config.inspect})" unless dependent_targets
|
703
798
|
|
704
799
|
dependent_targets.each do |target|
|
705
|
-
target._add_recursive_dependent_targets(set) if set.add?(target)
|
800
|
+
target._add_recursive_dependent_targets(set, :configuration => configuration) if set.add?(target)
|
706
801
|
end
|
707
802
|
|
708
803
|
set
|
@@ -712,30 +807,44 @@ module Pod
|
|
712
807
|
# @param [Specification] test_spec
|
713
808
|
# the test spec to scope dependencies for
|
714
809
|
#
|
810
|
+
# @param [String] configuration
|
811
|
+
# the configuration to retrieve the test dependent targets for.
|
812
|
+
#
|
715
813
|
# @return [Array<PodTarget>] the canonical list of dependent targets this target has a dependency upon.
|
716
814
|
# This list includes the target itself as well as its recursive dependent and test dependent targets.
|
717
815
|
#
|
718
|
-
def dependent_targets_for_test_spec(test_spec)
|
719
|
-
[self, *recursive_dependent_targets, *recursive_test_dependent_targets(test_spec)].uniq
|
816
|
+
def dependent_targets_for_test_spec(test_spec, configuration: nil)
|
817
|
+
[self, *recursive_dependent_targets(:configuration => configuration), *recursive_test_dependent_targets(test_spec, :configuration => configuration)].uniq
|
720
818
|
end
|
721
819
|
|
722
820
|
# @param [Specification] app_spec
|
723
821
|
# the app spec to scope dependencies for
|
724
822
|
#
|
823
|
+
# @param [String] configuration
|
824
|
+
# the configuration to retrieve the app dependent targets for.
|
825
|
+
#
|
725
826
|
# @return [Array<PodTarget>] the recursive targets that this target has a
|
726
827
|
# app dependency upon.
|
727
828
|
#
|
728
|
-
def recursive_app_dependent_targets(app_spec)
|
829
|
+
def recursive_app_dependent_targets(app_spec, configuration: nil)
|
729
830
|
@recursive_app_dependent_targets ||= {}
|
730
|
-
@recursive_app_dependent_targets[app_spec] ||=
|
831
|
+
@recursive_app_dependent_targets[app_spec] ||= begin
|
832
|
+
hash = Hash[config_variants.map do |config|
|
833
|
+
[config, _add_recursive_app_dependent_targets(app_spec, Set.new, :configuration => config).to_a.freeze]
|
834
|
+
end]
|
835
|
+
hash[nil] = hash.each_value.reduce(Set.new, &:|).to_a.freeze
|
836
|
+
hash
|
837
|
+
end
|
838
|
+
@recursive_app_dependent_targets[app_spec][configuration]
|
731
839
|
end
|
732
840
|
|
733
|
-
def _add_recursive_app_dependent_targets(app_spec, set)
|
841
|
+
def _add_recursive_app_dependent_targets(app_spec, set, configuration: nil)
|
734
842
|
raise ArgumentError, 'Must give a app spec' unless app_spec
|
735
|
-
|
843
|
+
dependent_targets = configuration ? app_dependent_targets_by_spec_name_by_config[app_spec.name][configuration] : app_dependent_targets_by_spec_name[app_spec.name]
|
844
|
+
raise ArgumentError, "Unable to find deps for #{app_spec} for config #{configuration.inspect} #{app_dependent_targets_by_spec_name_by_config.inspect}" unless dependent_targets
|
736
845
|
|
737
846
|
dependent_targets.each do |target|
|
738
|
-
target._add_recursive_dependent_targets(set) if set.add?(target)
|
847
|
+
target._add_recursive_dependent_targets(set, :configuration => configuration) if set.add?(target)
|
739
848
|
end
|
740
849
|
|
741
850
|
set
|
@@ -745,11 +854,14 @@ module Pod
|
|
745
854
|
# @param [Specification] app_spec
|
746
855
|
# the app spec to scope dependencies for
|
747
856
|
#
|
857
|
+
# @param [String] configuration
|
858
|
+
# the configuration to retrieve the app dependent targets for.
|
859
|
+
#
|
748
860
|
# @return [Array<PodTarget>] the canonical list of dependent targets this target has a dependency upon.
|
749
861
|
# This list includes the target itself as well as its recursive dependent and app dependent targets.
|
750
862
|
#
|
751
|
-
def dependent_targets_for_app_spec(app_spec)
|
752
|
-
[self, *recursive_dependent_targets, *recursive_app_dependent_targets(app_spec)].uniq
|
863
|
+
def dependent_targets_for_app_spec(app_spec, configuration: nil)
|
864
|
+
[self, *recursive_dependent_targets(:configuration => configuration), *recursive_app_dependent_targets(app_spec, :configuration => configuration)].uniq
|
753
865
|
end
|
754
866
|
|
755
867
|
# Checks if warnings should be inhibited for this pod.
|
@@ -821,33 +933,56 @@ module Pod
|
|
821
933
|
# whether to include header search paths for private headers of this
|
822
934
|
# target
|
823
935
|
#
|
936
|
+
# @param [String] configuration
|
937
|
+
# the configuration to return header search paths for or `nil` for all configurations.
|
938
|
+
#
|
824
939
|
# @return [Array<String>] The set of header search paths this target uses.
|
825
940
|
#
|
826
|
-
def header_search_paths(include_dependent_targets_for_test_spec: nil, include_dependent_targets_for_app_spec: nil,
|
941
|
+
def header_search_paths(include_dependent_targets_for_test_spec: nil, include_dependent_targets_for_app_spec: nil,
|
942
|
+
include_private_headers: true, configuration: nil)
|
827
943
|
header_search_paths = []
|
828
944
|
header_search_paths.concat(build_headers.search_paths(platform, nil, false)) if include_private_headers
|
829
945
|
header_search_paths.concat(sandbox.public_headers.search_paths(platform, pod_name, uses_modular_headers?))
|
830
|
-
dependent_targets = recursive_dependent_targets
|
831
|
-
|
832
|
-
|
946
|
+
dependent_targets = recursive_dependent_targets(:configuration => configuration)
|
947
|
+
if include_dependent_targets_for_test_spec
|
948
|
+
dependent_targets += recursive_test_dependent_targets(include_dependent_targets_for_test_spec, :configuration => configuration)
|
949
|
+
end
|
950
|
+
if include_dependent_targets_for_app_spec
|
951
|
+
dependent_targets += recursive_app_dependent_targets(include_dependent_targets_for_app_spec, :configuration => configuration)
|
952
|
+
end
|
833
953
|
dependent_targets.uniq.each do |dependent_target|
|
834
954
|
header_search_paths.concat(sandbox.public_headers.search_paths(platform, dependent_target.pod_name, defines_module? && dependent_target.uses_modular_headers?(false)))
|
835
955
|
end
|
836
956
|
header_search_paths.uniq
|
837
957
|
end
|
838
958
|
|
839
|
-
# @param
|
959
|
+
# @param [Specification] spec the specification to return build settings for.
|
960
|
+
#
|
961
|
+
# @param [String] configuration the configuration to scope the build settings.
|
840
962
|
#
|
841
963
|
# @return [BuildSettings::PodTargetSettings] The build settings for the given spec
|
842
964
|
#
|
843
|
-
def build_settings_for_spec(spec)
|
965
|
+
def build_settings_for_spec(spec, configuration: nil)
|
966
|
+
raise ArgumentError, 'Must give configuration' unless configuration
|
967
|
+
configuration = user_build_configurations[configuration] if user_build_configurations.key?(configuration)
|
968
|
+
build_settings_by_config_for_spec(spec)[configuration] || raise(ArgumentError, "No build settings for #{spec} (configuration #{configuration.inspect}) (known configurations #{config_variants})")
|
969
|
+
end
|
970
|
+
|
971
|
+
def build_settings_by_config_for_spec(spec)
|
844
972
|
case spec.spec_type
|
845
|
-
when :test then
|
846
|
-
when :app then
|
973
|
+
when :test then test_spec_build_settings_by_config[spec.name]
|
974
|
+
when :app then app_spec_build_settings_by_config[spec.name]
|
847
975
|
else build_settings
|
848
976
|
end || raise(ArgumentError, "No build settings for #{spec}")
|
849
977
|
end
|
850
978
|
|
979
|
+
def user_config_names_by_config_type
|
980
|
+
user_build_configurations.each_with_object({}) do |(user, type), hash|
|
981
|
+
hash[type] ||= []
|
982
|
+
hash[type] << user
|
983
|
+
end.each_value(&:freeze).freeze
|
984
|
+
end
|
985
|
+
|
851
986
|
protected
|
852
987
|
|
853
988
|
# Returns whether the pod target should use modular headers.
|
@@ -867,19 +1002,33 @@ module Pod
|
|
867
1002
|
|
868
1003
|
private
|
869
1004
|
|
1005
|
+
def config_variants
|
1006
|
+
if user_build_configurations.empty?
|
1007
|
+
%i(debug release)
|
1008
|
+
else
|
1009
|
+
user_build_configurations.values.uniq
|
1010
|
+
end
|
1011
|
+
end
|
1012
|
+
|
870
1013
|
def create_build_settings
|
871
|
-
|
1014
|
+
Hash[config_variants.map do |config|
|
1015
|
+
[config, BuildSettings::PodTargetSettings.new(self, nil, :configuration => config)]
|
1016
|
+
end]
|
872
1017
|
end
|
873
1018
|
|
874
|
-
def
|
1019
|
+
def create_test_build_settings_by_config
|
875
1020
|
Hash[test_specs.map do |test_spec|
|
876
|
-
[test_spec.name,
|
1021
|
+
[test_spec.name, Hash[config_variants.map do |config|
|
1022
|
+
[config, BuildSettings::PodTargetSettings.new(self, test_spec, :configuration => config)]
|
1023
|
+
end]]
|
877
1024
|
end]
|
878
1025
|
end
|
879
1026
|
|
880
|
-
def
|
1027
|
+
def create_app_build_settings_by_config
|
881
1028
|
Hash[app_specs.map do |app_spec|
|
882
|
-
[app_spec.name,
|
1029
|
+
[app_spec.name, Hash[config_variants.map do |config|
|
1030
|
+
[config, BuildSettings::PodTargetSettings.new(self, app_spec, :configuration => config)]
|
1031
|
+
end]]
|
883
1032
|
end]
|
884
1033
|
end
|
885
1034
|
|