lib/cocoapods-jxedt/binary/config.rb in cocoapods-jxedt-0.0.14 vs lib/cocoapods-jxedt/binary/config.rb in cocoapods-jxedt-0.0.15

- old
+ new

@@ -5,39 +5,39 @@ class Config attr_accessor :dsl_config APPLICABLE_DSL_CONFIG = { - :all_binary => '全部组件允许使用二进制。默认为false', - :binary_dir => "framework的保存路径,相对于'Pods/Pods.xcodeproj'的相对路径。默认为'../_Prebuild'", - :binary_switch => "二进制开关,关闭则不hook pre_install过程。默认为true", - :prebuild_job => "开启编译任务,设置为false则不触发编译。默认为true", - :keep_source_project => "保留源码的pods工程,默认保留,方便查看源码", - :dev_pods_enabled => "Development Pods是否支持binary。默认为false", - :excluded_pods => "排除binary的pods", - :xcconfig_configuration_alias => "xcconfig文件中configuration的别名,configurations设置为多个值的时候会用到,用于搜索替换。一般不需要设置,有默认值为'cocoapods-jxedt-binary'", - :framework_header_search_enabled => "设置开启binary的framework是否配置framework的HEADER_SEARCH_PATH,兼容头文件引用的问题。默认为false", - :silent_build => "静默编译。默认true", + :all_binary => '全部组件使用二进制。默认为false', + :binary_dir => "二进制文件的保存路径,'Pods/Pods.xcodeproj'文件的相对路径。默认为'../_Prebuild'", + :binary_switch => "插件开关,设置为false则关闭插件二进制功能。默认为true", + :prebuild_job => "开启编译任务,设置为false则不触发编译功能。默认为true", + :keep_source_project => "保留源码的pods工程,方便查看源码,文件目录为Podfile文件同级目录下'Pods-Source'。默认为false", + :dev_pods_enabled => "Development Pods是否支持二进制。默认为false", + :excluded_pods => "排除binary的pods,是一个数组。默认是[]", + :xcconfig_configuration_alias => "xcconfig文件中配置多configuration的别名(一定要唯一),用于搜索替换,我们用来支持多configuration的二进制。一般不需要设置,默认值为'cocoapods-jxedt-binary'", + :framework_header_search_enabled => "开启binary的组件是否配置HEADER_SEARCH_PATH头文件搜索,兼容头文件引用的问题。默认为false", + :silent_build => "静默编译,即不输出编译命令。默认true", :configurations => "支持的configuration配置,可以写字符串'Debug'或'Release',也可以写多个'['Debug', 'Release']'。默认为'Release'", :xcframework => "编译结果是否为xcframework。默认false", - :clean_build => "编译的时候是否clean。默认true", + :clean_build => "编译的时候是否clean build。默认true", :bitcode_enabled => "开启bitcode。默认false", - :device_build_enabled => "编译真机。默认true", - :simulator_build_enabled => "编译模拟器。默认false", - :disable_dsym => "禁止编译dsym产物。默认true", - :disable_resource_compilable_pods => "禁止编译有需要编译的resource文件(xib、xcdatamodeld等)的pod", - :build_log_path => "编译的log输出路径", - :prebuild_sandbox_path => '预编译的sandbox路径,可以配置一个多台电脑都可访问的路径,可以做源码和二进制的link。必须以`/Users/cocoapods-jxedt`开头', + :device_build_enabled => "编译真机架构。默认true", + :simulator_build_enabled => "编译模拟器架构。默认false", + :disable_dsym => "禁止DSYM产物。默认true", + :disable_resource_compilable_pods => "禁止编译有特殊resource文件(xib、xcdatamodeld等)的pod。默认为false", + :build_log_path => "编译的log输出路径。", + :prebuild_sandbox_path => '预编译的sandbox(源码)路径,可以配置一个多台电脑都可访问的路径,做源码和二进制的link。必须以`/Users/cocoapods-jxedt`开头,否则插件认为无效。', :build_args => "编译的配置。了解xcodebuild命令的可以配置编译参数,例如配置 ARCHS='arm64 armv7'", - :git_cache => 'git缓存配置,A Hash. 详情查看 GIT_CACHE_CONFIG' + :git_cache => 'git缓存配置。A Hash. 详情查看 GIT_CACHE_CONFIG' }.freeze GIT_CACHE_CONFIG = { :repo => '配置缓存仓库地址,如:{:remote => "https://github.com/user/cocoapods-cache.git", :local => "~/.cocoapods-jxedt/cocoapods-cache"},或者直接写远程仓库地址"https://github.com/user/cocoapods-cache.git"', :branch => 'git cache的branch,默认是master分支', - :auto_fetch => 'pod install过程是否自动拉取远程的二进制,默认true', - :auto_push => 'pod install过程是否自动同步二进制结果到远程仓库,默认false', + :auto_fetch => '预编译过程是否自动拉取远程的二进制。默认true', + :auto_push => '预编译过程是否自动同步二进制结果到远程。默认false' }.freeze def initialize() @dsl_config = {} @git_config = {} @@ -145,12 +145,16 @@ end def build_args @args ||= begin args = @dsl_config[:build_args] || {} - args[:default] ||= ["ONLY_ACTIVE_ARCH=NO", "BUILD_LIBRARY_FOR_DISTRIBUTION=YES"] - args[:device] ||= [] # ["ARCHS='arm64 armv7 armv7s'", "ONLY_ACTIVE_ARCH=NO"] - args[:simulator] ||= [] # ["ARCHS='arm64 x86_64 i386'", "ONLY_ACTIVE_ARCH=NO"] + # 可选的配置项 + default_options = [] + default_options << "ONLY_ACTIVE_ARCH=NO" + default_options << "BUILD_LIBRARY_FOR_DISTRIBUTION=YES" + args[:default] ||= default_options + args[:device] ||= ["ARCHS='arm64'"] # ["ARCHS='arm64 armv7 armv7s'"] + args[:simulator] ||= ["ARCHS='x86_64'"] # ["ARCHS='arm64 x86_64 i386'"] args end end def support_configurations \ No newline at end of file