Class: Xcode::Scheme
- Inherits:
-
Object
- Object
- Xcode::Scheme
- Defined in:
- lib/xcode/scheme.rb
Overview
Schemes are an XML file that describe build, test, launch and profile actions For the purposes of Xcoder, we want to be able to build and test
Instance Attribute Summary collapse
-
#archive_config ⇒ Object
Returns the value of attribute archive_config.
-
#build_config ⇒ Object
Returns the value of attribute build_config.
-
#build_targets ⇒ Object
readonly
Returns the value of attribute build_targets.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#test_config ⇒ Object
Returns the value of attribute test_config.
-
#test_targets ⇒ Object
readonly
Returns the value of attribute test_targets.
Class Method Summary collapse
-
.find_in_path(parent, path) ⇒ Array<Scheme>
Parse all the scheme files that can be found at the given path.
-
.find_in_project(project) ⇒ Object
Parse all the schemes given the current project.
-
.find_in_workspace(workspace) ⇒ Object
Parse all the schemes given the current workspace.
Instance Method Summary collapse
-
#builder ⇒ Object
A builder for building this scheme.
-
#initialize(params = {}) ⇒ Scheme
constructor
A new instance of Scheme.
-
#testable? ⇒ Boolean
True if the scheme is testable, false otherwise.
- #to_s ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Scheme
Returns a new instance of Scheme.
52 53 54 55 56 57 58 59 60 |
# File 'lib/xcode/scheme.rb', line 52 def initialize(params={}) @parent = params[:parent] @path = File. params[:path] @root = File.(File.join(params[:root],'..')) @name = File.basename(path).gsub(/\.xcscheme$/,'') doc = Nokogiri::XML(open(@path)) parse_build_actions(doc) end |
Instance Attribute Details
#archive_config ⇒ Object
Returns the value of attribute archive_config.
13 14 15 |
# File 'lib/xcode/scheme.rb', line 13 def archive_config @archive_config end |
#build_config ⇒ Object
Returns the value of attribute build_config.
13 14 15 |
# File 'lib/xcode/scheme.rb', line 13 def build_config @build_config end |
#build_targets ⇒ Object (readonly)
Returns the value of attribute build_targets.
12 13 14 |
# File 'lib/xcode/scheme.rb', line 12 def build_targets @build_targets end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
12 13 14 |
# File 'lib/xcode/scheme.rb', line 12 def name @name end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
12 13 14 |
# File 'lib/xcode/scheme.rb', line 12 def parent @parent end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
12 13 14 |
# File 'lib/xcode/scheme.rb', line 12 def path @path end |
#test_config ⇒ Object
Returns the value of attribute test_config.
13 14 15 |
# File 'lib/xcode/scheme.rb', line 13 def test_config @test_config end |
#test_targets ⇒ Object (readonly)
Returns the value of attribute test_targets.
12 13 14 |
# File 'lib/xcode/scheme.rb', line 12 def test_targets @test_targets end |
Class Method Details
.find_in_path(parent, path) ⇒ Array<Scheme>
Parse all the scheme files that can be found at the given path. Schemes can be defined as ‘shared` schemes and then `user` specific schemes. Parsing the schemes will load the shared ones and then the current acting user’s schemes.
46 47 48 49 50 |
# File 'lib/xcode/scheme.rb', line 46 def self.find_in_path(parent, path) all_schemes_paths(path).map do |scheme_path| Xcode::Scheme.new(parent: parent, root: path, path: scheme_path) end end |
.find_in_project(project) ⇒ Object
Parse all the schemes given the current project.
18 19 20 |
# File 'lib/xcode/scheme.rb', line 18 def self.find_in_project(project) find_in_path(project, project.path) end |
.find_in_workspace(workspace) ⇒ Object
Parse all the schemes given the current workspace.
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/xcode/scheme.rb', line 25 def self.find_in_workspace(workspace) schemes = find_in_path(workspace, workspace.path) # Project level schemes workspace.projects.each do |project| schemes+=find_in_path(workspace, project.path) end schemes end |
Instance Method Details
#builder ⇒ Object
Returns a builder for building this scheme.
65 66 67 |
# File 'lib/xcode/scheme.rb', line 65 def builder Xcode::Builder::SchemeBuilder.new(self) end |
#testable? ⇒ Boolean
Returns true if the scheme is testable, false otherwise.
76 77 78 |
# File 'lib/xcode/scheme.rb', line 76 def testable? !@test_config.nil? end |
#to_s ⇒ Object
69 70 71 |
# File 'lib/xcode/scheme.rb', line 69 def to_s "#{name} (Scheme) in #{parent}" end |