class CBin::Upload::Helper
Public Class Methods
new(spec,code_dependencies,sources)
click to toggle source
# File lib/cocoapods-tdf-bin/helpers/upload_helper.rb, line 18 def initialize(spec,code_dependencies,sources) @spec = spec @code_dependencies = code_dependencies @sources = sources end
Public Instance Methods
curl_framework()
click to toggle source
推送二进制
curl http://ci.xxx:9192/frameworks -F "name=IMYFoundation" -F "version=7.7.4.2" -F "annotate=IMYFoundation_7.7.4.2_log" -F "file=@bin-zip/bin_IMYFoundation_7.7.4.2.zip"
# File lib/cocoapods-tdf-bin/helpers/upload_helper.rb, line 48 def curl_framework zip_file = "#{CBin::Config::Builder.instance.zip_dir}/#{@spec.name}.framework.zip" res = File.exist?(zip_file) if res command = "curl #{CBin.config.bin_upload_url} -F \"frameworkName=#{@spec.name}\" -F \"version=#{@spec.version}\" -F \"changelog=#{@spec.name}_#{@spec.version}_log\" -F \"framework=@#{zip_file}\"" print <<EOF 上传二进制文件 #{command} EOF upload_result = `#{command}` puts "#{upload_result}" end res end
push_binary_repo(binary_podsepc_json)
click to toggle source
上传二进制 podspec
# File lib/cocoapods-tdf-bin/helpers/upload_helper.rb, line 67 def push_binary_repo(binary_podsepc_json) argvs = [ "#{binary_podsepc_json}", "--binary", "--sources=#{sources_option(@code_dependencies, @sources)},https:\/\/cdn.cocoapods.org", "--skip-import-validation", "--use-libraries", "--allow-warnings", "--verbose", "--code-dependencies" ] if @verbose argvs += ['--verbose'] end push = Pod::Command::Bin::Repo::Push.new(CLAide::ARGV.new(argvs)) push.validate! push.run end
spec_creator()
click to toggle source
# File lib/cocoapods-tdf-bin/helpers/upload_helper.rb, line 39 def spec_creator spec_creator = CBin::SpecificationSource::Creator.new(@spec) spec_creator.create spec_creator.write_spec_file spec_creator.filename end
upload()
click to toggle source
# File lib/cocoapods-tdf-bin/helpers/upload_helper.rb, line 24 def upload Dir.chdir(CBin::Config::Builder.instance.root_dir) do # 创建binary-template.podsepc # 上传二进制文件 # 上传二进制 podspec res_framework = curl_framework if res_framework filename = spec_creator push_binary_repo(filename) end res_framework end end