Class: Fastlane::Helper::Xcspec::Mapping

Inherits:
Object
  • Object
show all
Defined in:
lib/fastlane/plugin/xcconfig_actions/helper/xcspec.rb

Overview

Class for managing build flags mapping.

Mapping collapse

Mapping collapse

Constructor Details

#initialize(flags = "", linker_flags = "") ⇒ Mapping

Initialize new mapping.

Parameters:

  • flags (String) (defaults to: "")

    Main tool flags.

  • linker_flags (String) (defaults to: "")

    Additional linker flags.



27
28
29
30
# File 'lib/fastlane/plugin/xcconfig_actions/helper/xcspec.rb', line 27

def initialize(flags = "", linker_flags = "")
  @flags = flags
  @linker_flags = linker_flags
end

Instance Attribute Details

#flagsObject (readonly)

Main tool flags.



19
20
21
# File 'lib/fastlane/plugin/xcconfig_actions/helper/xcspec.rb', line 19

def flags
  @flags
end

#linker_flagsObject (readonly)

Additional linker flags



22
23
24
# File 'lib/fastlane/plugin/xcconfig_actions/helper/xcspec.rb', line 22

def linker_flags
  @linker_flags
end

Instance Method Details

#join(other) ⇒ Mapping

Join with other mapping and return new mapping.

Parameters:

  • other (Mapping)

    Other mapping to join with.

Returns:

  • (Mapping)

    New joined mapping.



35
36
37
38
39
40
41
42
# File 'lib/fastlane/plugin/xcconfig_actions/helper/xcspec.rb', line 35

def join(other)
  return self if other.nil?

  joined_flags = [flags, other.flags].reject(&:empty?).join(" ")
  joined_linker_flags = [linker_flags, other.linker_flags].reject(&:empty?).join(" ")

  Mapping.new(joined_flags, joined_linker_flags)
end