Setup for Build and Run

Return to Introduction  Previous page  Next page

In Enterprise Architect, any package within the UML Model can be configured to act as the 'root' of a source code project. By setting compilation scripts, xUnit commands, debuggers and other configuration settings for a package, all contained source code and elements can be built, tested or debugged according to the currently active configuration. Each package can have multiple scripts, but only one is active at any one time. The Package Build Scripts dialog enables you to create and manage those scripts.

To access the Package Build Scripts dialog, select the Project |  Build and Run | Package Build Scripts menu option. Alternatively, right-click on a package in the Project Browser window, and select the Build and Run | Package Build Scripts menu option.

PackageBuildScripts
 

Scripts are assigned to packages, and although a package might have only one active script at any time, you can assign multiple scripts and select from them as required. The Package Build Scripts dialog shows which script is active for the current package, and whether or not the script contains Build, Test and Run components

·To create a new script, click on the Add button; the Build Script dialog displays
·To modify an existing script, highlight the script name in the list and click on the Edit button
·To copy a script with a new name, highlight the script name to copy and click on the Copy button; Enterprise Architect prompts you to enter a name for the new copy. Enter the new name in the dialog and click on the OK button. The new copy appears in the list and can be modified as usual.
·To delete a script, highlight the script name to delete, click on the Delete button, and click on the OK button.
·To export your scripts, click on the Export button to choose the scripts to export for this package.
·To import build scripts, click on the Import button to choose a .xml file of the scripts to import.

The Default Language field enables you to set the default language for generating source code for all new elements within this package and its descendents.

Select the Use Live Code Generation checkbox to update your source code instantly as you make changes to your model.

Select the Package is Namespace Root checkbox to set the source code namespace root (ie. Java/C# namespace) to be the current package. Once you have set a namespace root, code generated beneath this root adds a package declaration at the head of the generated file indicating the current package location.

Click on the All Package Scripts button to open a new window that displays all scripts in the current project (see next topic Managing scripts).

Once you have created new scripts or made any changes to existing ones, click on the OK button to confirm the changes, otherwise click on the Cancel button to quit the Package Build Scripts dialog without saving any changes.