Class: Xcodeproj::XCScheme::BuildAction::Entry
- Inherits:
-
XMLElementWrapper
- Object
- XMLElementWrapper
- Xcodeproj::XCScheme::BuildAction::Entry
- Defined in:
- lib/xcodeproj/scheme/build_action.rb
Overview
————————————————————————-#
Instance Attribute Summary
Attributes inherited from XMLElementWrapper
Instance Method Summary collapse
- #add_buildable_reference(ref) ⇒ Object
- #build_for_analyzing=(flag) ⇒ Object
-
#build_for_analyzing? ⇒ Bool
Whether or not to build this target when building for Analyzing.
- #build_for_archiving=(flag) ⇒ Object
-
#build_for_archiving? ⇒ Bool
Whether or not to build this target when building for Archiving.
- #build_for_profiling=(flag) ⇒ Object
-
#build_for_profiling? ⇒ Bool
Whether or not to build this target when building for Profiling.
- #build_for_running=(flag) ⇒ Object
-
#build_for_running? ⇒ Bool
Whether or not to build this target when building for Running.
- #build_for_testing=(flag) ⇒ Object
-
#build_for_testing? ⇒ Bool
Whether or not to build this target when building for Testing.
-
#buildable_references ⇒ Array<BuildableReference>
The list of BuildableReferences this entry will build.
-
#initialize(target_or_node = nil) ⇒ Entry
constructor
A new instance of Entry.
Methods inherited from XMLElementWrapper
Constructor Details
#initialize(target_or_node = nil) ⇒ Entry
Returns a new instance of Entry.
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 78 def initialize(target_or_node = nil) create_xml_element_with_fallback(target_or_node, 'BuildActionEntry') do # Check target type to configure the default entry attributes accordingly is_test_target = false is_app_target = false if target_or_node && target_or_node.is_a?(::Xcodeproj::Project::Object::PBXNativeTarget) test_types = [Constants::PRODUCT_TYPE_UTI[:octest_bundle], Constants::PRODUCT_TYPE_UTI[:unit_test_bundle], Constants::PRODUCT_TYPE_UTI[:ui_test_bundle]] app_types = [Constants::PRODUCT_TYPE_UTI[:application]] is_test_target = test_types.include?(target_or_node.product_type) is_app_target = app_types.include?(target_or_node.product_type) end self.build_for_analyzing = true self.build_for_testing = is_test_target self.build_for_running = is_app_target self.build_for_profiling = is_app_target self.build_for_archiving = is_app_target add_buildable_reference BuildableReference.new(target_or_node) if target_or_node end end |
Instance Method Details
#add_buildable_reference(ref) ⇒ Object
185 186 187 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 185 def add_buildable_reference(ref) @xml_element.add_element(ref.xml_element) end |
#build_for_analyzing=(flag) ⇒ Object
168 169 170 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 168 def build_for_analyzing=(flag) @xml_element.attributes['buildForAnalyzing'] = bool_to_string(flag) end |
#build_for_analyzing? ⇒ Bool
Returns Whether or not to build this target when building for Analyzing.
161 162 163 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 161 def build_for_analyzing? string_to_bool(@xml_element.attributes['buildForAnalyzing']) end |
#build_for_archiving=(flag) ⇒ Object
154 155 156 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 154 def build_for_archiving=(flag) @xml_element.attributes['buildForArchiving'] = bool_to_string(flag) end |
#build_for_archiving? ⇒ Bool
Returns Whether or not to build this target when building for Archiving.
147 148 149 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 147 def build_for_archiving? string_to_bool(@xml_element.attributes['buildForArchiving']) end |
#build_for_profiling=(flag) ⇒ Object
140 141 142 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 140 def build_for_profiling=(flag) @xml_element.attributes['buildForProfiling'] = bool_to_string(flag) end |
#build_for_profiling? ⇒ Bool
Returns Whether or not to build this target when building for Profiling.
133 134 135 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 133 def build_for_profiling? string_to_bool(@xml_element.attributes['buildForProfiling']) end |
#build_for_running=(flag) ⇒ Object
126 127 128 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 126 def build_for_running=(flag) @xml_element.attributes['buildForRunning'] = bool_to_string(flag) end |
#build_for_running? ⇒ Bool
Returns Whether or not to build this target when building for Running.
119 120 121 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 119 def build_for_running? string_to_bool(@xml_element.attributes['buildForRunning']) end |
#build_for_testing=(flag) ⇒ Object
112 113 114 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 112 def build_for_testing=(flag) @xml_element.attributes['buildForTesting'] = bool_to_string(flag) end |
#build_for_testing? ⇒ Bool
Returns Whether or not to build this target when building for Testing.
105 106 107 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 105 def build_for_testing? string_to_bool(@xml_element.attributes['buildForTesting']) end |
#buildable_references ⇒ Array<BuildableReference>
Returns The list of BuildableReferences this entry will build. (The list usually contains only one element).
176 177 178 179 180 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 176 def buildable_references @xml_element.get_elements('BuildableReference').map do |node| BuildableReference.new(node) end end |