module Pod class Command class JxedtCommand < Command class Binary < JxedtCommand class SourceProject < Binary self.summary = '生成binary对应的源码工程' self.description = <<-DESC 生成binary对应的源码工程 DESC self.command = 'sourceProject' self.arguments = [ ] def self.options [] end def initialize(argv) super end def validate! super end def run podfile = Pod::Config.instance.podfile lockfile = Pod::Config.instance.lockfile sandbox = Pod::Config.instance.sandbox help! '请检查命令执行路径,需要在Podfile文件所在目录执行' if podfile.nil? # 修改config配置 options = { :keep_source_project => true, # 保留源码工程 } Jxedt.config.dsl_config.merge!(options) require 'cocoapods-jxedt/binary/helper/target_definition' require 'cocoapods-jxedt/binary/helper/prebuild_sandbox' require 'cocoapods-jxedt/binary/helper/podfile_post_install_hook' require 'cocoapods-jxedt/binary/helper/prebuild_installer' # 获取原始的installer对象,必须先获取对象 prebuild_sandbox = Pod::JxedtPrebuildSandbox.from_standard_sandbox(sandbox) source_installer = Pod::JxedtPrebuildInstaller.new(prebuild_sandbox, podfile, lockfile) # 执行install source_installer.install! end end end end end end