Repository navigation
5.0.0-m1
Pre-release
Pre-release
Xtext Gradle Plugins 5.0.0
Version 5.0.0 runs on Gradle 9 and supports the configuration cache, isolated projects and the build cache. Incremental builds regenerate only what a change affects, also when the change is in another project. Build scripts need a few changes, which the upgrade guide lists.
New features
Gradle 9
- The plugins run on Gradle 8.5 up to 9.9.3 without deprecation warnings.
- They support the configuration cache and isolated projects.
- Every setting is a lazy property, and the plugins only create tasks when a build needs them.
Incremental builds and the build cache
- The generated code can come from the build cache (#185).
- The generator keeps its index in a file. The build after a daemon restart or after a failed build is incremental as well.
- A change to a class or a model in another project only regenerates the sources that refer to it.
Models of other projects and libraries
- Each source set has a configuration for the projects and libraries whose models it refers to:
xtextModels,testXtextModelsand so on (#57). With the Java plugin, you do not have to name the projects that a source set depends on. See Referring to Other Projects. - This also works for projects with the
java-libraryplugin. - Publishing a Java library also publishes its models. For non-Java projects, you can publish the
xtextcomponent instead.
Java toolchains and error messages
- The generated code is for the Java version of the source set's Java compiler, and DSL files see the classes of that compiler's JDK.
- Validation issues are reported as
path:line:column: severity: message, which IDEs and CI tools recognize.
Breaking changes
The upgrade guide shows each change with the old and the new build script, in Kotlin and in Groovy.
- The plugins need Gradle 8.5 or newer, Java 21 or newer for the JVM that runs Gradle, and Xtext and Xtend 2.40 or newer. Xtend is published in the
org.eclipse.xtextgroup since 2.40. - The types of the DSL moved from
org.xtext.gradle.taskstoorg.xtext.gradle. - Extra source folders go into
sources.srcDir. Output folders are directory properties. - The source installer is an enum, with
SMAPas the default of every language, andNONEwas removed. The Java version of the generated code is a number. - The configurations with Xtext and the languages of a source set are named like those of the Java plugin.
xtextLanguagescan no longer be resolved. - The plugin no longer searches external libraries on the compile classpath for DSL files. Libraries with DSL files go into
xtextModels. - Xtend runs active annotations only from the annotation processor path. Libraries with active annotations go into the
annotationProcessorconfiguration, see Active Annotations. - The Java version of the generated code and the JDK that DSL files see come from the Java compiler of the source set.
- Only Buildship is supported for Eclipse, not
gradle eclipse. - Some methods that language plugins used were removed.