通过podfile 向target 添加脚本
target XXX do script_phase :name => 'test', :script => 'echi "hello world"', :execution_position => :before_compileend复制代码
通过podspec 添加脚本
spec.script_phase = { :name => 'test', :script => 'echo "Hello World"', :execution_position => :before_compile }复制代码
效果图
字段含义
SCRIPT_PHASE_REQUIRED_KEYS = [:name, :script]SCRIPT_PHASE_OPTIONAL_KEYS = [:shell_path, :input_files, :output_files, :show_env_vars_in_log, :execution_position]复制代码
:name 脚本显示名称
:script 脚本内容
:execution_position 执行位置如:before_compile/:after_compile(编译前还是编译后)
:shell_path 路径
:input_files/:output_files/show_env_vars_in_log 对应自定义脚本的选项