Class: Xcodeproj::XCScheme::AbstractSchemeAction
- Inherits:
-
XMLElementWrapper
- Object
- XMLElementWrapper
- Xcodeproj::XCScheme::AbstractSchemeAction
- Defined in:
- lib/xcodeproj/scheme/abstract_scheme_action.rb
Overview
This abstract class aims to be the base class for every XxxAction class that have a #build_configuration attribute
Direct Known Subclasses
AnalyzeAction, ArchiveAction, LaunchAction, ProfileAction, TestAction
Instance Attribute Summary
Attributes inherited from XMLElementWrapper
Instance Method Summary collapse
- #add_post_action(post_action) ⇒ Object
- #add_pre_action(pre_action) ⇒ Object
-
#build_configuration ⇒ String
The build configuration associated with this action (usually either 'Debug' or 'Release').
- #build_configuration=(config_name) ⇒ Object
-
#post_actions ⇒ Array<ExecutionAction>
The list of actions to run after this scheme action.
- #post_actions=(post_actions) ⇒ Object
-
#pre_actions ⇒ Array<ExecutionAction>
The list of actions to run before this scheme action.
- #pre_actions=(pre_actions) ⇒ Object
Methods inherited from XMLElementWrapper
Instance Method Details
#add_post_action(post_action) ⇒ Object
94 95 96 97 |
# File 'lib/xcodeproj/scheme/abstract_scheme_action.rb', line 94 def add_post_action(post_action) post_actions = @xml_element.elements['PostActions'] || @xml_element.add_element('PostActions') post_actions.add_element(post_action.xml_element) end |
#add_pre_action(pre_action) ⇒ Object
58 59 60 61 |
# File 'lib/xcodeproj/scheme/abstract_scheme_action.rb', line 58 def add_pre_action(pre_action) pre_actions = @xml_element.elements['PreActions'] || @xml_element.add_element('PreActions') pre_actions.add_element(pre_action.xml_element) end |
#build_configuration ⇒ String
Returns The build configuration associated with this action (usually either 'Debug' or 'Release').
15 16 17 |
# File 'lib/xcodeproj/scheme/abstract_scheme_action.rb', line 15 def build_configuration @xml_element.attributes['buildConfiguration'] end |
#build_configuration=(config_name) ⇒ Object
23 24 25 |
# File 'lib/xcodeproj/scheme/abstract_scheme_action.rb', line 23 def build_configuration=(config_name) @xml_element.attributes['buildConfiguration'] = config_name end |
#post_actions ⇒ Array<ExecutionAction>
Returns The list of actions to run after this scheme action. Each entry can be either a 'Run Script' or a 'Send Email' action.
67 68 69 70 71 72 73 |
# File 'lib/xcodeproj/scheme/abstract_scheme_action.rb', line 67 def post_actions post_actions = @xml_element.elements['PostActions'] return nil unless post_actions post_actions.get_elements('ExecutionAction').map do |entry_node| ExecutionAction.new(entry_node) end end |
#post_actions=(post_actions) ⇒ Object
79 80 81 82 83 84 85 86 87 88 |
# File 'lib/xcodeproj/scheme/abstract_scheme_action.rb', line 79 def post_actions=(post_actions) @xml_element.delete_element('PostActions') unless post_actions.empty? post_actions_element = @xml_element.add_element('PostActions') post_actions.each do |entry_node| post_actions_element.add_element(entry_node.xml_element) end end post_actions end |
#pre_actions ⇒ Array<ExecutionAction>
Returns The list of actions to run before this scheme action. Each entry can be either a 'Run Script' or a 'Send Email' action.
31 32 33 34 35 36 37 |
# File 'lib/xcodeproj/scheme/abstract_scheme_action.rb', line 31 def pre_actions pre_actions = @xml_element.elements['PreActions'] return nil unless pre_actions pre_actions.get_elements('ExecutionAction').map do |entry_node| ExecutionAction.new(entry_node) end end |
#pre_actions=(pre_actions) ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'lib/xcodeproj/scheme/abstract_scheme_action.rb', line 43 def pre_actions=(pre_actions) @xml_element.delete_element('PreActions') unless pre_actions.empty? pre_actions_element = @xml_element.add_element('PreActions') pre_actions.each do |entry_node| pre_actions_element.add_element(entry_node.xml_element) end end pre_actions end |