Class: Xcode::RakeTask
- Inherits:
-
Rake::TaskLib
- Object
- Rake::TaskLib
- Xcode::RakeTask
- Includes:
- Rake::DSL
- Defined in:
- lib/xcoder/rake_task.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
The name of the prefixed namespace.
Instance Method Summary collapse
-
#builder_actions ⇒ Array
Available actions of a Builder.
-
#directory ⇒ Object
The default directory is the current working directory.
- #directory=(value) ⇒ Object
-
#initialize(name = :xcode) {|_self| ... } ⇒ RakeTask
constructor
By default this will generate rake tasks within the ‘xcode’ namespace for all the projects (within the current working directory), all their targets, and all their configs.
-
#projects ⇒ Array<Projects>
All the projects found that match the filtering criteria at the specified directory or all projects at the specified directory.
- #projects=(project_names) ⇒ Object
Constructor Details
#initialize(name = :xcode) {|_self| ... } ⇒ RakeTask
By default this will generate rake tasks within the ‘xcode’ namespace for all the projects (within the current working directory), all their targets, and all their configs. This will also generate tasks for all of a projects schemes as well.
The task accepts a single parameter. This parameter allows you to change the root namespace that the tasks are generated within.
Additionally a block can be specified to provide additional configuration:
Often you do not want to generate rake tasks for all the projects. So you can specify the names of the projects you do want to have appear.
107 108 109 110 111 112 113 114 115 116 117 118 |
# File 'lib/xcoder/rake_task.rb', line 107 def initialize(name = :xcode) @name = name yield self if block_given? define_all_projects_list_task define_project_list_tasks define_per_project_scheme_builder_tasks define_per_project_config_builder_tasks end |
Instance Attribute Details
#name ⇒ Object
The name of the prefixed namespace. By default this will by ‘xcode’
11 12 13 |
# File 'lib/xcoder/rake_task.rb', line 11 def name @name end |
Instance Method Details
#builder_actions ⇒ Array
this should likely be generated from the Xcode::Builder object/class itself
Returns available actions of a Builder.
51 52 53 |
# File 'lib/xcoder/rake_task.rb', line 51 def builder_actions [ :build, :test, :clean, :package ] end |
#directory ⇒ Object
The default directory is the current working directory. This can be overriden to search for projects within a specified folder path.
42 43 44 |
# File 'lib/xcoder/rake_task.rb', line 42 def directory @directory ||= File.('.') end |
#directory=(value) ⇒ Object
34 35 36 |
# File 'lib/xcoder/rake_task.rb', line 34 def directory=(value) @directory = File.(value) end |
#projects ⇒ Array<Projects>
Returns all the projects found that match the filtering criteria at the specified directory or all projects at the specified directory.
26 27 28 |
# File 'lib/xcoder/rake_task.rb', line 26 def projects @projects ||= Xcode.find_projects(directory) end |
#projects=(project_names) ⇒ Object
17 18 19 |
# File 'lib/xcoder/rake_task.rb', line 17 def projects=(project_names) @projects = Xcode.find_projects(directory).find_all{|project| Array(project_names).include? project.name } end |