Build Config
Table of Contents
Overview
The Actifsource BuildConfig acts like a make file. It tells Actifsource which build tasks shall be executed. The most important build task for code generation is the TemplateGeneratorTask.
New BuildConfig
You can create a new build configuration via context menu in the project explorer or File/New.
Actifsource suggests adding templates to the build configuration which are not assigned to any other build configuration yet.
For every selected template, Actifsource creates a so called a TemplateGeneratorTask as shown below.
BuildConfig and TargetFolder
Build configurations have to be registered with target folders to take any effect (see also Chapter 2.5.3 Target Folder and Chapter 2.6 Project Properties).
Output Encoding
For every build configuration you may select the output encoding.
If no output encoding has been set, the one from the parent build configuration (see also Chapter 7.6.2 NestedBuildConfigGeneratorTask), folder, parent folder, project, or workspace is taken (in this order).
Check Properties/Resource/Text file encoding on folder or project.
Check Window/Preferences/General/Workspace/Text file encoding on workspace.
Line Break
For every build configuration you may select the line break style.
If no line break has been set, the one from the parent build configuration (see also Chapter 7.6.2 NestedBuildConfigGeneratorTask), project, or workspace is taken.
BuildTask
The build configuration lists all build tasks. Build tasks are executed in the order as listed. There are different types of build tasks. The most important one is the TemplateGeneratorTask.
Template Generator Task
The template generator task defines which templates have to be built.
-
Template References the template.
-
Omit File Id Actifsource normally inserts an id at the end of every generated file. This file id helps identify and track generated code.
The Actifsource ID is assembled as follows.
/* Actifsource ID=\[TemplateGUID,SuperContextGUID\*,BaseContextGUID,MD5Hash\] */
Element Descriptiom Comment Tags The comment tags (i.e. /* */) are given by the language Actifsource ID Static identifier TemplateGUID GUID of the template which created this file SuperContextGUID GUID of the resources which contains the base resource BaseContextGUID GUID of the base resources of this file MD5Hash A hash code over the generated code but not including protected regions to detect if the generated code has been changed manually. To ignore white spaces when building the MD5 hash check Chapter 2.5.3 Target Folder.
Note that you can open the resource for any GUID in an Eclipse text editor or in the Eclipse console by Ctrl+Click on the GUID.
NestedBuildConfigGeneratorTask
The nested build configurator task let you reference and execute existing build configurations.
- Build Config References any existing build configuration.
- Target Sub Path Defines a sub path to the target folder (see also Chapter 2.5.3 Target Folder).
CopyTask
Copies a file or a folder to a specified target path. Please note that this tasks needs a built-in dependency to WORKSPACE (see Chapter 2.5.6 Built-in Dependencies).
- Resource The file or folder to copy. There are different resource types.\
Resource Type | Description |
---|---|
BundleResource | File or folders found in a bundle (plugin project). |
OutputScopeResource | File or folders found in the target folder. |
TemplateScopeResource | File or folders found in the template folder. |
WorkspaceResource | File or folders found in the workspace. |
- Recursive All subfolders are copied if set to true.
- Merge Duplicate Folders When enabled, the generator allows merging content from different folders into one folder. Otherwise an error will occur.
- Target The target to copy the files or folders. There are different target types.\
Target Type | Description |
---|---|
ResourcePathTarget | Target path relative to copied resources. |
ZipTarget | File and folders are copied into a zip file. |
DeleteFolderTask
Deletes the specified folders relative to the target folder. Please note that this tasks needs a built-in dependency to WORKSPACE (see Chapter 2.5.6 Built-in Dependencies).
- Path A path relative to the target folder.
ExecuteProcessBuildTask
Executes any process on your operating system. Please note that this tasks needs a built-in dependency to WORKSPACE (see also Chapter 2.5.6 Built-in Dependencies).
To execute a shell command on windows, choose cmd as shell command, /c as first argument, and your shell command and parameters as subsequent arguments.
- Directory Directory to execute the process relative to the target project.
- Command The command (without arguments) to execute.
- Argument The arguments of the command.
GraphvizBuiltTask
Runs the graphviz dot command on all .dot files in the target folder. Please note that this tasks needs a built-in dependency to GRAPHVIZ (see also Chapter 2.5.6 Built-in Dependencies).
Make sure that you have graphviz installed (see www.graphviz.org) and reachable in your path.
-
Styleheet A css stylesheet if needed.
-
Adapt Size If set to true, the generated diagram's width is set to 100%.
Eclipse Builder
Eclipse supports so called Builders to build anything. In C/C++ there is the CDT Builder to build executables and libraries from header and source files. In Java there is the Java Builder to build .class files from .java files.
In Actifsource there is the Actifsource Builder to generate code from the model (.asr
files).
Make sure that the builders are arranged in the correct order. You will find the settings in Project/Properties/Builder.