Class: XCCache::Command

Inherits:
CLAide::Command
  • Object
show all
Includes:
XCCache::Config::Mixin
Defined in:
lib/xccache/command.rb,
lib/xccache/command/off.rb,
lib/xccache/command/pkg.rb,
lib/xccache/command/use.rb,
lib/xccache/command/base.rb,
lib/xccache/command/build.rb,
lib/xccache/command/cache.rb,
lib/xccache/command/remote.rb,
lib/xccache/command/rollback.rb,
lib/xccache/command/pkg/build.rb,
lib/xccache/command/cache/list.rb,
lib/xccache/command/cache/clean.rb,
lib/xccache/command/remote/pull.rb,
lib/xccache/command/remote/push.rb

Direct Known Subclasses

Build, Cache, Off, Pkg, Remote, Rollback, Use

Defined Under Namespace

Classes: Build, Cache, Off, Options, Pkg, Remote, Rollback, Use

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from XCCache::Config::Mixin

#config

Constructor Details

#initialize(argv) ⇒ Command

Returns a new instance of Command.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/xccache/command.rb', line 16

def initialize(argv)
  super
  set_ansi_mode
  config.verbose = verbose unless verbose.nil?
  config.install_config = argv.option("config", "debug")
  @install_options = {
    :sdks => str_to_sdks(argv.option("sdk")),
    :config => config.install_config,
  }
  @build_options = {
    **@install_options,
    :recursive => argv.flag?("recursive"),
    :merge_slices => argv.flag?("merge-slices", true),
    :library_evolution => argv.flag?("library-evolution"),
  }
end

Instance Attribute Details

#build_optionsObject (readonly)

Returns the value of attribute build_options.



14
15
16
# File 'lib/xccache/command.rb', line 14

def build_options
  @build_options
end

#install_optionsObject (readonly)

Returns the value of attribute install_options.



14
15
16
# File 'lib/xccache/command.rb', line 14

def install_options
  @install_options
end

Instance Method Details

#str_to_sdks(str) ⇒ Object



33
34
35
# File 'lib/xccache/command.rb', line 33

def str_to_sdks(str)
  (str || config.default_sdk).split(",").map { |s| Swift::Sdk.new(s) }
end