Class: MTBuild::Configuration
- Inherits:
-
Object
- Object
- MTBuild::Configuration
- Includes:
- Rake::DSL
- Defined in:
- lib/mtbuild/configuration.rb
Overview
This is the base class for all configuration types.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#configuration_name ⇒ Object
readonly
The configuration’s name.
-
#output_folder ⇒ Object
readonly
The project’s output folder.
-
#parent_project ⇒ Object
readonly
The project that owns this configuration.
-
#project_folder ⇒ Object
readonly
The project’s folder.
Instance Method Summary collapse
-
#configure_tasks ⇒ Object
Create the actual Rake tasks that will perform the configuration’s work.
-
#initialize(parent_project, output_folder, configuration_name, configuration) ⇒ Configuration
constructor
A new instance of Configuration.
Methods included from Rake::DSL
#application_task, #framework_task, #static_library_task, #test_application_task
Constructor Details
#initialize(parent_project, output_folder, configuration_name, configuration) ⇒ Configuration
Returns a new instance of Configuration.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/mtbuild/configuration.rb', line 19 def initialize(parent_project, output_folder, configuration_name, configuration) @parent_project = parent_project @project_folder = File.(@parent_project.project_folder) @configuration_name = configuration_name @output_folder = File.(File.join(output_folder, @configuration_name.to_s)) check_configuration(configuration) @pre_build = configuration.fetch(:pre_build, nil) @post_build = configuration.fetch(:post_build, nil) @pre_build.call if @pre_build.respond_to? :call end |
Instance Attribute Details
#configuration_name ⇒ Object (readonly)
The configuration’s name
7 8 9 |
# File 'lib/mtbuild/configuration.rb', line 7 def configuration_name @configuration_name end |
#output_folder ⇒ Object (readonly)
The project’s output folder. Project output goes here.
17 18 19 |
# File 'lib/mtbuild/configuration.rb', line 17 def output_folder @output_folder end |
#parent_project ⇒ Object (readonly)
The project that owns this configuration
10 11 12 |
# File 'lib/mtbuild/configuration.rb', line 10 def parent_project @parent_project end |
#project_folder ⇒ Object (readonly)
The project’s folder. Relative path references are interpreted as relative to this folder.
14 15 16 |
# File 'lib/mtbuild/configuration.rb', line 14 def project_folder @project_folder end |
Instance Method Details
#configure_tasks ⇒ Object
Create the actual Rake tasks that will perform the configuration’s work
33 34 |
# File 'lib/mtbuild/configuration.rb', line 33 def configure_tasks end |