Class: Pod::Command::JxedtCommand::Binary::SourceProject

Inherits:
Pod::Command::JxedtCommand::Binary show all
Defined in:
lib/cocoapods-jxedt/command/binary/command/source_project.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ SourceProject

Returns a new instance of SourceProject.



17
18
19
# File 'lib/cocoapods-jxedt/command/binary/command/source_project.rb', line 17

def initialize(argv)
    super
end

Class Method Details

.optionsObject



14
15
16
# File 'lib/cocoapods-jxedt/command/binary/command/source_project.rb', line 14

def self.options
    []
end

Instance Method Details

#runObject



25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/cocoapods-jxedt/command/binary/command/source_project.rb', line 25

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

#validate!Object



21
22
23
# File 'lib/cocoapods-jxedt/command/binary/command/source_project.rb', line 21

def validate!
    super
end