forked from ubisoft/Sharpmake
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bootstrap.bat
60 lines (48 loc) · 1.4 KB
/
bootstrap.bat
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
@echo off
:: Batch arguments:
:: %~1 Main sharpmake file
:: %~2 Target(Normally should be Debug or Release)
:: %~3 Framework (net472 or net5.0)
:: if none are passed, defaults to Sharpmake.Main.sharpmake.cs in Debug with net5.0
setlocal enabledelayedexpansion
:: Clear previous run status
COLOR
:: set batch file directory as current
pushd "%~dp0"
set SHARPMAKE_OPTIM=Debug
if not "%~2" == "" (
set SHARPMAKE_OPTIM=%~2
)
set SHARPMAKE_FRAMEWORK=net5.0
if not "%~3" == "" (
set SHARPMAKE_FRAMEWORK=%~3
)
set SHARPMAKE_EXECUTABLE=tmp\bin\%SHARPMAKE_OPTIM%\%SHARPMAKE_FRAMEWORK%\Sharpmake.Application.exe
call CompileSharpmake.bat Sharpmake.Application/Sharpmake.Application.csproj %SHARPMAKE_OPTIM% AnyCPU
if %errorlevel% NEQ 0 goto error
set SHARPMAKE_MAIN='Sharpmake.Main.sharpmake.cs'
if not "%~1" == "" (
set SHARPMAKE_MAIN='%~1'
)
set SM_CMD=%SHARPMAKE_EXECUTABLE% /sources(%SHARPMAKE_MAIN%) /verbose
echo %SM_CMD%
%SM_CMD%
if %errorlevel% NEQ 0 goto error
goto success
@REM -----------------------------------------------------------------------
:success
COLOR 2F
echo Bootstrap succeeded^!
set ERROR_CODE=0
goto end
@REM -----------------------------------------------------------------------
:error
COLOR 4F
echo Bootstrap failed^!
set ERROR_CODE=1
goto end
@REM -----------------------------------------------------------------------
:end
:: restore caller current directory
popd
exit /b %ERROR_CODE%