At Gradle, part of our vision is to provide an elegant and extensible declarative build language that enables expressing any build in a clear and understandable way. We are working on Declarative Gradle to realize that part of the vision. This is an experimental project, stay tuned for updates!
Learn more in the Declarative Gradle Announcement blog post and other publications.
Declarative Gradle is an experimental project, now in its second Early Access Preview (EAP). We invite you to try out Declarative Gradle, and to share feedback. The project includes the following experimental parts:
Currently, no compatibility is guaranteed, and there is no commitment to the DSL syntax and available features. Learn how you can contribute in the Participate section.
We implement those principles through a declarative DSL which is a tailored tiny subset of the Kotlin language. The Declarative Gradle Announcement outlines more details about the project and the new Declarative DSL we are building.
Here is a very brief example of what the Declarative Gradle syntax looks like for a Java application.
javaApplication {
javaVersion = 21
mainClass = "com.example.App"
dependencies {
implementation(project(":java-util"))
implementation("com.google.guava:guava:32.1.3-jre")
}
}
Looks familiar, right?
As noted above, this syntax is experimental and might change during the experiment.
The Declarative Gradle experiment is still in an early stage but is ready for your feedback!
We invite you to try out Declarative Gradle, and to share your feedback.