Class: Pod::Command::Spm::Prebuild

Inherits:
Pod::Command::Spm show all
Defined in:
lib/cocoapods-spm/command/prebuild.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Spm

#update_cli_config

Methods included from SPM::Config::Mixin

#macro_pods, #spm_config

Constructor Details

#initialize(argv) ⇒ Prebuild

Returns a new instance of Prebuild.



16
17
18
19
20
21
22
23
24
25
# File 'lib/cocoapods-spm/command/prebuild.rb', line 16

def initialize(argv)
  super
  update_cli_config(
    all: argv.flag?("all"),
    macros: argv.option("macros", "").split(","),
    config: argv.option("config"),
    dont_prebuild_macros: false,
    dont_prebuild_macros_if_exist: false
  )
end

Class Method Details

.optionsObject



8
9
10
11
12
13
14
# File 'lib/cocoapods-spm/command/prebuild.rb', line 8

def self.options
  [
    ["--all", "Prebuild all macros"],
    ["--macros=foo", "Macros to prebuild, separated by comma (,)"],
    ["--config=foo", "Config (debug/release) to prebuild macros"],
  ].concat(super)
end

Instance Method Details

#runObject



27
28
29
30
31
# File 'lib/cocoapods-spm/command/prebuild.rb', line 27

def run
  spm_config.macros.each do |name|
    SPM::MacroPrebuilder.new(name: name).run
  end
end