Class: Xcodeproj::XCScheme::BuildableReference
- Inherits:
-
XMLElementWrapper
- Object
- XMLElementWrapper
- Xcodeproj::XCScheme::BuildableReference
- Defined in:
- lib/xcodeproj/scheme/buildable_reference.rb
Overview
This class wraps the BuildableReference node of a .xcscheme XML file
A BuildableReference is a reference to a buildable product (which is typically is synonymous for an Xcode target)
Instance Attribute Summary
Attributes inherited from XMLElementWrapper
Instance Method Summary collapse
-
#buildable_name ⇒ String
The name of the final product when building this Buildable Reference.
- #buildable_name=(value) ⇒ Object
-
#initialize(target_or_node) ⇒ BuildableReference
constructor
A new instance of BuildableReference.
-
#set_reference_target(target, override_buildable_name = false) ⇒ Object
Set the BlueprintIdentifier (target.uuid), BlueprintName (target.name) and TerefencedContainer (URI pointing to target’s projet) all at once.
-
#target_name ⇒ String
The name of the target this Buildable Reference points to.
-
#target_referenced_container ⇒ String
The string representing the container of that target.
-
#target_uuid ⇒ String
The Unique Identifier of the target (target.uuid) this Buildable Reference points to.
Methods inherited from XMLElementWrapper
Constructor Details
#initialize(target_or_node) ⇒ BuildableReference
Returns a new instance of BuildableReference.
13 14 15 16 17 18 |
# File 'lib/xcodeproj/scheme/buildable_reference.rb', line 13 def initialize(target_or_node) create_xml_element_with_fallback(target_or_node, 'BuildableReference') do @xml_element.attributes['BuildableIdentifier'] = 'primary' set_reference_target(target_or_node, true) if target_or_node end end |
Instance Method Details
#buildable_name ⇒ String
Returns The name of the final product when building this Buildable Reference.
65 66 67 |
# File 'lib/xcodeproj/scheme/buildable_reference.rb', line 65 def buildable_name @xml_element.attributes['BuildableName'] end |
#buildable_name=(value) ⇒ Object
72 73 74 |
# File 'lib/xcodeproj/scheme/buildable_reference.rb', line 72 def buildable_name=(value) @xml_element.attributes['BuildableName'] = value end |
#set_reference_target(target, override_buildable_name = false) ⇒ Object
Set the BlueprintIdentifier (target.uuid), BlueprintName (target.name)
and TerefencedContainer (URI pointing to target's projet) all at once
55 56 57 58 59 60 |
# File 'lib/xcodeproj/scheme/buildable_reference.rb', line 55 def set_reference_target(target, override_buildable_name = false) @xml_element.attributes['BlueprintIdentifier'] = target.uuid @xml_element.attributes['BlueprintName'] = target.name @xml_element.attributes['ReferencedContainer'] = construct_referenced_container_uri(target) self.buildable_name = construct_buildable_name(target) if override_buildable_name end |
#target_name ⇒ String
Returns The name of the target this Buildable Reference points to.
23 24 25 |
# File 'lib/xcodeproj/scheme/buildable_reference.rb', line 23 def target_name @xml_element.attributes['BlueprintName'] end |
#target_referenced_container ⇒ String
Returns The string representing the container of that target. Typically in the form of ‘container:xxxx.xcodeproj’.
42 43 44 |
# File 'lib/xcodeproj/scheme/buildable_reference.rb', line 42 def target_referenced_container @xml_element.attributes['ReferencedContainer'] end |
#target_uuid ⇒ String
You can use this to ‘#find` the `Xcodeproj::Project::Object::AbstractTarget` instance in your Xcodeproj::Project object. e.g. `project.targets.find { |t| t.uuid == ref.target_uuid }`
Returns The Unique Identifier of the target (target.uuid) this Buildable Reference points to.
34 35 36 |
# File 'lib/xcodeproj/scheme/buildable_reference.rb', line 34 def target_uuid @xml_element.attributes['BlueprintIdentifier'] end |