Basically, the Gradle version is fixed with a wrapper. If you want to change it, check the version at https://services.gradle.org/distributions/ and manually rewrite gradleVersion and gradle-wrapper.properties. .. .. No, no, I always want to get the latest version! For those who say.
build.gradle
import groovy.json.JsonSlurper
wrapper {
doFirst {
def versionService = new URL('https://services.gradle.org/versions/current')
gradleVersion = new JsonSlurper().parseText(versionService.text).version
print("gradleVersion: " + gradleVersion)
}
}
Run
gradlew wrapper
It's a bit gritty, but now you can update the Gradle wrapper to the latest version without specifying the version, and you can check the updated version in gradle / wrapper / gradle-wrapper.properties. If you need all.zip instead of bin.zip, such as in IntelliJ, specify distributionType = Wrapper.DistributionType.ALL.
For those who don't even want to run the wrapper task, dependsOn.
Recommended Posts