-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.bat
More file actions
60 lines (51 loc) · 1.66 KB
/
build.bat
File metadata and controls
60 lines (51 loc) · 1.66 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
@echo off
echo.
echo =================================================
echo Building CodeSnip Release
echo =================================================
echo.
echo This script will build the project from the 'src' directory
echo and create a self-contained, single-file executable
echo for Windows (x64) in the 'release' directory at the project root.
echo.
echo Make sure you have the .NET 10 SDK installed.
echo.
REM Define source and output directories
set "SRC_DIR=src"
set "OUTPUT_DIR=release"
set "PROJECT_PATH=%SRC_DIR%\CodeSnip\CodeSnip.csproj"
REM Check if the source directory exists
if not exist "%SRC_DIR%" (
echo ERROR: Source directory '%SRC_DIR%' not found.
echo Please run this script from the root directory that contains the 'src' folder.
pause
goto :eof
)
REM Clean the previous release directory if it exists
if exist "%OUTPUT_DIR%" (
echo Deleting old release directory...
rmdir /s /q "%OUTPUT_DIR%"
)
echo.
echo Publishing the application...
echo.
dotnet publish "%PROJECT_PATH%" -c Release -r win-x64 --self-contained true -o "%OUTPUT_DIR%" /p:PublishSingleFile=true /p:IncludeNativeLibrariesForSelfExtract=true /p:EnableCompressionInSingleFile=true
echo.
if %errorlevel% neq 0 (
echo.
echo BUILD FAILED! Please check the output above for errors.
goto :eof
)
echo.
echo Copying external formatters...
xcopy "%SRC_DIR%\CodeSnip\Tools" "%OUTPUT_DIR%\Tools\" /E /I /Y /Q > nul
if %errorlevel% neq 0 (
echo.
echo FAILED TO COPY TOOLS! Check permissions and paths.
goto :eof
)
echo Tools copied successfully.
echo.
echo BUILD SUCCESSFUL! The application is in the '%cd%\%OUTPUT_DIR%' directory.
echo.
pause