I want to use distributionUrl pointing to "ALL" for local builds, but "BIN" for CI builds.
Let's say I run Gradle Wrapper locally like this:
./gradlew test
And my gradle-wrapper.properties
file (which is checked-in to VCS) points to "ALL" distribution:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.2.1-all.zip
Is there a parameter I can pass to ./gradlew test
to change distribution-type to BIN?
Upgrading the Gradle Wrapper One way to upgrade the Gradle version is manually change the distributionUrl property in the Wrapper's gradle-wrapper. properties file. The better and recommended option is to run the wrapper task and provide the target Gradle version as described in Adding the Gradle Wrapper.
Open gradle-wrapper. properties(go to Gradle > wrapper > gradle-wrapper. properties and manually change the distributionUrl property in the file.
Run
sed -i 's/all.zip/bin.zip/g' gradle/wrapper/gradle-wrapper.properties
before running ./gradlew
on CI.
Imperfect, but it works for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With