RT-Druid configuration

From ERIKA WIKI
Jump to: navigation, search

Ways to configure RT-Druid

It is possible to configure some aspects of RT-Druid using three different approaches

  • environment variables
  • configuration file
  • Project and workspace properties in Eclipse IDE

Environment variables

Environment variables can be used for both command line and graphical execution of RT-Druid.

Depending on the architecture, they can be set using a graphical interface, like in windows, or set in a file, like in .bashrc for linux

Configuration file

The RT-Druid configuration file is a plain text file that uses the java properties format:

  • each line is composed by a pair keyword = value;
  • lines starting with # are considered comments.

The default name of configuration file is common_oil.pref and it is placed in rtdruid_base_path/configuration/common_oil.pref (see also Common_oil.pref_example)


Its content is used for both command line execution of RT-Druid, and graphical execution of RT-Druid. In this second case, RT-Druid Eclipse IDE Property may override one or more values defined in the configuration file.

RT-Druid Eclipse IDE Property

RT-Druid provides a graphical interface to set one, or more properties, for the entire workspace or a specific project.

The properties related to the entire workspace can be found using the "Window->Preference" menu:

Figure 1: Eclipse Window->Preferences menu.

Then, the preferences window is open. All pages related to RT-Druid and Erika Enterprise are located inside the Oil item. As example, here is the page to configure all available generator's properties:

Figure 2: RT-Druid generator properties (workspace-scope).


The properties related to a specific project are available in the Project properties window. This window can be open through a right click on the project element, to open its pop-up menu:

Figure 3: Eclipse Project->Pop-up menu.

Selecting the properties menu, the project preferences window is shown. All pages related to RT-Druid and Erika Enterprise are located inside the Oil item. As example, here is the page to configure all available generator's properties:

Figure 4: RT-Druid generator properties (project-scope).

Please, note the flag Enable project specific settings: it must be enabled to allow the user to provide a project specific property; otherwise, the workspace-scope value is used.

Erika Enterprise Files path

The path of Erika Enterprise files inside your system should be wrote using the native format of your system. This means that under windows, it is a windows path even if everything is compiled using cygwin.

  • User value: Using the graphical interface, it is possible to override this default value, both for the whole workspace and for each single project.
  • environment : ERIKA_FILES is the environment variable where RT-Druid looks for Erika Enterprise path. Note that the old variable EE_BASE is deprecated, is not considered by RT-Druid and should be used only inside makefiles.
  • configuration files: the keyword erika_enterprise_location is used in the RT-Druid configuration file to set the path to Erika Enterprise files. Note that this path can be written using eclipse variables. The most useful is ${eclipse_home} because it allow to write a path relative to the eclipse installation directory.
Please note that, under windows, you can use both / and \ to separate paths but if you choose to use \ you have to protect them with another \. Here is an example:
erika_enterprise_location = C:\\Evidence\\ErikaEnterpriseFiles
  • plugins: By default, RT-Druid is configured to use Erika Enterprise files in com.eu.evidence.ee plugin (a component of RT-Druid distribution).

Priority and validity

Here is a table that compare priority and application of each method used to set Erika Enterprise files path. Elements with higher priority override those elements with lower priority.

What Priority GUI
support
Batch
support
Where When Description
User Value Highest X Project/workspace property
in Eclipse IDE
hardcoded in the project,
so it's always valid, even if the project
is shared among different instances of RT-Druid
Value set by the user in the project/workspace properties.
ERIKA_FILES High X X Environment is valid only in the current instance of RT-Druid Environment variable set before run RT-Druid.
erika_enterprise_location Middle X X defined in the configuration file
es. configuration/common_oil.pref (see also Common_oil.pref_example)
this value is a property of the installation
and then is available for all instances of this installation
Configuration of a particular installation of RT-Druid.
plugins Low X X set inside RT-Druid/Erika plugins RT-Druid distributions it is a feature of a specific RT-Druid distribution version

Examples

Environment

Windows (set environment variable)
set ERIKA_FILES=C:\Evidence\ErikaEnterpriseFiles
Linux (set environment variable)
ERIKA_FILES=/opt/Evidence/ErikaEnterpriseFiles
export ERIKA_FILES

Configuration file

Configuation file with eclipse variables (by default rtdruid_base_path/configuration/common_oil.pref)
# pointing to ErikaEnterpriseFiles directory relative to RT-Druid base directory
# this works with both windows and linux
erika_enterprise_location = ${eclipse_home}/../ErikaEnterpriseFiles
Configuation file with windows path (by default rtdruid_base_path/configuration/common_oil.pref)
# pointing to ErikaEnterpriseFiles directory using an absolute path (example 1)
erika_enterprise_location = C:/Evidence/ErikaEnterpriseFiles
Configuation file with windows path (by default rtdruid_base_path/configuration/common_oil.pref)
# pointing to ErikaEnterpriseFiles directory using an absolute path (example 2)
erika_enterprise_location = C:\\Evidence\\ErikaEnterpriseFiles


Configuation file with linux path (by default rtdruid_base_path/configuration/common_oil.pref)
# pointing to ErikaEnterpriseFiles directory using an absolute path
erika_enterprise_location = /opt/Evidence/ErikaEnterpriseFiles

RT-Druid Extension File path

The path of the rtdruid.ext file inside your system should be wrote using the native format of your system. This means that under windows, it is a windows path even if everything is compiled using cygwin.

  • User value: Using the graphical interface, it is possible to override this default value, both for the whole workspace and for each single project.
  • environment : RTD_EXT_PATH is the environment variable where RT-Druid looks for rtdruid.ext path.
  • configuration files: the keyword rtdruid_extension_location is used in the RT-Druid configuration file to set the path to the RT-Druid extension file. Note that this path can be written using eclipse variables. The most useful is ${eclipse_home} because it allow to write a path relative to the eclipse installation directory.
Please note that, under windows, you can use both / and \ to separate paths but if you choose to use \ you have to protect them with another \. Here is an example:
rtdruid_extension_location = C:\\Evidence\\rtdruid.ext
  • plugins: By default, RT-Druid is configured to use the rtdruid.ext file in com.eu.evidence.ee plugin (a component of RT-Druid distribution).

Priority and validity

Here is a table that compare priority and application of each method used to set Erika Enterprise files path. Elements with higher priority override those elements with lower priority.

What Priority GUI
support
Batch
support
Where When Description
User Value Highest X Project/workspace property
in Eclipse IDE
hardcoded in the project,
so it's always valid, even if the project
is shared among different instances of RT-Druid
Value set by the user in the project/workspace properties.
RTD_EXT_PATH High X X Environment is valid only in the current instance of RT-Druid Environment variable set before run RT-Druid.
rtdruid_extension_location Middle X X defined in the configuration file
es. configuration/common_oil.pref (see also Common_oil.pref_example)
this value is a property of the installation
and then is available for all instances of this installation
Configuration of a particular installation of RT-Druid.
plugins Low X X set inside RT-Druid/Erika plugins RT-Druid distributions it is a feature of a specific RT-Druid distribution version

Examples

Environment

Windows (set environment variable)
set RTD_EXT_PATH=C:\Evidence\my_rtdruid.ext
Linux (set environment variable)
RTD_EXT_PATH=/opt/Evidence/my_rtdruid.ext
export RTD_EXT_PATH

Configuration file

Configuation file with eclipse variables (by default rtdruid_base_path/configuration/common_oil.pref)
# pointing to RT-Druid extension file relative to RT-Druid base directory
# this works with both windows and linux
rtdruid_extension_location = ${eclipse_home}/../my_rtdruid.ext
Configuation file with windows path (by default rtdruid_base_path/configuration/common_oil.pref)
# pointing to RT-Druid extension file using an absolute path (example 1)
rtdruid_extension_location = C:/Evidence/my_rtdruid.ext
Configuation file with windows path (by default rtdruid_base_path/configuration/common_oil.pref)
# pointing to RT-Druid extension file using an absolute path (example 2)
rtdruid_extension_location = C:\\Evidence\\my_rtdruid.ext


Configuation file with linux path (by default rtdruid_base_path/configuration/common_oil.pref)
# pointing to RT-Druid extension file  using an absolute path
rtdruid_extension_location = /opt/Evidence/my_rtdruid.ext


Erika Enterprise Templates path

In additions to Erika Enterprise Templates, it is possible to specify additional directories. Where not specified, paths are expressed using the native formalism of your system. If you want to define more than one path, you can write each path separated by the default character for your system. Examples:

Windows example 1:   C:/Evidence/template_1;C:/Evidence/template_2
Windows example 2:   C:\\Evidence\\template_1;C:\\Evidence\\template_2
Linux example:   /opt/Evidence/template_1:/opt/Evidence/template_2

Please note that currently is only possible to add templates those provided by RT-Druid plugins, i.e. it is not possible to disable one or more template. It is possible to add templates providing path through:

  • environment : RTDRUID_TEMPLATES_PATH is the environment variable where RT-Druid looks for paths of additional Erika Enterprise Templates.
  • configuration files: the keyword templates_path is used in the RT-Druid configuration file to set the path of additional Erika Enterprise templates.
Please note that, under windows, you can use both / and \ to separate paths 
but if you choose to use \ you have to protect them with another \. Here is an example:
templates_path = C:\\Evidence\\ErikaEnterpriseFiles


If more than one template uses the same ID, the first one is used.
To reduce indeterminism RT-Druid will search inside paths provided by environment variable,
then the ones provided in configuration files and,
as last resource, the ones provided by RT-Druid plugins.

Examples

Environment

Windows (set environment variable)
set RTDRUID_TEMPLATES_PATH=C:\Evidence\ErikaEnterpriseTemplates
Windows (set environment variable)
set RTDRUID_TEMPLATES_PATH=C:\Evidence\ErikaEnterpriseTemplates\path1;C:\Evidence\ErikaEnterpriseTemplates\path2


Linux (set environment variable)
RTDRUID_TEMPLATES_PATH=/opt/Evidence/ErikaEnterpriseTemplates
export RTDRUID_TEMPLATES_PATH
Linux (set environment variable)
RTDRUID_TEMPLATES_PATH=/opt/Evidence/ErikaEnterpriseTemplates/path1:/opt/Evidence/ErikaEnterpriseTemplates/path2
export RTDRUID_TEMPLATES_PATH

Configuration file

Configuation file with windows path (by default rtdruid_base_path/configuration/common_oil.pref)
# Single path (example 1)
templates_path = C:/Evidence/ErikaEnterpriseTemplates
Configuation file with windows path (by default rtdruid_base_path/configuration/common_oil.pref)
# Multiple path (example 2)
templates_path = C:/Evidence/ErikaEnterpriseTemplates/path1;C:/Evidence/ErikaEnterpriseTemplates/path2
Configuation file with windows path (by default rtdruid_base_path/configuration/common_oil.pref)
# Multiple path (example 3)
templates_path = C:\\Evidence\\ErikaEnterpriseTemplates\\path1;C:\\Evidence\\ErikaEnterpriseTemplates\\path2


Configuation file with linux path (by default rtdruid_base_path/configuration/common_oil.pref)
# Single path (example 1)
templates_path = /opt/Evidence/ErikaEnterpriseTemplates
Configuation file with linux path (by default rtdruid_base_path/configuration/common_oil.pref)
# Multiple path (example 2)
templates_path = /opt/Evidence/ErikaEnterpriseTemplates/path1:/opt/Evidence/ErikaEnterpriseTemplates/path2

Generator OS target

By default, RT-Druid generates makefiles for the machine where RT-Druid is running. It is possible to force RT-Druid to generate for a different OS, using the property erika_enterprise_generation_platform

erika_enterprise_generation_platform=cygwin
erika_enterprise_generation_platform=linux


Generator properties paths

Each architecture requires few properties to generate the correct code/script to successfully compile it. A simple example is the path of the compiler.

Usually it is possible to set these values using the RT-Druid configuration file, or through IDE properties (both for the whole workspace and for a specific project). In few cases it can be set using environment variables.

The number of these properties follows the growing of Erika Enterprise v3, so few new properties may be added every time a new feature/porting is added to Erika Enterprise v3. So, the actual list, depends on the specific release of Erika Enterprise v3. The wiki page of each specific architecture/feature provides also the list of all properties related to that architecture/feature.

As example, Compiler Path section, of the AVR8 wiki page, explains how provide the compiler path to RT-Druid. So, this value can be used to configure the makefile.

Common_oil.pref

Here is an example of RT-Druid configuration file.