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.
- #remove_buildable_reference(ref) ⇒ Object
Methods inherited from XMLElementWrapper
Constructor Details
#initialize(target_or_node = nil) ⇒ Entry
Returns a new instance of Entry.
178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 178 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_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 self.build_for_analyzing = true add_buildable_reference BuildableReference.new(target_or_node) if target_or_node end end |
Instance Method Details
#add_buildable_reference(ref) ⇒ Object
285 286 287 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 285 def add_buildable_reference(ref) @xml_element.add_element(ref.xml_element) end |
#build_for_analyzing=(flag) ⇒ Object
268 269 270 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 268 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.
261 262 263 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 261 def build_for_analyzing? string_to_bool(@xml_element.attributes['buildForAnalyzing']) end |
#build_for_archiving=(flag) ⇒ Object
254 255 256 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 254 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.
247 248 249 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 247 def build_for_archiving? string_to_bool(@xml_element.attributes['buildForArchiving']) end |
#build_for_profiling=(flag) ⇒ Object
240 241 242 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 240 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.
233 234 235 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 233 def build_for_profiling? string_to_bool(@xml_element.attributes['buildForProfiling']) end |
#build_for_running=(flag) ⇒ Object
226 227 228 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 226 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.
219 220 221 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 219 def build_for_running? string_to_bool(@xml_element.attributes['buildForRunning']) end |
#build_for_testing=(flag) ⇒ Object
212 213 214 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 212 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.
205 206 207 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 205 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).
276 277 278 279 280 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 276 def buildable_references @xml_element.get_elements('BuildableReference').map do |node| BuildableReference.new(node) end end |
#remove_buildable_reference(ref) ⇒ Object
292 293 294 |
# File 'lib/xcodeproj/scheme/build_action.rb', line 292 def remove_buildable_reference(ref) @xml_element.delete_element(ref.xml_element) end |