Customizing directory structure for generated code

The code generation mechanism provides a number of options for customizing the directory structure for the generated code. This includes both the ability to specify the output directory for code generation, as well as the ability to specify the directory structure within the output directory.

Specifying the output directory for generated code

The code generation mechanism uses the components and configurations you have created in order to determine where code should be generated.

By default, all files are generated in the directory that represents the configuration for which code is being generated. To have code generated to a different directory:

  1. Open the Features window for the relevant component.
  2. On the General tab, use the Directory field to specify the directory to which you want the code to be generated. You can enter a relative path (beneath the directory that contains your model), or an absolute path.

Specifying the directory structure within the output directory

You can use one or both of the following properties to control the directory structure used for generated code within the output directory:

Note: If these standard options are not sufficient to create the directory structure you want for code generation, Rational® Rhapsody® also provides an option to map individual model elements to specific output files and to map individual output files to specific directories. For more details, see Rational Rhapsody code generation: mapping elements to files and mapping files to folders.

Feedback