Scaffold - Generators


Generators are C++ classes, either build inside the program or provided as plug-ins.

Each project may host variables that may be manipulated using regular commands. To indicate that a generator variable is being referenced/manipulated use GEN:: before the name of the variable:

1 SET GEN::VAR1 some value

When a file is about to be generated the generator checks if that file doesn't already exist. If it does, the generator will apply the overwrite policy in effect; this policy is set for current generator using the commands listed below:

  • EXISTING OVERWRITE to overwrite existing file
  • EXISTING KEEP to keep existing file
  • EXISTING BLEND to blend the changes with existing file; in this case the content of the existing file is preferred;

A number of variables are initialised for each generator (see below) and each generator in turn may define additional specific variables that are documented in their page.

List of predefined variables:

the name of the generator. It is extracted from the GEN command.
Scaffold does not use this variable internally.
The list of templates that were added using TEMPL command.
Each entry is a full path.
Fully qualified path of the destination directory. It is initially set up to the output path of the project.
Only first entry is used by scaffold.

Related source code documentation: