1@rem ########################################################################## 2@rem 3@rem Runs tests and then builds artifacts to %WORKSPACE%\artifacts\ 4@rem 5@rem ########################################################################## 6 7type c:\VERSION 8 9@rem Enter repo root 10cd /d %~dp0\..\.. 11 12set WORKSPACE=T:\src\github\grpc-java 13set ESCWORKSPACE=%WORKSPACE:\=\\% 14 15 16@rem Clear JAVA_HOME to prevent a different Java version from being used 17set JAVA_HOME= 18set PATH=C:\Program Files\java\jdk1.8.0_152\bin;%PATH% 19 20mkdir grpc-java-helper32 21cd grpc-java-helper32 22call "%VS120COMNTOOLS%\vsvars32.bat" || exit /b 1 23call "%WORKSPACE%\buildscripts\make_dependencies.bat" || exit /b 1 24 25cd "%WORKSPACE%" 26 27SET TARGET_ARCH=x86_32 28SET FAIL_ON_WARNINGS=true 29SET VC_PROTOBUF_LIBS=%ESCWORKSPACE%\\grpc-java-helper32\\protobuf-%PROTOBUF_VER%\\cmake\\build\\Release 30SET VC_PROTOBUF_INCLUDE=%ESCWORKSPACE%\\grpc-java-helper32\\protobuf-%PROTOBUF_VER%\\cmake\\build\\include 31SET GRADLE_FLAGS=-PtargetArch=%TARGET_ARCH% -PfailOnWarnings=%FAIL_ON_WARNINGS% -PvcProtobufLibs=%VC_PROTOBUF_LIBS% -PvcProtobufInclude=%VC_PROTOBUF_INCLUDE% 32 33cmd.exe /C "%WORKSPACE%\gradlew.bat %GRADLE_FLAGS% build" 34set GRADLEEXIT=%ERRORLEVEL% 35 36@rem Rename test results .xml files to format parsable by Kokoro 37@echo off 38for /r %%F in (TEST-*.xml) do ( 39 mkdir "%%~dpnF" 40 move "%%F" "%%~dpnF\sponge_log.xml" >NUL 41) 42@echo on 43 44IF NOT %GRADLEEXIT% == 0 ( 45 exit /b %GRADLEEXIT% 46) 47 48@rem make sure no daemons have any files open 49cmd.exe /C "%WORKSPACE%\gradlew.bat --stop" 50 51cmd.exe /C "%WORKSPACE%\gradlew.bat %GRADLE_FLAGS% -Dorg.gradle.parallel=false -PrepositoryDir=%WORKSPACE%\artifacts clean grpc-compiler:build grpc-compiler:uploadArchives" || exit /b 1 52