Class: Xcodeproj::XCScheme::BuildableProductRunnable

Inherits:
XMLElementWrapper show all
Defined in:
lib/xcodeproj/scheme/buildable_product_runnable.rb

Overview

This class wraps the BuildableProductRunnable node of a .xcscheme XML file

A BuildableProductRunnable is a product that is both buildable (it contains a BuildableReference) and runnable (it can be launched and debugged)

Instance Attribute Summary

Attributes inherited from XMLElementWrapper

#xml_element

Instance Method Summary collapse

Methods inherited from XMLElementWrapper

#to_s

Constructor Details

#initialize(target_or_node = nil, runnable_debugging_mode = nil) ⇒ BuildableProductRunnable

Returns a new instance of BuildableProductRunnable.

Parameters:

  • target_or_node (Xcodeproj::Project::Object::AbstractTarget, REXML::Element) (defaults to: nil)

    Either the Xcode target to reference, or an existing XML 'BuildableProductRunnable' node element to reference or nil to create an new, empty BuildableProductRunnable

  • runnable_debugging_mode (#to_s) (defaults to: nil)

    The debugging mode (usually '0')


17
18
19
20
21
22
# File 'lib/xcodeproj/scheme/buildable_product_runnable.rb', line 17

def initialize(target_or_node = nil, runnable_debugging_mode = nil)
  create_xml_element_with_fallback(target_or_node, 'BuildableProductRunnable') do
    self.buildable_reference = BuildableReference.new(target_or_node) if target_or_node
    @xml_element.attributes['runnableDebuggingMode'] = runnable_debugging_mode.to_s if runnable_debugging_mode
  end
end

Instance Method Details

#buildable_referenceBuildableReference

Returns The Buildable Reference this Buildable Product Runnable is gonna build and run.

Returns:

  • (BuildableReference)

    The Buildable Reference this Buildable Product Runnable is gonna build and run


41
42
43
# File 'lib/xcodeproj/scheme/buildable_product_runnable.rb', line 41

def buildable_reference
  @buildable_reference ||= BuildableReference.new @xml_element.elements['BuildableReference']
end

#buildable_reference=(ref) ⇒ Object

Parameters:

  • ref (BuildableReference)

    Set the Buildable Reference this Buildable Product Runnable is gonna build and run


48
49
50
51
52
# File 'lib/xcodeproj/scheme/buildable_product_runnable.rb', line 48

def buildable_reference=(ref)
  @xml_element.delete_element('BuildableReference')
  @xml_element.add_element(ref.xml_element)
  @buildable_reference = ref
end

#runnable_debugging_modeString

Returns The Runnable debugging mode (usually either empty or equal to '0').

Returns:

  • (String)

    The Runnable debugging mode (usually either empty or equal to '0')


27
28
29
# File 'lib/xcodeproj/scheme/buildable_product_runnable.rb', line 27

def runnable_debugging_mode
  @xml_element.attributes['runnableDebuggingMode']
end

#runnable_debugging_mode=(value) ⇒ Object

Parameters:

  • value (String)

    Set the runnable debugging mode of this buildable product runnable


34
35
36
# File 'lib/xcodeproj/scheme/buildable_product_runnable.rb', line 34

def runnable_debugging_mode=(value)
  @xml_element.attributes['runnableDebuggingMode'] = value.to_s
end