Class: Pod::Command::Bin::Archive

Inherits:
Pod::Command::Bin show all
Defined in:
lib/cocoapods-bin/command/bin/archive.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Bin

#validate!

Methods included from CBin::SpecFilesHelper

#binary_spec, #binary_spec_files, #binary_template_spec, #binary_template_spec_file, #binary_template_spec_files, #clear_binary_spec_file_if_needed, #code_spec, #code_spec_files, #create_binary_spec_file, #find_spec_file, #spec_files

Methods included from CBin::SourcesHelper

#binary_source, #code_source, #sources_manager, #sources_option, #valid_sources

Constructor Details

#initialize(argv) ⇒ Archive

Returns a new instance of Archive.



31
32
33
34
35
36
37
38
39
40
41
# File 'lib/cocoapods-bin/command/bin/archive.rb', line 31

def initialize(argv)
  @code_dependencies = argv.flag?('code-dependencies')
  @allow_prerelease = argv.flag?('allow-prerelease')
  @clean = argv.flag?('clean', true)
  @zip = argv.flag?('zip', true)
  @sources = argv.option('sources') || []
  @platform = Platform.new(:ios)
  super

  @additional_args = argv.remainder!
end

Class Method Details

.optionsObject



18
19
20
21
22
23
24
25
# File 'lib/cocoapods-bin/command/bin/archive.rb', line 18

def self.options
  [
    ['--code-dependencies', '使用源码依赖'],
    ['--allow-prerelease', '允许使用 prerelease 的版本'],
    ['--no-clean', '保留构建中间产物'],
    ['--no-zip', '不压缩静态 framework 为 zip']
  ].concat(Pod::Command::Gen.options).concat(super).uniq
end

Instance Method Details

#runObject



43
44
45
46
47
48
49
# File 'lib/cocoapods-bin/command/bin/archive.rb', line 43

def run
  @spec = Specification.from_file(spec_file)
  generate_project
  build_static_framework
  zip_static_framework if @zip
  clean_workspace if @clean
end