forked from grpc/grpc-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindows64.bat
More file actions
69 lines (58 loc) · 2.27 KB
/
windows64.bat
File metadata and controls
69 lines (58 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
@rem ##########################################################################
@rem
@rem Builds artifacts for x86_64 into %WORKSPACE%\artifacts\
@rem
@rem ##########################################################################
type c:\VERSION
@rem Enter repo root
cd /d %~dp0\..\..
set WORKSPACE=T:\src\github\grpc-java
set ESCWORKSPACE=%WORKSPACE:\=\\%
@rem Clear JAVA_HOME to prevent a different Java version from being used
set JAVA_HOME=
mkdir grpc-java-helper64
cd grpc-java-helper64
call "%VS170COMNTOOLS%\..\..\VC\Auxiliary\Build\vcvars64.bat" || exit /b 1
call "%WORKSPACE%\buildscripts\make_dependencies.bat" || exit /b 1
cd "%WORKSPACE%"
SET TARGET_ARCH=x86_64
SET FAIL_ON_WARNINGS=true
SET PROTOBUF_VER=33.1
SET PKG_CONFIG_PATH=%ESCWORKSPACE%\\grpc-java-helper64\\protobuf-%PROTOBUF_VER%\\build\\protobuf-%PROTOBUF_VER%\\lib\\pkgconfig
SET VC_PROTOBUF_LIBS=/LIBPATH:%ESCWORKSPACE%\\grpc-java-helper64\\protobuf-%PROTOBUF_VER%\\build\\protobuf-%PROTOBUF_VER%\\lib
SET VC_PROTOBUF_INCLUDE=%ESCWORKSPACE%\\grpc-java-helper64\\protobuf-%PROTOBUF_VER%\\build\\protobuf-%PROTOBUF_VER%\\include
call :Get_Libs
SET GRADLE_FLAGS=-PtargetArch=%TARGET_ARCH% -PfailOnWarnings=%FAIL_ON_WARNINGS% -PvcProtobufLibs=%VC_PROTOBUF_LIBS% -PvcProtobufInclude=%VC_PROTOBUF_INCLUDE% -PskipAndroid=true
SET GRADLE_OPTS="-Dorg.gradle.jvmargs='-Xmx1g'"
@rem make sure no daemons have any files open
cmd.exe /C "%WORKSPACE%\gradlew.bat --stop"
cmd.exe /C "%WORKSPACE%\gradlew.bat %GRADLE_FLAGS% -Dorg.gradle.parallel=false -PrepositoryDir=%WORKSPACE%\artifacts grpc-compiler:clean grpc-compiler:build grpc-compiler:publish" || exit /b 1
goto :eof
:Get_Libs
SetLocal EnableDelayedExpansion
set "libs_list="
for /f "tokens=*" %%a in ('pkg-config --libs protobuf') do (
for %%b in (%%a) do (
set lib=%%b
set libfirst2char=!lib:~0,2!
if !libfirst2char!==-l (
@rem remove the leading -l
set lib=!lib:~2!
@rem remove spaces
set lib=!lib: =!
set libprefix=!lib:~0,4!
if !libprefix!==absl (
set lib=!lib!.lib
) else (
set lib=lib!lib!.lib
)
if "!libs_list!"=="" (
set libs_list=!lib!
) else (
set libs_list=!libs_list!,!lib!
)
)
)
)
EndLocal & set "VC_PROTOBUF_LIBS=%VC_PROTOBUF_LIBS%,%libs_list%"
exit /b 0