Class: MTBuild::TestApplicationConfiguration
- Inherits:
-
CompiledConfiguration
- Object
- Configuration
- CompiledConfiguration
- MTBuild::TestApplicationConfiguration
- Defined in:
- lib/mtbuild/test_application_configuration.rb
Overview
Use this class to create test application configurations. You won’t typically instantiate this directly. Instead, the TestApplicationProject.add_configuration method will create this for you.
Instance Attribute Summary
Attributes inherited from CompiledConfiguration
#dependencies, #source_files, #tests
Attributes inherited from Configuration
#configuration_name, #output_folder, #parent_project, #project_folder
Instance Method Summary collapse
-
#configure_tasks ⇒ Object
Create the actual Rake tasks that will perform the configuration’s work.
Methods inherited from CompiledConfiguration
Methods included from Rake::DSL
#application_task, #framework_task, #static_library_task, #test_application_task
Methods inherited from Configuration
Constructor Details
This class inherits a constructor from MTBuild::CompiledConfiguration
Instance Method Details
#configure_tasks ⇒ Object
Create the actual Rake tasks that will perform the configuration’s work
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/mtbuild/test_application_configuration.rb', line 10 def configure_tasks super all_object_files = [] all_object_folders = [] @toolchains.each do |toolchain, sources| object_files, object_folders = toolchain.create_compile_tasks(sources) all_object_files |= object_files all_object_folders |= object_folders end project_filename = @parent_project.project_name.to_s.gsub(':','-') application_binaries, application_files, application_folders = @default_toolchain.create_application_tasks(all_object_files, project_filename) dependencies = @dependencies+all_object_folders+application_folders+application_files+application_binaries desc "Build and run test application '#{@parent_project.project_name}' with configuration '#{@configuration_name}'" new_task = test_application_task @configuration_name => dependencies do |t| @post_build.call if @post_build.respond_to? :call puts "built test application #{t.name}." sh "\"#{application_binaries.first}\"" puts "ran test application #{t.name}." end end |