lib/cocoapods-tdfire-binary/command/package.rb in cocoapods-tdfire-binary-1.3.9 vs lib/cocoapods-tdfire-binary/command/package.rb in cocoapods-tdfire-binary-1.3.10
- old
+ new
@@ -1,9 +1,10 @@
require 'colored2'
require 'fileutils'
require 'cocoapods_packager'
require 'cocoapods-tdfire-binary/binary_url_manager'
+require 'cocoapods-tdfire-binary/binary_state_store'
require 'cocoapods-tdfire-binary/binary_specification_refactor'
module Pod
class Command
class Binary < Command
@@ -18,21 +19,23 @@
[
['--clean', '执行成功后,删除 zip 文件外的所有生成文件'],
['--spec-sources', '私有源地址'],
# ['--local', '使用本地代码'],
['--use-carthage', 'carthage使用carthage进行打包,三方库提供carthage的优先'],
- ['--subspecs', '打包子组件']
+ ['--subspecs', '打包子组件'],
+ ['--binary-first', '二进制优先']
].concat(super)
end
def initialize(argv)
@clean = argv.flag?('clean')
@local = argv.flag?('local')
@use_carthage = argv.flag?('use-carthage')
@spec_sources = argv.option('spec-sources')
@subspecs= argv.option('subspecs')
@spec_file = first_podspec
+ @binary_first = argv.flag?('binary-first')
super
end
def validate!
super
@@ -52,9 +55,15 @@
# 组件有多个 platform 时,限制 cocoapods-packager 只打 ios 代码
Pod::Tdfire::BinaryStateStore.limit_platform = true
spec = Specification.from_file(@spec_file)
prepare(spec)
+
+ if @binary_first
+ Pod::Tdfire::BinaryStateStore.unpublished_pods = Pod::Tdfire::BinaryStateStore.unpublished_pods + Array(spec.name)
+ Pod::Tdfire::BinaryStateStore.set_use_binary
+ end
+
package(spec)
zip_packager_framework(spec)
Pod::Tdfire::BinaryStateStore.limit_platform = false
end
\ No newline at end of file