Module: Gaudi::Configuration::SystemModules::PlatformConfiguration
- Includes:
- Gaudi::ConfigurationOperations
- Defined in:
- lib/gaudi/helpers/configuration.rb
Overview
Platform configuration methods that proide more control over the raw Hash platform data
Class Method Summary collapse
-
.list_keys ⇒ Object
:stopdoc:.
- .path_keys ⇒ Object
Instance Method Summary collapse
-
#external_includes(platform) ⇒ Object
A list of paths to be used as include paths when compiling.
-
#external_libraries(platform) ⇒ Object
Returns an array with paths to the external libraries as defined in the platform configuration.
-
#external_libraries_config(platform) ⇒ Object
Loads and returns the external libraries configuration.
-
#header_extensions(platform) ⇒ Object
Header file extensions.
-
#resources(platform) ⇒ Object
A list of files to be copied together with every program.
-
#source_extensions(platform) ⇒ Object
:startdoc: Source file extensions.
-
#unit_test_libraries(platform) ⇒ Object
Returns an array with paths to the external libraries in use for unit tests as defined in the platform configuration.
Methods included from Gaudi::ConfigurationOperations
Class Method Details
.list_keys ⇒ Object
:stopdoc:
412 413 414 |
# File 'lib/gaudi/helpers/configuration.rb', line 412 def self.list_keys [] end |
.path_keys ⇒ Object
415 416 417 |
# File 'lib/gaudi/helpers/configuration.rb', line 415 def self.path_keys [] end |
Instance Method Details
#external_includes(platform) ⇒ Object
A list of paths to be used as include paths when compiling
Relative paths are interpreted relative to the main configuration file's location
430 431 432 433 |
# File 'lib/gaudi/helpers/configuration.rb', line 430 def external_includes platform includes=platform_config(platform).fetch('incs',"") return includes.split(',').map{|d| absolute_path(d.strip,config_base)} end |
#external_libraries(platform) ⇒ Object
Returns an array with paths to the external libraries as defined in the platform configuration
To do this it uses the PlatformConfiguration.external_lib_cfg file to replace the library tokens with path values
If the file exists under trunk/lib the entry is the full path to the file otherwise the entry from external_lib_cfg is returned as is (which works for system libraries i.e. winmm.lib, winole.lib etc.)
440 441 442 443 |
# File 'lib/gaudi/helpers/configuration.rb', line 440 def external_libraries platform external_lib_tokens=platform_config(platform).fetch('libs',"").split(',').map{|el| el.strip} return interpret_library_tokens(external_lib_tokens,external_libraries_config(platform),self.config_base) end |
#external_libraries_config(platform) ⇒ Object
Loads and returns the external libraries configuration
The configuration is a name=>path hash and is used to replace the library names used in the PLatform.external_libraries setting
458 459 460 461 462 463 464 465 466 467 468 |
# File 'lib/gaudi/helpers/configuration.rb', line 458 def external_libraries_config platform lib_config=platform_config(platform).fetch('lib_cfg',"") raise GaudiConfigurationError,"Missing lib_cfg entry for platform #{platform}" if lib_config.empty? external_lib_cfg=absolute_path(lib_config,config_base) raise GaudiConfigurationError,"No external library configuration for platform #{platform}" unless external_lib_cfg if File.exists?(external_lib_cfg) return YAML.load(File.read(external_lib_cfg)) else raise GaudiConfigurationError,"Cannot find external library configuration #{external_lib_cfg} for platform #{platform}" end end |
#header_extensions(platform) ⇒ Object
Header file extensions
424 425 426 |
# File 'lib/gaudi/helpers/configuration.rb', line 424 def header_extensions platform return platform_config(platform)['header_extensions'].gsub(', ',',') end |
#resources(platform) ⇒ Object
A list of files to be copied together with every program
470 471 472 |
# File 'lib/gaudi/helpers/configuration.rb', line 470 def resources platform return platform_config(platform).fetch('resources',"").split(',').map{|d| absolute_path(d.strip,config_base)} end |
#source_extensions(platform) ⇒ Object
:startdoc: Source file extensions
420 421 422 |
# File 'lib/gaudi/helpers/configuration.rb', line 420 def source_extensions platform return platform_config(platform)['source_extensions'].gsub(', ',',') end |
#unit_test_libraries(platform) ⇒ Object
Returns an array with paths to the external libraries in use for unit tests as defined in the platform configuration
To do this it uses the PlatformConfiguration.external_lib_cfg file to replace the library tokens with path values
If the file exists under trunk/lib the entry is the full path to the file otherwise the entry from external_lib_cfg is returned as is (which works for system libraries i.e. winmm.lib, libsqlite3 etc.)
450 451 452 453 |
# File 'lib/gaudi/helpers/configuration.rb', line 450 def unit_test_libraries platform external_lib_tokens=platform_config(platform).fetch('unit_test_libs',"").split(',').map{|el| el.strip} return interpret_library_tokens(external_lib_tokens,external_libraries_config(platform),self.config_base) end |