Repository navigation
Expand file tree
/
Copy pathmake_release.bat
More file actions
104 lines (89 loc) · 2.62 KB
/
Copy pathmake_release.bat
File metadata and controls
104 lines (89 loc) · 2.62 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
@echo off
setlocal
rem make_release.bat
rem Builds Release x64 of the solution and puts the files needed to run it
rem into .\release
set "SOLUTION=df_game_data.slnx"
set "PLATFORM=x64"
rem Files that make up the package (from the build output folder)
set "FILES=Editor.exe nfd.dll"
pushd "%~dp0"
rem --- Find MSBuild via vswhere ---
set "VSWHERE=%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere.exe"
if not exist "%VSWHERE%" (
echo ERROR: vswhere.exe not found - is Visual Studio installed?
goto :fail
)
set "MSBUILD="
for /f "usebackq delims=" %%i in (`"%VSWHERE%" -latest -requires Microsoft.Component.MSBuild -find MSBuild\**\Bin\MSBuild.exe`) do set "MSBUILD=%%i"
if not defined MSBUILD (
echo ERROR: MSBuild.exe not found
goto :fail
)
echo Using MSBuild: %MSBUILD%
rem --- Clean the release folder ---
set "DEST=%CD%\release"
set "STAGE=%CD%\release_build"
if exist "%DEST%" rmdir /s /q "%DEST%"
if exist "%STAGE%" rmdir /s /q "%STAGE%"
mkdir "%DEST%"
mkdir "%STAGE%"
rem --- Build ---
echo.
echo === Building Release^|%PLATFORM% ===
rem The doubled trailing backslash keeps the quoting happy.
"%MSBUILD%" "%SOLUTION%" /m /nologo /verbosity:minimal /t:Build /p:Configuration=Release /p:Platform=%PLATFORM% "/p:OutDir=%STAGE%\\"
if errorlevel 1 (
echo ERROR: build failed
goto :fail
)
rem --- Collect the package files ---
for %%f in (%FILES%) do (
if not exist "%STAGE%\%%f" (
echo ERROR: %%f was not found in the build output
goto :fail
)
copy /y "%STAGE%\%%f" "%DEST%\" >nul
if errorlevel 1 (
echo ERROR: failed to copy %%f
goto :fail
)
)
rmdir /s /q "%STAGE%"
rem --- Copy the font and its licenses from the source tree into release\FontAwesome ---
for %%f in (fontawesome-webfont.ttf licence.txt LICENSE.txt) do (
if not exist "FontAwesome\%%f" (
echo ERROR: FontAwesome\%%f not found
goto :fail
)
xcopy /y /i /q "FontAwesome\%%f" "%DEST%\FontAwesome\" >nul
if errorlevel 1 (
echo ERROR: failed to copy FontAwesome\%%f
goto :fail
)
)
rem --- Copy the example data folders, keeping their relative paths ---
rem Robocopy exit codes below 8 mean success.
for %%d in (Examples\1_Simple\data Examples\2_HotReloading\data Examples\3_Exhaustive\data) do (
if not exist "%%d\" (
echo ERROR: %%d not found
goto :fail
)
robocopy "%%d" "%DEST%\%%d" /E /NFL /NDL /NJH /NJS /NP >nul
if errorlevel 8 (
echo ERROR: failed to copy %%d
goto :fail
)
)
echo.
echo Release package ready: %DEST%
dir /b /s "%DEST%"
popd
endlocal
exit /b 0
:fail
echo.
echo FAILED
popd
endlocal
exit /b 1