lib/cocoapods-tdfire-binary/command/lint.rb in cocoapods-tdfire-binary-1.0.5 vs lib/cocoapods-tdfire-binary/command/lint.rb in cocoapods-tdfire-binary-1.0.6
- old
+ new
@@ -12,16 +12,18 @@
def self.options
[
['--sources', '私有源地址'],
['--clean', '执行成功后,删除 zip 文件外的所有生成文件'],
+ ['--one-binary', '只让 Lint 的 Pod 进行二进制依赖,其余都用源码'],
].concat(super)
end
def initialize(argv)
@clean = argv.flag?('clean')
@sources = argv.option('sources')
+ @one_binary = argv.flag?('one-binary')
@spec_file = first_podspec
@spec_name = @spec_file.split('/').last.split('.').first
unzip_framework
super
end
@@ -40,23 +42,32 @@
system "unzip #{zip_name}"
end
end
def run
- Tdfire::BinaryStateStore.lib_lint_binary_pod = @spec_name
+ if @one_binary
+ Pod::Tdfire::BinaryStateStore.lib_lint_binary_pod = @spec_name
+ else
+ Pod::Tdfire::BinaryStateStore.set_force_use_binary
+ end
argvs = [
- "--sources=#{@sources || Tdfire::BinaryUrlManager.private_cocoapods_url}",
+ "--sources=#{@sources || Pod::Tdfire::BinaryUrlManager.private_cocoapods_url}",
'--allow-warnings',
'--use-libraries',
'--verbose'
]
lint= Pod::Command::Lib::Lint.new(CLAide::ARGV.new(argvs))
lint.validate!
lint.run
- Tdfire::BinaryStateStore.lib_lint_binary_pod = nil
+ if @one_binary
+ Pod::Tdfire::BinaryStateStore.lib_lint_binary_pod = nil
+ else
+ Pod::Tdfire::BinaryStateStore.unset_force_use_binary
+ end
+
system "rm -fr #{@spec_name}.framework " if @clean
end
end
end
end
\ No newline at end of file