# copy from https://github.com/CocoaPods/cocoapods-packager require 'cocoapods-bb-bin/native/podfile' require 'cocoapods/command/gen' require 'cocoapods/generate' require 'cocoapods-bb-bin/helpers/framework_builder' require 'cocoapods-bb-bin/helpers/library_builder' require 'cocoapods-bb-bin/helpers/sources_helper' require 'cocoapods-bb-bin/command/bin/repo/push' module CBin class Upload class Helper include CBin::SourcesHelper def initialize(spec,code_dependencies,sources) @spec = spec @code_dependencies = code_dependencies @sources = sources end def upload Dir.chdir(CBin::Config::Builder.instance.root_dir) do # 创建binary-template.podsepc # 上传二进制文件 # 上传二进制 podspec res_zip = curl_zip if res_zip filename = spec_creator push_binary_repo(filename) end res_zip end end def spec_creator spec_creator = CBin::SpecificationSource::Creator.new(@spec) spec_creator.create spec_creator.write_spec_file spec_creator.filename end #推送二进制 # 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" def curl_zip # lib zip_file = "#{CBin::Config::Builder.instance.library_file(@spec)}.zip" res = File.exist?(zip_file) unless res # framework zip_file = CBin::Config::Builder.instance.framework_zip_file(@spec) + ".zip" res = File.exist?(zip_file) end unless res # xcframework zip_file = CBin::Config::Builder.instance.xcframework_zip_file(@spec) + ".zip" res = File.exist?(zip_file) end if res print <