11require_relative 'rome/build_framework'
22require_relative 'helper/passer'
3+ require_relative 'helper/target_checker'
4+
35
46# patch prebuild ability
57module Pod
@@ -67,6 +69,10 @@ def install_when_cache_hit!
6769 # Build the needed framework files
6870 def prebuild_frameworks!
6971
72+ # check
73+ # give a early warning, instead of after compiling all the pods
74+ Prebuild . check_one_pod_should_have_only_one_target ( self . pod_targets )
75+
7076 # build options
7177 sandbox_path = sandbox . root
7278 existed_framework_folder = sandbox . generate_framework_path
@@ -98,7 +104,9 @@ def prebuild_frameworks!
98104 sum
99105 end
100106 targets = root_names_to_update . map do |root_name |
101- name_to_target_hash [ root_name ]
107+ t = name_to_target_hash [ root_name ]
108+ raise "There's no target named (#{ root_name } ) in Pod.xcodeproj.\n #{ name_to_target_hash . keys } " if t . nil?
109+ t
102110 end || [ ]
103111
104112 # add the dendencies
@@ -111,12 +119,14 @@ def prebuild_frameworks!
111119 targets = targets . reject { |pod_target | sandbox . local? ( pod_target . pod_name ) }
112120
113121
114-
115122 # build!
116123 Pod ::UI . puts "Prebuild frameworks (total #{ targets . count } )"
117124 Pod ::Prebuild . remove_build_dir ( sandbox_path )
118125 targets . each do |target |
119- next unless target . should_build?
126+ if !target . should_build?
127+ UI . puts "Prebuilding #{ target . label } "
128+ next
129+ end
120130
121131 output_path = sandbox . framework_folder_path_for_pod_name ( target . name )
122132 output_path . mkpath unless output_path . exist?
0 commit comments