Skip to content

Automation

Embedded Engineer Automation is a CLI tool to bring code generation directly into your CI/CD landscape.

Usage of this tool requires a license seperate to EmbeddedEngineer.

Usage

Simply run the the EmbeddedEngineer.Automation.exe with the needed parameters.

Example

Example for a finished (basic) command: EmbeddedEngineer.Automation.exe --Model C:\TMP\TestData.eapx --PackageGuid {11DFDCFF-9B26-43D6-8422-1246A937D025} --TargetDir C:\TMP\generated --License C:\TMP\license.lic

This will generate the files for the package with the GUID {11DFDCFF-9B26-43D6-8422-1246A937D025} from the TestData.eapx model into the C:\TMP\generated directory.

Console Output:

Loading Model
EA Model
Searching selected package
Loading model data.
AnsiC generation language set.
Loading 'ExamplePackage' package and directory structure ({11DFDCFF-9B26-43D6-8422-1246A937D025})
Starting code generation for 'ExamplePackage' ({11DFDCFF-9B26-43D6-8422-1246A937D025})
Generating code for class 'Class1'. ({11DFDCFF-9B26-43D6-8422-1246A937D025})
Class code generation for class 'Class1' took 2389ms. ({11DFDCFF-9B26-43D6-8422-1246A937D025})
Code generation for package 'ExamplePackage' finished ({11DFDCFF-9B26-43D6-8422-1246A937D025})
Code generation finished in: 00:00:02.7797101 ({11DFDCFF-9B26-43D6-8422-1246A937D025})
2 files were generated.
Code generation completed without warnings.

User code

User code synchronization between model and file is not supported. By default the user code inside the file will be overwritten by the model user code when generating code.

Automation offers a CLI parameter (PersistUserCode) to be able to keep the code in existing files during code generation. In that case, changes in the model will not be reflected in the generated files.

Tip

You can run EmbeddedEngineer Automation with the help command/parameter to show the basic help menu

Tool Options & Exit Codes

CLI Parameters

Option Default Value Description Required?
Model - The the model from which to generate code from. Yes
PackageGuid - Root package for generation. Yes
TargetDir - Source code generation target directory. No
AbortOnError True Abort code generation if an error was found. No
AbortOnWarn False Abort code generation if a warning was found. No
License [WorkingDir], [WorkingDir]/licenses Path to licence (folder or file). No
PersistUserCode False If enabled, the user code in existing files will not be overwritten during code generation No
help/Help - Displays the help page No

Exit Codes

Exit Code Description
-1 Invalid CLI parameters
0 Ok - no errors
1 Generation aborted on error
2 Generation aborted on warning
3 License error (license might be missing or invalid)
4 Unknown error