cocoapods-user-defined-build-types 0.0.1 → 0.0.2
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 941f6c63ff434fc7e9908d856e5ccd674cb9e73208e508f5e03aab026ce4462b
|
4
|
+
data.tar.gz: 95208d9ad4a7441af7dfd3b47031ecaa44df34fade73f3e3cfcc083145433ac6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f4e1a9014e2f79194f235ed2220b030e20e0d66d1f920ed4802f041b04558c4fb123c733192fa23e9e6a22549e1706e489b25f934fdeeeedc246c230050fef7
|
7
|
+
data.tar.gz: 49870a9537ed890ac0b95938b9d1aaa211eeac80fd5761270a9afbff74a8903575ac870ac98bdcb421b8c934c090805f6850b1d010197ce007869143aceed77a
|
@@ -1,3 +1,3 @@
|
|
1
|
-
module
|
2
|
-
VERSION = "0.0.
|
1
|
+
module CocoapodsUserDefinedBuildTypes
|
2
|
+
VERSION = "0.0.2"
|
3
3
|
end
|
@@ -27,10 +27,15 @@ module Pod
|
|
27
27
|
|
28
28
|
if options.is_a?(Hash)
|
29
29
|
options.each do |k,v|
|
30
|
-
if
|
31
|
-
|
30
|
+
next if not options.key?(Pod::UserOption.keyword)
|
31
|
+
|
32
|
+
user_build_type = options.delete(k)
|
33
|
+
if Pod::UserOption.keyword_mapping.key?(user_build_type)
|
34
|
+
build_type = Pod::UserOption.keyword_mapping[user_build_type]
|
32
35
|
building_options[pod_name] = build_type
|
33
36
|
CocoapodsUserDefinedBuildTypes.verbose_log("#{pod_name} build type set to: #{build_type}")
|
37
|
+
else
|
38
|
+
raise Pod::Informative, "#{CocoapodsUserDefinedBuildTypes::PLUGIN_NAME} could not parse a #{Pod::UserOption.keyword} of '#{user_build_type}' on #{pod_name}"
|
34
39
|
end
|
35
40
|
end
|
36
41
|
requirements.pop if options.empty?
|
@@ -52,29 +57,29 @@ module Pod
|
|
52
57
|
|
53
58
|
class Installer
|
54
59
|
|
55
|
-
|
56
|
-
|
57
|
-
|
60
|
+
# Walk through pod dependencies and assign build_type from root through all transitive dependencies
|
61
|
+
def resolve_all_pod_build_types(pod_targets)
|
62
|
+
root_pod_building_options = Pod::Podfile::TargetDefinition.root_pod_building_options.clone
|
58
63
|
|
59
|
-
|
60
|
-
|
64
|
+
pod_targets.each do |target|
|
65
|
+
next if not root_pod_building_options.key?(target.name)
|
61
66
|
|
62
|
-
|
63
|
-
|
67
|
+
build_type = root_pod_building_options[target.name]
|
68
|
+
dependencies = target.dependent_targets
|
64
69
|
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
end
|
72
|
-
dependencies = new_dependencies
|
70
|
+
# Cascade build_type down
|
71
|
+
while not dependencies.empty?
|
72
|
+
new_dependencies = []
|
73
|
+
dependencies.each do |dep_target|
|
74
|
+
dep_target.user_defined_build_type = build_type
|
75
|
+
new_dependencies.push(*dep_target.dependent_targets)
|
73
76
|
end
|
74
|
-
|
75
|
-
target.user_defined_build_type = build_type
|
77
|
+
dependencies = new_dependencies
|
76
78
|
end
|
79
|
+
|
80
|
+
target.user_defined_build_type = build_type
|
77
81
|
end
|
82
|
+
end
|
78
83
|
|
79
84
|
# ======================
|
80
85
|
# ==== PATCH METHOD ====
|
@@ -114,7 +119,7 @@ module Pod
|
|
114
119
|
end
|
115
120
|
|
116
121
|
CocoapodsUserDefinedBuildTypes.verbose_log("finished patching user defined build types")
|
117
|
-
Pod::UI.puts "
|
122
|
+
Pod::UI.puts "#{CocoapodsUserDefinedBuildTypes::PLUGIN_NAME} updated build options"
|
118
123
|
end
|
119
124
|
end
|
120
125
|
end
|