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

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

Constant Summary

Constants inherited from Pod::Command::Spm

Fetch, Prebuild

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Pod::Command::Spm

bind_command, #update_cli_config

Methods included from SPM::Config::SPMConfigMixin

#macro_pods, #spm_config

Methods included from SPM::Config::PodConfigMixin

#pod_config

Methods included from SPM::Config::ProjectConfigMixin

#project_config

Constructor Details

#initialize(argv) ⇒ Prebuild

Returns a new instance of Prebuild.



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

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



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

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



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

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