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:
- Software Types as a declarative modeling framework
- Changes in Gradle to support DCL files
- Changes in Android Studio and IntelliJ IDEA to support DCL files
- A Visual Studio Code extension to support DCL files
- An Eclipse IDE plugin to support DCL files
- Prototype plugins demonstrating software types and higher-level models
- A Gradle test client demonstrating features not yet implemented in the IDE
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.
Share Your Feedback- Ease of use for regular software developers. Software developers should be able to define any software and build their projects without the need to understand the details of how the build system works.
- Complete flexibility for build engineers and advanced users. Experienced Gradle users should maintain the current level of flexibility and be able to automate a wide range of software build automation scenarios with custom build logic.
- Excellent IDE integration. Importing the software project to the IDE and interacting with it should be fast and fully reliable. IDEs and other tools should be able to change the definition automatically or through UI reliably.
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!
- Getting Started - Learn how to try Declarative Gradle yourself.
- Documentation - Learn about the fundamentals behind Declarative Gradle.
- Participate - Learn how you can help shape the future of Declarative Gradle.
- Resources - Learn more from conferences, interviews, articles, etc.
We invite you to try out Declarative Gradle, and to share your feedback.