A modified version of Gradle with added useful features. As someone who frequently works with Gradle during the development process, I have encountered many minor frustrations along the way. That's why there's a fork here 🤷♂️
Important
This is an opinionated Gradle distribution that may not be suitable for everyone. If you have no complaints about the Gradle version you are currently using, there is no need for you to continue exploring this project :)
- Background - What's this?
- Features - What's the difference from Gradle?
- Installation - How to use it?
- Compatibility - Support the Gradle ecosystem?
- Versioning - Following upstream updates?
- License - What license?
- Acknowledgments
This is a Gradle distribution called Cradle, which provides a set of modifications aimed at eliminating repetitive boilerplate code. If you play a lot with Gradle scripts, you're probably familiar with how much repetitive boilerplate code we often have to write 😵💫
Ah! Are you curious about why it's named Cradle? The inspiration for this name comes from the initial naming idea of the Gradle project by its founder, so I adopted it. Interestingly, he took the "G" from Groovy, while I took the "C" from my own ID. So, it's a playful "git revert
" 😄
In Cradle, you can do:
dependencies {
implementationOf(
"com.example:library:1.0.0",
"foo.bar:common:0.1.0",
"a.b:c:0.1.0" config {
isTransitive = true
},
)
}
Instead of the verbose approach in Gradle :
Click to see the equivalent code in Gradle.
dependencies {
implementation("com.example:library:1.0.0")
implementation("foo.bar:common:0.1.0")
implementation("a.b:c:0.1.0") {
isTransitive = true
}
}
Note
This shorthand is implemented by automatic generation to support any registered plugin configuration. For instance, if you have the kapt
plugin, you can utilize kaptOf
in a similar way. Likewise, other plugins such as ksp
offer kspOf
, and shadow
provides shadowOf
, and so forth.
In Cradle, you can do:
dependencies {
implementation(libs.plugins.test)
}
Instead of the verbose approach in Gradle :
Click to see the equivalent code in Gradle.
dependencies {
val plugin = libs.plugins.test.get()
implementation("${plugin.pluginId}:${plugin.pluginId}.gradle.plugin:${plugin.version}")
}
In Cradle, you can do:
dependencies {
implementation("com.abc:efg:0.1.0") { exclude(libs.utils) }
}
Instead of the verbose approach in Gradle :
Click to see the equivalent code in Gradle.
dependencies {
val utils = libs.utils.get()
implementation("com.abc:efg:0.1.0") {
exclude(group = utils.group, module = utils.name)
// or exclude(group = "my.test.library", module = "group")
}
}
Switching the Gradle to Cradle distribution in your project is a straightforward process. Simply run the following command in the root directory of your project:
./gradlew wrapper --gradle-distribution-url=https://github.com/meowool/cradle/releases/download/v8.3.0.1/cradle-v8.3.0.1-bin.zip
This command will update the distributionUrl
property in the gradle/wrapper/gradle-wrapper.properties
file of your project to point to the download link of the latest release of Cradle. Alternatively, you can manually update this property if you prefer.
If you wish to use a different version of Cradle, simply modify the link after
--gradle-distribution-url=
to one of the available download links provided below:Click to see all available builds of Cradle.
Version Download Links SHA-256 Checksums v8.3.0.1 - https://github.com/meowool/cradle/releases/download/v8.3.0.1/cradle-v8.3.0.1-bin.zip
- https://github.com/meowool/cradle/releases/download/v8.3.0.1/cradle-v8.3.0.1-all.zip- bin: PLACEHOLDER
- all:PLACEHOLDER
Note: If you'd like to use a bleeding edge nightly build version, please visit the Actions ↗ page to find the latest build and manually copy the download link for its artifact.
Important: For information on the relationship between Cradle versions and Gradle versions, please refer to Following upstream updates?
Yes, absolutely! Cradle is just a fork of Gradle, which means it is fully compatible with the Gradle ecosystem. After switching to Cradle, you can continue to enjoy all the benefits and features provided by the Gradle ecosystem without any limitations.
TODO
Sure! Our goal is to stay up-to-date with the latest changes from the Gradle project. While we strive to align our updates with the upstream repository, please note that Cradle is an independent distribution and may not always sync immediately with new upstream releases. In the worst case, it may take a few working days to catch up 😢. However, this is rare as Cradle syncs frequently thanks to our bot! It merges changes within hours of a new Gradle version release, ensuring timely releases based on the latest upstream changes!
Note
You may have noticed that the Cradle and Gradle versions are very similar, but the fork version has an additional version component at the end, such as Gradle version 8.3.0
and Cradle version 8.3.0.1
. This additional component is used to indicate the patch version of this fork.
Cradle like Gradle, also uses the Apache-2.0 license as its project license.
- Poe ChatGPT for the excellent README, which was largely written by it.
- Ideogram AI for providing the inspiration for the project's logo through its generated sketches.
- Gradle for providing an excellent build tool that I use every day :)