Welcome to the first unofficial AST (Abstract Syntax Tree) for Gradle build scripts! If you’ve ever been stifled by the thought, "Why decide the DSL before crafting my build script?", you’re about to experience liberation.
Gone are the days of choosing your DSL (Groovy or Kotlin) first. With this project, immerse in the semantics of your build script first, and then let the project decide which language to output it in.
-
📜 Write your Gradle build script using an AST.
-
🔄 Convert the AST into:
-
Kotlin DSL
-
Groovy DSL
-
Binary plugin class (Kotlin, Groovy, or Java).
-
-
🎯 Ideal for:
-
Creating functional tests targeting both DSLs.
-
Building opinionated code blocks:
plugins
,pluginManagement
,buildscript
. -
Designing standout init project templates.
-
Caution
|
🚫 Limitations We’re Addressing:
|
Important
|
We aren’t looking to replace Groovy or Kotlin parsers. And while we don’t support every Groovy/Kotlin feature, complex build scripts are best written as binary plugins. |
-
Genesis: Birthed from Nokee’s requirements, inspired by the Gradle init module and Cedric’s adventures in Gradle’s dependency realm.
-
Toddlers: V1? Super basic. V2? Found its place in Nokee, but craved more flexibility.
-
Teen Years: V3 showcased a nascent Gradle AST: Groovy DSL, Kotlin DSL, and binary plugins (Java 8/11 compatible).
-
Experimentation: V4 tinkered with intercepting the Gradle API for the AST. An ambitious feat, but alas, too complex.
-
Coming of Age: V5 embraced Groovy DSL literals, parsed to form the Gradle AST. The future? We’re building on this!
We’re now at a stage where this project aptly serves myriad projects. However, growth never stops. We’ll keep evolving.