lib/cocoapods-xlbuild/Main.rb in cocoapods-xlbuild-1.0.1 vs lib/cocoapods-xlbuild/Main.rb in cocoapods-xlbuild-1.1.0
- old
+ new
@@ -3,10 +3,13 @@
require_relative 'tool/tool'
module Pod
class Podfile
module DSL
+ def set_local_frameworks_cache_path(path)
+ DSL.local_frameworks_cache_path = path
+ end
# Enable prebuiding for all pods
# it has a lower priority to other xlbuild settings
def use_dynamic_binary!
DSL.prebuild_all = true
DSL.static_binary = false
@@ -81,10 +84,14 @@
class_attr_accessor :dont_remove_source_code
dont_remove_source_code = true
class_attr_accessor :custom_build_options
class_attr_accessor :custom_build_options_simulator
+
+ class_attr_accessor :local_frameworks_cache_path
+ local_frameworks_cache_path = nil
+
self.custom_build_options = []
self.custom_build_options_simulator = []
end
end
end
@@ -136,10 +143,11 @@
Pod::Config.force_disable_write_lockfile true # disbale write lock file for perbuild podfile
Pod::Installer.disable_install_complete_message true # disable install complete message
# make another custom sandbox
standard_sandbox = installer_context.sandbox
+ #linpeng edit: 修改Pod目录为 Pod/_Prebuild
prebuild_sandbox = Pod::PrebuildSandbox.from_standard_sandbox(standard_sandbox)
# get the podfile for prebuild
prebuild_podfile = Pod::Podfile.from_ruby(podfile.defined_in_file)
@@ -174,13 +182,12 @@
# go on the normal install step ...
end
## pod 安装依赖的时候会执行install,install的时候会执行run_plugins_post_install_hooks(Prebuildhook了该方法)
-# 只要有触发install方法就会触发如下的
+# 只要有触发install方法就会触发如下的 ,pre hook的时候有重新创建一个Install( binary_installer.install!)因此会触发两次的post_install的hook
Pod::HooksManager.register('cocoapods-xlbuild', :post_install) do |installer_context|
if Pod::Podfile::DSL.static_binary
- Pod::UI.puts "🤖 replace_tagert_copy_source_sh " + Time.new.inspect
Pod::PrebuildSandbox.replace_tagert_copy_source_sh(installer_context)
end
if !Pod.is_prebuild_stage && Pod::Podfile::DSL.dont_remove_source_code
require_relative 'reference/reference_source_code'