-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
64 lines (51 loc) · 1.88 KB
/
build.bat
File metadata and controls
64 lines (51 loc) · 1.88 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
@echo off
setlocal enabledelayedexpansion
rem Build all AutoCAD-version targets of Acad-TotalLength and collect the
rem produced DLLs into .\dist\AutoCAD <year>\.
rem
rem Usage:
rem build.bat -> Release (default)
rem build.bat Debug -> Debug
rem build.bat Release -> Release
set "CONFIG=%~1"
if "%CONFIG%"=="" set "CONFIG=Release"
set "REPO=%~dp0"
set "DIST=%REPO%dist"
echo ==^> Configuration: %CONFIG%
echo ==^> Repo: %REPO%
echo ==^> Dist: %DIST%
echo.
if not exist "%DIST%" mkdir "%DIST%"
call :build 2024 "src\TotalLength 2024\TotalLength 2024.csproj" "src\TotalLength 2024\bin\%CONFIG%\codehaks.TotalLength.dll" || goto :fail
call :build 2025 "src\TotalLength 2025\TotalLength 2025.csproj" "src\TotalLength 2025\bin\%CONFIG%\net8.0-windows\codehaks.TotalLength.dll" || goto :fail
call :build 2026 "src\TotalLength 2026\TotalLength 2026.csproj" "src\TotalLength 2026\bin\%CONFIG%\net8.0-windows\codehaks.TotalLength.dll" || goto :fail
echo.
echo ==^> All builds succeeded. Output: %DIST%
endlocal
exit /b 0
:build
set "YEAR=%~1"
set "PROJ=%~2"
set "OUTDLL=%~3"
set "DESTDIR=%DIST%\AutoCAD %YEAR%"
echo ----------------------------------------------------------------------
echo Building TotalLength %YEAR% (%CONFIG%)
echo ----------------------------------------------------------------------
dotnet msbuild "%REPO%%PROJ%" -t:Restore;Rebuild -p:Configuration=%CONFIG% -p:Platform="Any CPU" -nologo
if errorlevel 1 exit /b 1
if not exist "%REPO%%OUTDLL%" (
echo [FAIL] Expected build output not found: %REPO%%OUTDLL%
exit /b 1
)
if not exist "%DESTDIR%" mkdir "%DESTDIR%"
copy /Y "%REPO%%OUTDLL%" "%DESTDIR%\" >nul
rem Copy pdb if present.
set "OUTPDB=%REPO%%OUTDLL:.dll=.pdb%"
if exist "%OUTPDB%" copy /Y "%OUTPDB%" "%DESTDIR%\" >nul
echo [OK] %YEAR% -^> %DESTDIR%\codehaks.TotalLength.dll
exit /b 0
:fail
echo.
echo ==^> Build FAILED.
endlocal
exit /b 1