lib/cocoapods-binary/Prebuild.rb in cocoapods-binary-0.4.3 vs lib/cocoapods-binary/Prebuild.rb in cocoapods-binary-0.4.4
- old
+ new
@@ -1,8 +1,10 @@
require_relative 'rome/build_framework'
require_relative 'helper/passer'
+require_relative 'helper/target_checker'
+
# patch prebuild ability
module Pod
class Installer
@@ -65,10 +67,14 @@
# Build the needed framework files
def prebuild_frameworks!
+ # check
+ # give a early warning, instead of after compiling all the pods
+ Prebuild.check_one_pod_should_have_only_one_target(self.pod_targets)
+
# build options
sandbox_path = sandbox.root
existed_framework_folder = sandbox.generate_framework_path
bitcode_enabled = Pod::Podfile::DSL.bitcode_enabled
targets = []
@@ -96,11 +102,13 @@
name_to_target_hash = self.pod_targets.reduce({}) do |sum, target|
sum[target.name] = target
sum
end
targets = root_names_to_update.map do |root_name|
- name_to_target_hash[root_name]
+ t = name_to_target_hash[root_name]
+ raise "There's no target named (#{root_name}) in Pod.xcodeproj.\n #{name_to_target_hash.keys}" if t.nil?
+ t
end || []
# add the dendencies
dependency_targets = targets.map {|t| t.recursive_dependent_targets }.flatten.uniq || []
targets = (targets + dependency_targets).uniq
@@ -109,19 +117,21 @@
end
targets = targets.reject {|pod_target| sandbox.local?(pod_target.pod_name) }
-
# build!
Pod::UI.puts "Prebuild frameworks (total #{targets.count})"
Pod::Prebuild.remove_build_dir(sandbox_path)
targets.each do |target|
- next unless target.should_build?
+ if !target.should_build?
+ UI.puts "Prebuilding #{target.label}"
+ next
+ end
output_path = sandbox.framework_folder_path_for_pod_name(target.name)
output_path.mkpath unless output_path.exist?
- Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled)
+ Pod::Prebuild.build(sandbox_path, target, output_path, bitcode_enabled, Podfile::DSL.custom_build_options, Podfile::DSL.custom_build_options_simulator)
# save the resource paths for later installing
if target.static_framework? and !target.resource_paths.empty?
framework_path = output_path + target.framework_name
standard_sandbox_path = sandbox.standard_sanbox_path
\ No newline at end of file