-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcompile.bat
More file actions
55 lines (41 loc) · 1.27 KB
/
Copy pathcompile.bat
File metadata and controls
55 lines (41 loc) · 1.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
@echo off
setlocal
set "ROOT=%~dp0"
set "PROJECT=DelphiAPIStarterKit.dproj"
set "APP_EXE=DelphiAPIStarterKit.exe"
if not defined BUILD_CONFIG set "BUILD_CONFIG=Debug"
if not defined BUILD_PLATFORM set "BUILD_PLATFORM=Win32"
if defined DELPHI_RSVARS goto CheckRsvars
if defined BDS if exist "%BDS%\bin\rsvars.bat" set "DELPHI_RSVARS=%BDS%\bin\rsvars.bat"
:CheckRsvars
if not defined DELPHI_RSVARS (
echo DELPHI_RSVARS is not configured.
echo Set DELPHI_RSVARS to your rsvars.bat path, for example:
echo set "DELPHI_RSVARS=C:\Program Files ^(x86^)\Embarcadero\Studio\37.0\bin\rsvars.bat"
exit /b 1
)
if not exist "%DELPHI_RSVARS%" goto MissingRsvars
tasklist /FI "IMAGENAME eq %APP_EXE%" | findstr /I "%APP_EXE%" >nul
if %ERRORLEVEL% equ 0 (
taskkill /F /IM "%APP_EXE%"
)
call "%DELPHI_RSVARS%"
pushd "%ROOT%"
if errorlevel 1 exit /b %ERRORLEVEL%
echo Compiling %PROJECT%...
echo Config: %BUILD_CONFIG%
echo Platform: %BUILD_PLATFORM%
echo.
msbuild "%PROJECT%" /t:Make /p:Config=%BUILD_CONFIG% /p:Platform=%BUILD_PLATFORM% /nologo /v:minimal
set "BUILD_ERROR=%ERRORLEVEL%"
echo.
if %BUILD_ERROR% geq 1 (
echo COMPILE FAILED
) else (
echo COMPILE SUCCESS
)
popd
exit /b %BUILD_ERROR%
:MissingRsvars
echo rsvars.bat was not found. Check DELPHI_RSVARS.
exit /b 1