Browse Source

buildsystem: check the gradle version in the PATH matches the one we want

Older gradle versions may give an error in the simplistic build.gradle.
It's fine, we won't have a matching version.
merge-requests/2254/merge
Steve Lhomme 1 year ago
parent
commit
53ea7019fa
  1. 3
      buildsystem/compile.sh
  2. 1
      buildsystem/gradle_version/build.gradle

3
buildsystem/compile.sh

@ -264,7 +264,8 @@ if [ ! -e "./gradlew" ] || [ ! -x "./gradlew" ]; then
GRADLE_URL=https://services.gradle.org/distributions/gradle-${GRADLE_VERSION}-bin.zip
export PATH="$(pwd -P)/gradle-${GRADLE_VERSION}/bin:$PATH"
if [ ! $(command -v gradle) >/dev/null 2>&1 ]; then
GRADLE_PATH_VERSION=$(cd buildsystem/gradle_version; gradle -q 2>/dev/null | grep gradle_version= | cut -b 16-)
if [ "$GRADLE_PATH_VERSION" != "$GRADLE_VERSION" ]; then
diagnostic "gradle could not be found in PATH, downloading"
wget ${GRADLE_URL} 2>/dev/null || curl -O ${GRADLE_URL} || fail "gradle: download failed"
echo $GRADLE_SHA256 gradle-${GRADLE_VERSION}-bin.zip | sha256sum -c || fail "gradle: hash mismatch"

1
buildsystem/gradle_version/build.gradle

@ -0,0 +1 @@
println 'gradle_version=' + gradle.getGradleVersion()
Loading…
Cancel
Save