Class: MTBuild::FrameworkProject

Inherits:
Project
  • Object
show all
Defined in:
lib/mtbuild/framework_project.rb

Overview

This class is used to load frameworks. A framework provides precompiled objects/libraries and API headers. Listing a framework as a dependency in an application will automatically include the framework’s API headers and link with its objects/libraries

Instance Attribute Summary

Attributes inherited from Project

#clean_list, #output_folder, #parent_workspace, #project_folder, #project_name

Instance Method Summary collapse

Methods inherited from Project

#add_files_to_clean, #effective_output_folder, #set_output_folder, #task_for_configuration

Methods included from Rake::DSL

#application_task, #framework_task, #static_library_task, #test_application_task

Constructor Details

#initialize(project_name, project_folder, &configuration_block) ⇒ FrameworkProject

Returns a new instance of FrameworkProject.



11
12
13
14
# File 'lib/mtbuild/framework_project.rb', line 11

def initialize(project_name, project_folder, &configuration_block)
  @api_headers = []
  super
end

Instance Method Details

#add_api_headers(api_headers) ⇒ Object

Specifies API header locations



28
29
30
# File 'lib/mtbuild/framework_project.rb', line 28

def add_api_headers(api_headers)
  @api_headers += Utils.expand_folder_list(api_headers, @project_folder)
end

#add_configuration(configuration_name, configuration) ⇒ Object

Adds a named FrameworkConfiguration to the project.



17
18
19
20
21
22
23
24
25
# File 'lib/mtbuild/framework_project.rb', line 17

def add_configuration(configuration_name, configuration)
  super
  default_configuration = {}
  default_configuration = @parent_workspace.configuration_defaults.fetch(configuration_name, {}) unless @parent_workspace.nil?
  merged_configuration = Utils.merge_configurations(default_configuration, configuration)
  cfg = FrameworkConfiguration.new(self, effective_output_folder, configuration_name, merged_configuration, @api_headers)
  @configurations << cfg
  return cfg
end