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