Skip to content

Commit 6a727ca

Browse files
authored
Fix: chaining of GRADLE_OPTS (#11878)
Added test to avoid inserting and empty space in GRADLE_OPTS, and moved echo command outside of if to make it effective
1 parent 413a7fe commit 6a727ca

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

ci/unit_tests.bat

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,13 @@ echo Using drive !use_drive! for %WORKSPACE%
4141

4242
echo Running core tests..
4343
if defined BUILD_JAVA_HOME (
44-
set GRADLE_OPTS="%GRADLE_OPTS% -Dorg.gradle.java.home=%BUILD_JAVA_HOME%"
45-
echo GRADLE_OPTS is: %GRADLE_OPTS%, BUILD_JAVA_HOME: %BUILD_JAVA_HOME%
44+
if defined GRADLE_OPTS (
45+
set GRADLE_OPTS=%GRADLE_OPTS% -Dorg.gradle.java.home=%BUILD_JAVA_HOME%
46+
) else (
47+
set GRADLE_OPTS=-Dorg.gradle.java.home=%BUILD_JAVA_HOME%
48+
)
4649
)
50+
echo Invoking Gradle, GRADLE_OPTS: %GRADLE_OPTS%, BUILD_JAVA_HOME: %BUILD_JAVA_HOME%
4751
call .\gradlew.bat test --console=plain --no-daemon --info
4852

4953
if errorlevel 1 (

0 commit comments

Comments
 (0)