Skip to content

Commit

Permalink
Enforce timezone to UTC when running Gradle locally
Browse files Browse the repository at this point in the history
This should help developers to run the build with test without problems with tests that are timestamp sensitive.
  • Loading branch information
TranceLove committed Jan 19, 2021
1 parent 5e2ca97 commit a8d9ffa
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""

TZ=UTC
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`

Expand Down Expand Up @@ -157,4 +157,4 @@ function splitJvmOpts() {
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"

exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
exec env TZ=$TZ "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
2 changes: 1 addition & 1 deletion gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ if "%OS%"=="Windows_NT" setlocal

@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=

set TZ=UTC
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
Expand Down

0 comments on commit a8d9ffa

Please sign in to comment.