Skip to content

Commit 07217e2

Browse files
authored
Upgrade Gradle/Wrapper to latest version (#1123)
* Upgrade Gradle/Wrapper to latest version * Upgrade Gradle/Wrapper to latest version * Update gradle wrapper to version 6.8.3 * add ASF license header to generated gradle-wrapper.properties file * Update README to reflect current gradlew version supported
1 parent c867379 commit 07217e2

File tree

6 files changed

+35
-44
lines changed

6 files changed

+35
-44
lines changed

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ The project includes its own packaged version of Gradle called Gradle Wrapper wh
212212
213213
#### Using your own local Gradle to build
214214
215-
Alternatively, you can choose to [Install Gradle](https://gradle.org/install/) and use it instead of the project's Gradle Wrapper. If so, you would use the `gradle` command instead of `gradlew`. If you do elect to use your own Gradle, verify its version is `5.5.1` or higher:
215+
Alternatively, you can choose to [Install Gradle](https://gradle.org/install/) and use it instead of the project's Gradle Wrapper. If so, you would use the `gradle` command instead of `gradlew`. If you do elect to use your own Gradle, verify its version is `6.8.1` or higher:
216216

217217
```sh
218218
gradle -version
@@ -304,7 +304,7 @@ go get github.com/project/libname
304304
Using a release tag:
305305

306306
```sah
307-
go get github.com/project/libname
307+
go get github.com/project/libname@1.1.0
308308
```
309309

310310
Using a commit hash:

Diff for: build.gradle

+5
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ golang {
4444
// into a "/vendor" directory and use them to build the project (which will fail)
4545
installDependencies.enabled = false
4646
resolveBuildDependencies.enabled = false
47+
resolveTestDependencies.enabled = false
48+
49+
// Disable "go vet" and "gofmt" as gogradle uses deprecated syntax
50+
goVet.enabled = false
51+
gofmt.enabled = false
4752

4853
// File exclusions for the Apache Rat scanning tool
4954
rat {

Diff for: gradle/wrapper/gradle-wrapper.jar

5.51 KB
Binary file not shown.

Diff for: gradle/wrapper/gradle-wrapper.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,6 @@
1616
#
1717
distributionBase=GRADLE_USER_HOME
1818
distributionPath=wrapper/dists
19+
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-all.zip
1920
zipStoreBase=GRADLE_USER_HOME
2021
zipStorePath=wrapper/dists
21-
distributionUrl=https\://services.gradle.org/distributions/gradle-5.5.1-bin.zip

Diff for: gradlew

+18-21
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
# you may not use this file except in compliance with the License.
88
# You may obtain a copy of the License at
99
#
10-
# http://www.apache.org/licenses/LICENSE-2.0
10+
# https://www.apache.org/licenses/LICENSE-2.0
1111
#
1212
# Unless required by applicable law or agreed to in writing, software
1313
# distributed under the License is distributed on an "AS IS" BASIS,
@@ -44,7 +44,7 @@ APP_NAME="Gradle"
4444
APP_BASE_NAME=`basename "$0"`
4545

4646
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
47-
DEFAULT_JVM_OPTS='-Dfile.encoding=UTF-8'
47+
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
4848

4949
# Use the maximum available, or set MAX_FD != -1 to use that value.
5050
MAX_FD="maximum"
@@ -82,6 +82,7 @@ esac
8282

8383
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
8484

85+
8586
# Determine the Java command to use to start the JVM.
8687
if [ -n "$JAVA_HOME" ] ; then
8788
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
@@ -125,10 +126,11 @@ if $darwin; then
125126
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
126127
fi
127128

128-
# For Cygwin, switch paths to Windows format before running java
129-
if $cygwin ; then
129+
# For Cygwin or MSYS, switch paths to Windows format before running java
130+
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
130131
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
131132
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
133+
132134
JAVACMD=`cygpath --unix "$JAVACMD"`
133135

134136
# We build the pattern for arguments to be converted via cygpath
@@ -154,19 +156,19 @@ if $cygwin ; then
154156
else
155157
eval `echo args$i`="\"$arg\""
156158
fi
157-
i=$((i+1))
159+
i=`expr $i + 1`
158160
done
159161
case $i in
160-
(0) set -- ;;
161-
(1) set -- "$args0" ;;
162-
(2) set -- "$args0" "$args1" ;;
163-
(3) set -- "$args0" "$args1" "$args2" ;;
164-
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
165-
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
166-
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
167-
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
168-
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
169-
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
162+
0) set -- ;;
163+
1) set -- "$args0" ;;
164+
2) set -- "$args0" "$args1" ;;
165+
3) set -- "$args0" "$args1" "$args2" ;;
166+
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
167+
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
168+
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
169+
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
170+
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
171+
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
170172
esac
171173
fi
172174

@@ -175,14 +177,9 @@ save () {
175177
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
176178
echo " "
177179
}
178-
APP_ARGS=$(save "$@")
180+
APP_ARGS=`save "$@"`
179181

180182
# Collect all arguments for the java command, following the shell quoting and substitution rules
181183
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
182184

183-
# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
184-
if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
185-
cd "$(dirname "$0")"
186-
fi
187-
188185
exec "$JAVACMD" "$@"

Diff for: gradlew.bat

+9-20
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
@rem you may not use this file except in compliance with the License.
66
@rem You may obtain a copy of the License at
77
@rem
8-
@rem http://www.apache.org/licenses/LICENSE-2.0
8+
@rem https://www.apache.org/licenses/LICENSE-2.0
99
@rem
1010
@rem Unless required by applicable law or agreed to in writing, software
1111
@rem distributed under the License is distributed on an "AS IS" BASIS,
@@ -29,15 +29,18 @@ if "%DIRNAME%" == "" set DIRNAME=.
2929
set APP_BASE_NAME=%~n0
3030
set APP_HOME=%DIRNAME%
3131

32+
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
33+
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
34+
3235
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
33-
set DEFAULT_JVM_OPTS=-Dfile.encoding=UTF-8
36+
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
3437

3538
@rem Find java.exe
3639
if defined JAVA_HOME goto findJavaFromJavaHome
3740

3841
set JAVA_EXE=java.exe
3942
%JAVA_EXE% -version >NUL 2>&1
40-
if "%ERRORLEVEL%" == "0" goto init
43+
if "%ERRORLEVEL%" == "0" goto execute
4144

4245
echo.
4346
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
@@ -51,7 +54,7 @@ goto fail
5154
set JAVA_HOME=%JAVA_HOME:"=%
5255
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5356

54-
if exist "%JAVA_EXE%" goto init
57+
if exist "%JAVA_EXE%" goto execute
5558

5659
echo.
5760
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
@@ -61,28 +64,14 @@ echo location of your Java installation.
6164

6265
goto fail
6366

64-
:init
65-
@rem Get command-line arguments, handling Windows variants
66-
67-
if not "%OS%" == "Windows_NT" goto win9xME_args
68-
69-
:win9xME_args
70-
@rem Slurp the command line arguments.
71-
set CMD_LINE_ARGS=
72-
set _SKIP=2
73-
74-
:win9xME_args_slurp
75-
if "x%~1" == "x" goto execute
76-
77-
set CMD_LINE_ARGS=%*
78-
7967
:execute
8068
@rem Setup the command line
8169

8270
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
8371

72+
8473
@rem Execute Gradle
85-
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
74+
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
8675

8776
:end
8877
@rem End local scope for the variables with windows NT shell

0 commit comments

Comments
 (0)