lib/cocoapods-binaryhqp/Prebuild.rb in cocoapods-binaryhqp-0.4.9 vs lib/cocoapods-binaryhqp/Prebuild.rb in cocoapods-binaryhqp-0.5.0
- old
+ new
@@ -153,16 +153,29 @@
changes = lockfile.detect_changes_with_podfile(podfile)
need_update_pods = (changes[:added] + changes[:changed] + changes[:removed]).to_a
need_update_pods.each do |pod_name|
pod_path = Pathname.new(standard_sanbox.root.to_s + "/#{pod_name}")
- Pod::UI.puts("删除 #{pod_path.to_s}")
+ Pod::UI.puts("删除 #{pod_path.to_s}") if config.verbose
pod_path.rmtree if pod_path.exist?
end
end
end
+
+ def delete_all_standard_sandbox_pod(standard_sanbox)
+ if lockfile
+ changes = lockfile.detect_changes_with_podfile(podfile)
+ need_update_pods = (changes[:added] + changes[:changed] + changes[:removed] + changes[:unchanged]).to_a
+ need_update_pods.each do |pod_name|
+ pod_path = Pathname.new(standard_sanbox.root.to_s + "/#{pod_name}")
+ Pod::UI.puts("删除 #{pod_path.to_s}") if config.verbose
+ pod_path.rmtree if pod_path.exist?
+ end
+ end
+ end
+
# Build the needed framework files
def prebuild_frameworks!(after_write_lock)
# build options
sandbox_path = sandbox.root
@@ -295,13 +308,14 @@
# remove useless pods
all_needed_names = self.pod_targets.map(&:name).uniq
useless_target_names = sandbox.exsited_framework_target_names.reject do |name|
all_needed_names.include? name
end
- useless_target_names.each do |name|
- path = sandbox.framework_folder_path_for_target_name(name)
- path.rmtree if path.exist?
- end
+ # 不删除已经编译好的framework
+ # useless_target_names.each do |name|
+ # path = sandbox.framework_folder_path_for_target_name(name)
+ # path.rmtree if path.exist?
+ # end
if not Podfile::DSL.dont_remove_source_code
# only keep manifest.lock and framework folder in _Prebuild
to_remain_files = ["Manifest.lock", File.basename(existed_framework_folder)]
to_delete_files = sandbox_path.children.select do |file|
\ No newline at end of file