-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathbuild.bat
More file actions
45 lines (38 loc) · 1.47 KB
/
Copy pathbuild.bat
File metadata and controls
45 lines (38 loc) · 1.47 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
@echo off
setlocal
:: -----------------------------------------------------------------------
:: Build ss14-editor
:: build.bat - Debug build, runs in-place (dotnet run style)
:: build.bat release - Release build output to bin\
:: build.bat publish - Self-contained win-x64 single-file to publish\
:: -----------------------------------------------------------------------
set PROJECT=ss14-editor.csproj
if /i "%1"=="publish" goto publish
if /i "%1"=="release" goto release
:: ---- Default: Debug build ---------------------------------------------
:debug
echo [Build] Debug...
dotnet build %PROJECT% -c Debug -v q
if %ERRORLEVEL% neq 0 ( echo Build FAILED. & exit /b %ERRORLEVEL% )
echo [Build] OK: bin\ss14-editor.exe
goto end
:: ---- Release build ----------------------------------------------------
:release
echo [Build] Release...
dotnet build %PROJECT% -c Release -v q
if %ERRORLEVEL% neq 0 ( echo Build FAILED. & exit /b %ERRORLEVEL% )
echo [Build] OK: bin\ss14-editor.exe
goto end
:: ---- Self-contained single-file publish for Windows ------------------
:publish
echo [Build] Publishing self-contained win-x64...
dotnet publish %PROJECT% -c Release -r win-x64 --self-contained true ^
-p:PublishSingleFile=true ^
-p:IncludeNativeLibrariesForSelfExtract=true ^
-p:DebugType=embedded ^
-o publish\win-x64
if %ERRORLEVEL% neq 0 ( echo Publish FAILED. & exit /b %ERRORLEVEL% )
echo [Build] Published: publish\win-x64\ss14-editor.exe
goto end
:end
endlocal