name: mps-build-language
description: >-
Use when authoring or modifying MPS Build Language scripts (BuildProject roots) — the declarative DSL that generates Ant build.xml to package MPS language plugins, IDEA plugins, plain Java modules, standalone IDE/RCP distributions, module tests, or run code from solution tasks. Covers build solution setup, macros, project/external/Java dependencies, MPS module declarations (BuildMps_Language / _Solution / _Generator), groups, layouts, IDEA-plugin declarations, MPS settings, and the workflow language. Trigger terms: BuildProject, BuildMps_*, BuildLayout_*, jetbrains.mps.build, build.mps solution, internalBaseDirectory, compactBuildScriptFileName, Ant target generation, mps_home, idea_home.
type: reference
MPS Build Language
The MPS Build Language is a declarative DSL (a stack of MPS languages on top of Ant) that generates an Apache Ant build.xml file. It is used to package MPS-language plugins, build standalone IDE/RCP distributions, package plain Java modules, and run MPS tests or generation-diff tests. Build scripts are root nodes of concept BuildProject inside a regular solution module; pressing Make on that solution runs a generator that writes build.xml to disk.
Critical Directives
- The generator writes
build.xml— it does not invoke Ant. To produce artifacts you must runantseparately (from MPS right-click → Run, or from the command line in the generated folder). - Build scripts are MPS nodes. Edit them via projectional editing or
mps_mcp_*JSON tools. Never hand-edit the.mpsfile as if it were Ant XML. - Declaring a module in
BuildProject.partsdoes not cause it to be built. Only items referenced from thelayoutend up in the output.partsis declaration;layoutis packaging. - Build scripts compile languages but do not regenerate them. Generate languages to Java first (or enable the
mpsbuild plugin's full-make task) before running Ant. - Always import
jetbrains.mps.ide.build(422c2909-59d6-41a9-b318-40e6256b250f) on the build solution — it is the catalog of well-known externals (IDEA,mps,mpsStandalone, JDK, MPS modules). - After every change to a module's
.mpl/.msd, re-run the Load required information from file intention on the matchingBuildMps_*node. Build-script module dependencies must match the actual.mpldeclarations or the chunk generator throws "class not found". - A
BuildMps_Groupmust contain the transitive closure of language dependencies. Missing members appear as red squiggles at generation time. - Always set
internalBaseDirectory— every relative path is resolved against it.
Common-Path Workflow
For a typical "package an MPS language as an installable plugin" task:
- Create the build solution. A regular solution (not language) named
<project>.build. In its.msd, add a dependency onjetbrains.mps.ide.buildand declare languagesjetbrains.mps.buildandjetbrains.mps.build.mps. Set Java facetcompile="mps" classes="mps". Seereferences/solution-setup.md. - Create the model (conventionally
<project>.build) with the same languages as used languages. - Insert the
BuildProjectroot withname,internalBaseDirectory,compactBuildScriptFileName. Usemps_mcp_insert_root_node_from_jsonwith the skeleton inreferences/buildproject-skeleton.md. - Add plugins to
BuildProject.plugins: at minimumBuildJavaPluginandBuildMPSPlugin. AddBuildModuleTestsPlugin/BuildSolutionRunnerPluginonly when needed (seereferences/plugins-and-macros.md). - Declare macros (
mps_home, optionallyidea_home, plus version/timestamp Var macros) — seereferences/plugins-and-macros.md. - Add external dependencies to
BuildProject.dependenciesformps(ormpsStandalone) andIDEA, wired to macro paths — seereferences/dependencies.md. - Add parts: one
BuildSource_JavaOptions, then aBuildMps_Language/_Solution/_Generatorper MPS module (call Load required information from file on each), wrapped inBuildMps_Groups. Add aBuildMps_IdeaPluginwhosecontentreferences the groups. Seereferences/mps-modules.mdandreferences/idea-plugins.md. - Define the layout: one
BuildLayoutroot, typically wrapping aBuildLayout_Zipnamed<plugin>.zip, with oneBuildMpsLayout_Plugin(AutoPluginLayoutType) per plugin. Seereferences/layouts.md. - Make the build solution (Ctrl-F9 on the model) — this writes
build.xmlatinternalBaseDirectory/compactBuildScriptFileName. - Run Ant from MPS (right-click
BuildProject→ Run) orant -Dmps_home=/path/to/MPS …from the generated folder. Artifacts land in./build/artifacts.
For other task families: standalone IDE distributions → references/standalone-ide.md; plain Java packaging → references/java-parts.md; tests → references/tests-and-workflow.md.
Disambiguation — Don't Conflate These
Four "dependency" concepts and two "aspect" concepts are routinely confused. See references/disambiguation.md for the full table before designing dependencies or parts. Quick rule:
- Solution
.msddeps = what the build solution itself needs at edit time (justjetbrains.mps.ide.build). BuildProject.dependencies= references to other build scripts or external layouts (mps,IDEA).BuildSource_JavaModule.contentdeps = classpath of a plain Java module.BuildMps_*.dependencies= mirror of the actual.mpl/.msd, auto-filled by Load required information from file.
Related Skills
mps-distribution-build— the generated Ant pipeline (build/mps*.xml) that builds MPS distributions; complements this skill for bundling plain Java/Kotlin plugins into MPS.mps-ide-plugin— authoring the contents of an MPS/IDEA plugin (actions, tool windows, keymaps). The build language packages the result.mps-aspect-accessories— module dependencies, used languages, runtime solutions, accessory models. The build script'sBuildMps_*deps must match these.mps-lang-core-xml— needed when embedding raw XML forplugin.xmlenrichment, custom plugin.xml, orBwfAntStatementraw Ant commands.mps-tests—NodeTestCase/EditorTestCasetest models thatBuildAspect_MpsTestModulesruns.mps-mcp-workflow,mps-node-editing— node creation and validation conventions used by everymps_mcp_*example here.
Reference Index
- Open
references/solution-setup.mdwhen creating the build solution and model —.msdcontent, Java facet settings, used languages, naming conventions, where to find existing build scripts in this repo. - Open
references/buildproject-skeleton.mdwhen inserting or modifying theBuildProjectroot — JSON skeleton, top-level properties (name,internalBaseDirectory,compactBuildScriptFileName), the role → XML-id table forplugins/macros/dependencies/parts/layout. - Open
references/plugins-and-macros.mdwhen adding build-language plugins or macros —BuildJavaPlugin/BuildMPSPlugin/BuildModuleTestsPlugin/BuildSolutionRunnerPlugin,BuildFolderMacro,BuildVariableMacroinitializers (InitWithString,InitWithDate,InitWithPropertyFile,InitWithFileContent),BuildStringcomposition. - Open
references/dependencies.mdwhen wiring inter-script dependencies —BuildExternalLayoutDependency(external prebuilt artifacts likeIDEA,mps) vsBuildProjectDependency(sibling build scripts), how to point at named layouts injetbrains.mps.ide.build, when to omit artifact paths. - Open
references/mps-modules.mdwhen declaringBuildMps_Language/BuildMps_Solution/BuildMps_Generator— minimal JSON, child roles (path,sources,dependencies,runtime,generator), dependency wiring viaBuildMps_ExtractedModuleDependency, thecompact=trueconvention, Load required information from file intention, common target modules injetbrains.mps.ide.build. - Open
references/groups.mdwhen grouping modules viaBuildMps_Group— group semantics, transitive-closure rule, when to nest modules inside a group vs leave them atpartslevel. - Open
references/idea-plugins.mdwhen declaring or packaging an IDEA plugin —BuildMps_IdeaPluginpart vsBuildMpsLayout_Pluginlayout entry, fields (id,name,version,containerName,content,dependencies), the threeplugin.xmlstrategies (synthesize / enrich / custom),AutoPluginLayoutTypevsManualPluginLayoutType. - Open
references/layouts.mdwhen shaping the output tree — every layout concept (BuildLayout_Folder/_Zip/_Jar/_File/_Fileset/_ImportContent/_CopyOfContainer,BuildMpsLayout_ModuleJar,BuildMpsLayout_Plugin,BuildLayout_IdeaPlugin), thecontainerNamepattern, typical MPS-plugin layout, plain-Java packaging example. - Open
references/java-parts.mdwhen building plain Java modules or libraries —BuildSource_JavaOptionsproperties (compiler, javaLevel, heap, resource selectors),BuildSource_JavaModulewith content roots and dependencies,BuildSource_JavaLibrarygrouping,BuildSource_JavaDependencyJar/_OnModule/_OnLibrary. - Open
references/mps-settings.mdwhen configuringBuildMpsAspect—bootstrapflag,testGeneration(thegentestAnt target plus Test.Generating / Test.Diffing),generationMaxHeapSizeInMB. - Open
references/tests-and-workflow.mdwhen adding module tests or custom Ant statements —BuildAspect_MpsTestModules,BuildMps_TestModuleGroup,BuildMps_TestModule,BuildMps_RunCodeFromSolution, thejetbrains.mps.build.workflowlanguage (BwfTask,BwfSubTask,BwfAntStatement,BwfTaskPart). - Open
references/standalone-ide.mdwhen producing a standalone IDE / RCP distribution —mpsStandalone, branding, startup script, two-stage build, JBR lookup order on Windows/Linux/macOS, trust-dialog suppression, Tips and Tricks integration. - Open
references/disambiguation.mdwhen confused about "dependency" or "aspect" terms — the four "dependency" meanings, "language aspect" vs "additional aspects / parts" vsBuildMps_IdeaPluginvsBuildMpsLayout_Plugin, "project structure" UI tree vs the docs' "project structure section". - Open
references/ant-targets.mdwhen debugging or extending the generated Ant build — every target the generator emits (compileJava,processResources,classes,test,check,generate,cleanSources,declare-mps-tasks,makeDependents,gentest), generation chunks, why dependency mismatches cause "class not found". - Open
references/concept-catalog.mdwhen looking up concept FQNs and XML ids — full table of concepts underjetbrains.mps.build,jetbrains.mps.build.mps,jetbrains.mps.build.mps.tests,jetbrains.mps.build.mps.runner,jetbrains.mps.build.workflow, with role → XML-id pairs for raw.mpsreading. - Open
references/common-failures.mdwhen a build script misbehaves — generator complains about missing dependencies; module compiles but is missing from output; "class not found" mid-generation; group missing transitive members;com.intellij.modules.mpsdependency missing;compiler="Eclipse"on Java 21+; hand-editedbuild.xmlreverted.