Class: Pod::Command::Binary::Package

Inherits:
Pod::Command::Binary show all
Defined in:
lib/cocoapods-tdfire-binary/command/package.rb

Constant Summary

Constants inherited from Pod::Command::Binary

FIRE_FLAG

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Binary

#fire_sources, #first_podspec

Constructor Details

#initialize(argv) ⇒ Package

Returns a new instance of Package.



26
27
28
29
30
31
32
33
# File 'lib/cocoapods-tdfire-binary/command/package.rb', line 26

def initialize(argv)
  @clean = argv.flag?('clean')
   @local = argv.flag?('local')
   @use_carthage = argv.flag?('use-carthage')
  @spec_sources = argv.option('spec-sources')
  @spec_file = first_podspec
  super
end

Class Method Details

.optionsObject



17
18
19
20
21
22
23
24
# File 'lib/cocoapods-tdfire-binary/command/package.rb', line 17

def self.options
  [
    ['--clean', '执行成功后,删除 zip 文件外的所有生成文件'],
    ['--spec-sources', '私有源地址'],
    # ['--local', '使用本地代码'],
    ['--use-carthage', 'carthage使用carthage进行打包'],
  ].concat(super)
end

Instance Method Details

#runObject



40
41
42
43
44
45
46
47
48
49
50
# File 'lib/cocoapods-tdfire-binary/command/package.rb', line 40

def run
  # 组件有多个 platform 时,限制 cocoapods-packager 只打 ios 代码
  Pod::Tdfire::BinaryStateStore.limit_platform = true

  spec = Specification.from_file(@spec_file)
  prepare(spec)
  package(spec)
  zip(spec)

  Pod::Tdfire::BinaryStateStore.limit_platform = false
end

#validate!Object



35
36
37
38
# File 'lib/cocoapods-tdfire-binary/command/package.rb', line 35

def validate!
  super
  help! '当前目录下没有podspec文件.' if @spec_file.nil?
end