Code generation is done on a per-package basis.

The code generator generates code for every class/struct/interface/enumeration and its behaviors of the package and its sub packages.

To setup a package for code generation use the LL Embedded Stereotype and set the GenSrcDir and GenerationLanguage Tagged Values.

Version 2.6

You can select either the LL Embedded flagged package or any of it subpackages (on all levels) for code generation.

The Embedded Engineer will generate code only for the selected package and its subpackages, but the directory stucture and all settings will be resolved to fit. 

GenerationLanguage

(available since version 2.5)

Tagged Value allowing you to sepcify the code generation languages which will be generated.

Currently available:

  • C++
  • AnsiC

(available since version 3.0)

Can be set on any package level and will be considered during generation. 

GenSrcDir

Tagged Value to control in which directory the code generator writes the output files.
If you don't specify this value, or if the specified directory does not exist, the code generator will ask you interactively for a directory.


Enterprise ArchitectMagicDraw

Open the Tagged Values for the package and select the LL Embedded::GenerationLanguage & LL Embedded::GenSrcDir Tagged Value from the "new Tagged Value list"

Open the properties dialog of the package, go to Tags and select the Embedded Engineer Profile

Set the GenSrcDir and the GenerationLanguage Tagged Value.

LL Embedded Stereotype

By using the LL Embedded Stereotype the package will automatically receive all necessary Tagged Values for code generation.

Local paths

(only for Enterprise Architect)

Since the first version of Embedded Engineer Enterprise Architect local paths where supported (see: embedded_engineer_examples.eap).

These paths can be set via the Configure Local Paths dialog in Enterprise Architect.

Enterprise Architect Ribbon

Code > Configure > Options > Configure Local Paths

(see: Local Paths Enterprise Architect - Local Paths Dialog)

Relative paths

(available since version 2.2)

New in version 2.2 is the support of  relative paths in the GenSrcDir tagged value.

This relative path can be combined with a localpath. 

If a "pure" relative path is provided the Embedded Engineer will use the path of the EAP-Project file as the working directory.

Examples:

GenSrcDir valueresulting generation pathavailability
%GuessingGameSrcGen%C:\Users\[youruser]\Documents\LieberLieber\EmbeddedEngineer22\Examples\GuessingGame_VC++\GuessingGame_VC++\GeneratedEnterprise Architect only
.\GuessingGame_VC++\GuessingGame_VC++\myGenFolderC:\Users\[youruser]\Documents\LieberLieber\EmbeddedEngineer22\Examples\GuessingGame_VC++\GuessingGame_VC++\myGenFolderEnterprise Architect & MagicDraw
%GuessingGameSrcGen%\..\C:\Users\[youruser]\Documents\LieberLieber\EmbeddedEngineer22\Examples\GuessingGame_VC++\GuessingGame_VC++\Enterprise Architect only
%GuessingGameSrcGen%\..\myGenFolderC:\Users\[youruser]\Documents\LieberLieber\EmbeddedEngineer22\Examples\GuessingGame_VC++\GuessingGame_VC++\myGenFolderEnterprise Architect only

(all provided examples are working on the assumption the eap file path is: C:\Users\[youruser]\Documents\LieberLieber\EmbeddedEngineer22\Examples\embedded_engineer_examples.eap)

See also

Stereotypes & Tagged Values

  • No labels