As discussed in Dependency Management, when you make changes within a model, the Alf compiler normally automatically processes any Alf code that might be affected by these changes. However, in some cases the Alf compiler may not have enough information to realize that a change in the model will correct an error in previously erroneous Alf code. Or, you may have turned off the Build Automatically environment option, in which case the Alf compiler will mark elements needing recompilation without automatically recompiling them.
For cases such as the above, the Alf plugin provides two commands that allow you to manually trigger the recompilation of Alf code, which is known as doing an Alf build of your project. These commands are available by selecting Tools > Alf from the main menu.
- Build Project – A normal build triggers the recompilation of the Alf bodies of all model elements marked as having Alf compilation errors or otherwise needing to be recompiled.
- Clean Project – A clean build triggers the recompilation of all Alf code in your project, whether it is marked as needing recompilation or not.
Build Project
To initiate a normal build of your project, select Tools > Alf > Build Project. If there are any elements in your project that are marked with either an Alf compilation error annotation or an Alf recompilation-needed warning annotation (see Dependency Management), then the Alf bodies for these elements will be recompiled. Any previously erroneous Alf code that compiles successfully has its error annotation removed, while any code with new compilation errors has a new error annotation added. All recompilation-needed warning annotations are removed.
Clean Project
To initiate a clean build of your project, select Tools > Alf > Clean Project. This will result in the removal of all existing Alf annotations in your project and the recompilation of all Alf code. The Alf compiler will then add error annotations to any elements with Alf code that has compilation errors.