Skip to content

Commit 4f0d0c8

Browse files
committed
add check for different forms
1 parent 702f502 commit 4f0d0c8

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

lib/cocoapods-binary/Integration.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,10 @@ def remove_target_files_if_needed
150150
# ...
151151
# after finishing the very complex orginal function
152152

153+
154+
# check
155+
self.validate_every_pod_only_have_one_form
156+
153157

154158
# prepare
155159
cache = []

lib/cocoapods-binary/helper/podfile_options.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,23 @@ def prebuild_pod_names
9797
@prebuild_pod_names ||= self.prebuild_pod_targets.map(&:pod_name)
9898
end
9999

100+
101+
def validate_every_pod_only_have_one_form
102+
prebuit = []
103+
not_prebuilt = []
104+
aggregate_targets = self.aggregate_targets
105+
aggregate_targets.each do |aggregate_target|
106+
target_definition = aggregate_target.target_definition
107+
prebuit += target_definition.prebuild_framework_pod_names
108+
not_prebuilt += target_definition.should_not_prebuild_framework_pod_names
109+
end
110+
111+
intersection = prebuit & not_prebuilt
112+
if not intersection.empty?
113+
raise Informative, "One pod can only be prebuilt or not prebuilt. These pod have different forms in multiple targets: #{intersection.to_a}. Please fix that."
114+
end
115+
end
116+
100117
end
101118
end
102119

0 commit comments

Comments
 (0)