Target Configuration Management and Cleanup

Related to building a TC is the ability to clean it. Cleaning a TC can be done in two ways:

  1. By removing the entire target project for the TC. All files that were generated when building the TC will be deleted, both source files and binaries.

  2. By cleaning the target project for the TC. This removes all files (typically binaries) that were produced when building the target project. But the target project itself and the source files it contains will not be deleted.

To clean a TC invoke the ”Clean…” command in its context menu. The following dialog will appear:

When you press OK all selected TCs (and their prerequisite TCs, both direct and indirect prerequisites) will be cleaned by removing their target projects. If you want to keep the target projects and generated source files and just clean the binaries, you can mark the checkbox "Clean binaries only". Then the TCs will be cleaned by cleaning their target projects. For a target project that has a generated makefile this means that make clean will be called on that makefile.

Note that in order to clean an external project, the "Clean command" property of its TC has to be set. Otherwise Model RealTime does not know how to clean an external library, and you have to do this manually (for example by cleaning the CDT project that builds the external library, or to invoke make clean on its makefile).

If, for some reason, the target project of a TC does not exist in the workspace, but it exists on the file system, then a dialog will appear when cleaning the TC:

If you answer Yes, the target project folder will be deleted from the file system. If the target project contains subfolders there will popup one such dialog for each subfolder. To apply the same choice to all subfolders (either delete the subfolders or keep them) you can mark the checkbox to remember your decision before you press the Yes or No button.

In the Clean dialog there is also an option "Build selected transformation configuration after clean". If you select this option then the selected TC will be built immediately after the cleaning is finished.

In the context menu of an RT model project there is a command "Clean transformation configurations…" which can be used in order to clean all active TCs in that project. The same dialog as shown above will appear, and each active TC will be marked to become cleaned.

The clean command is also available as a menu choice in the ”Build Active Transformation Configuration” button menu.

From here it will clean the active TC (the one with a checkmark in front of it). If the button has been locked to a project the clean command will clean the active TC in that project. If there is no active TC set a dialog will popup to let you specify which TC to activate and clean.

As can be seen in the picture above the "Clean transformation configurations" command is also available in this menu. It is useful to invoke it from here when you want to clean TCs from many or all of the projects in the workspace. This is more convenient than to select all the projects in the Project Explorer and then invoke the command from the context menu.

As discussed in Alternative Ways to Trigger an Interactive Build Eclipse provides a common user interface for performing build of projects. The conclusion there was that this common user interface provides no benefits compared to building TCs directly using the ”Build Active Transformation Configuration” button. In the same way Eclipse provides a common user interface for cleaning (Project – Clean…). If you attempt to clean an RT model project using this user interface nothing will happen.

You can quickly clean the whole workspace by using the Remove All Generated Projects toolbar button or selecting the command File - Remove All Generated Projects. It will remove all generated target projects from the workspace and delete them from the file system.