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

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

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Binary

#binary_config, #first_podspec, #private_sources

Constructor Details

#initialize(argv) ⇒ Package

Returns a new instance of Package.



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

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

Class Method Details

.optionsObject



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

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

Instance Method Details

#runObject



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

def run
					if @use_carthage
						build_by_carthage
					else
						build_by_pod_packager
					end
end

#validate!Object



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

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