Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
## Simple bash function to upgrade to a version to gradle
##
gg()
{
ver=${1:-4.1.0}
dver=${2:-4.1}
echo Gradle Version $ver / $dver
gu=https://raw.githubusercontent.com/gradle/gradle/v$ver/gradlew
gw=https://raw.githubusercontent.com/gradle/gradle/v$ver/gradlew.bat
gj=https://raw.githubusercontent.com/gradle/gradle/v$ver/gradle/wrapper/gradle-wrapper.jar
du='https\://services.gradle.org/distributions/gradle-'$dver-bin.zip
mkdir -p gradle/wrapper
curl $gu -# -o gradlew
curl $gw -# -o gradlew.bat
curl $gj -# -o gradle/wrapper/gradle-wrapper.jar
touch gradle/wrapper/gradle-wrapper.properties
grep -v distributionUrl gradle/wrapper/gradle-wrapper.properties > /tmp/gg$$
echo distributionUrl=$du >> /tmp/gg$$
mv /tmp/gg$$ gradle/wrapper/gradle-wrapper.properties
chmod +x gradlew
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.