Class: Pod::Command::Pack

Inherits:
Pod::Command show all
Includes:
Shell_Command::Mixin, Uki_config::Mixin
Defined in:
lib/cocoapods-uki-packager/command/pack.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Shell_Command::Mixin

#shell

Methods included from Uki_config::Mixin

#uki_config

Constructor Details

#initialize(argv) ⇒ Pack

verbose Pods 会过滤掉 所以这里拿不到, 但是可以直接使用



31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# File 'lib/cocoapods-uki-packager/command/pack.rb', line 31

def initialize(argv)
  super
  @no_build = !argv.flag?('build', true)
  @project_sea = true
  @project_sea = false if argv.flag?('internal', false)
  @dsym = argv.flag?('dsym', false)
  @release = argv.flag?('release', false)

  uki_config.verbose = @verbose 
  uki_config.project_sea = @project_sea
  uki_config.dsym = @dsym
  uki_config.release = @release
  uki_config.no_build = @no_build
  uki_config.build_time = Time.now.to_i 
  uki_config.upload_time = 0

end

Class Method Details

.optionsObject



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/cocoapods-uki-packager/command/pack.rb', line 18

def self.options 
    [
        ['--overseas', '海外打包, 默认为海外'],
        ['--internal', '国内打包'],
        ['--no-build', '不执行编译命令,直接起飞'],
        ['--dsym', '是否生成dsym, 默认不生成'],
        ['--verbose', '详细流程'],
        ['--release', '是否是正式环境'],

    ].concat(super).uniq
end

Instance Method Details

#runObject



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'lib/cocoapods-uki-packager/command/pack.rb', line 49

def run
  if verify_workspace_exists?
      shell.export_xcode_env

   if uki_config.no_build
      #直接导出
      shell.export
   elsif 
      # 编译导出
      shell.build
   end

  end
    
end

#verify_workspace_exists?Boolean

Returns:

  • (Boolean)


65
66
67
68
69
70
71
72
73
# File 'lib/cocoapods-uki-packager/command/pack.rb', line 65

def verify_workspace_exists?
  uki_config.auto_work_space_name
  unless uki_config.workspace_name
      puts("大兄弟,请前往xxxx.workspace同级目录执行哦")
      exit
  end

  return true
end