forked from dotnet/jitutils
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.cmd
84 lines (71 loc) · 1.94 KB
/
build.cmd
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
@echo off
setlocal
REM Build and optionally publish sub projects
REM
REM This script will by default build release versions of the tools.
REM If publish (-p) is requested it will create standalone versions of the
REM tools in <root>/src/<project>/<buildType>/netcoreapp1.0/<platform>/Publish/.
REM These tools can be installed via the install script (install.{sh|cmd}) in
REM this directory.
set scriptDir=%~dp0
set appInstallDir=%scriptDir%bin
set fxInstallDir=%scriptDir%fx
set buildType=Release
set publish=false
set fx=false
REM REVIEW: 'platform' is never used
for /f "usebackq tokens=1,2" %%a in (`dotnet --info`) do (
if "%%a"=="RID:" set platform=%%b
)
:argLoop
if "%1"=="" goto :build
if /i "%1"=="-b" (
set buildType=%2
shift
goto :nextArg
)
if /i "%1"=="-f" (
set fx=true
goto :nextArg
)
if /i "%1"=="-p" (
set publish=true
goto :nextArg
)
if /i "%1" == "-h" (
goto :usage
)
echo ERROR: unknown argument %1
goto :usage
:nextArg
shift
goto :argLoop
:build
REM Declare the list of projects
set projects=jit-diff jit-dasm jit-analyze jit-format cijobs
REM Build each project
for %%p in (%projects%) do (
if %publish%==true (
dotnet publish -c %buildType% -o %appInstallDir% .\src\%%p
copy .\wrapper.cmd %appInstallDir%\%%p.cmd
) else (
dotnet build -c %buildType% .\src\%%p
)
)
if %fx%==true (
dotnet publish -c %buildType% -o %fxInstallDir% .\src\packages
@REM remove package version of mscorlib* - refer to core root version for diff testing
if exist %fxInstallDir%\mscorlib* del /q %fxInstallDir%\mscorlib*
)
REM Done
exit /b 0
:usage
echo.
echo build.cmd [-b ^<BUILD TYPE^>] [-f] [-h] [-p]
echo.
echo -b ^<BUILD TYPE^> : Build type, can be Debug or Release.
echo -h : Show this message.
echo -f : Publish default framework directory in ^<script_root^>\fx.
echo -p : Publish utilities.
echo.
exit /b 1