The build language of MPS is quite complicated and not at all comfortable to use. However, it is here to stay for the foreseeable future so it might be useful to learn some tricks.

The build language is generated to Ant via an intermediate, lower-level workflow language (jetbrains.mps.build.workflow). This language represents Ant build files that can be split among several root nodes and weaved together by the generator to produce the final Ant XML file.

The build language provides an “escape hatch” to include a piece of the workflow language in the higher-level build language script, in the form of the “workflow” aspect that can be added at the very bottom of the build script:

One way the workflow aspect can be used is to add extra Ant targets to the generated Ant scripts.

For example, here is an embedded workflow defining an Ant target to concatenate files in a directory:

And this is the code that is generated from it:

Of course, if your CI build is using Gradle then the Gradle build script is a much better place for these kinds of tasks. With Maven the POM files are more rigid and verbose and in that case an Ant task in the build file might just be a better solution.