Files
EasyDesignCollection/scripts/build.bat
T

51 lines
2.2 KiB
Batchfile
Raw Permalink Normal View History

2026-09-18 16:50:12 +08:00
@echo off
rem Build the Windows release and copy the runnable bundle to the shared release
rem root next to the source tree: ..\..\release\windows\ProcessDesignSuite
2026-09-18 16:50:12 +08:00
rem (ASCII only: .bat files are read with the OEM codepage.)
setlocal
set FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
set PUB_HOSTED_URL=https://pub.flutter-io.cn
rem NOTE: avoid `if (...)` blocks here -- %PATH% contains parentheses
rem (e.g. "Program Files (x86)") which break cmd block parsing.
set FLUTTER_BIN=D:\flutter\bin
if not exist D:\flutter\bin\flutter.bat set FLUTTER_BIN=E:\flutter\bin
if not exist E:\flutter\bin\flutter.bat set FLUTTER_BIN=E:\AiCodeGitea\ven\flutter\bin
set PATH=%FLUTTER_BIN%;%PATH%
set FLUTTER_CMAKE_PATH=
if exist D:\cmake-lv\bin\cmk2.exe set FLUTTER_CMAKE_PATH=D:\cmake-lv\bin\cmk2.exe
if exist E:\cmake-lv\bin\cmk2.exe set FLUTTER_CMAKE_PATH=E:\cmake-lv\bin\cmk2.exe
if exist E:\AiCodeGitea\ven\cmake-lv\bin\cmk2.exe set FLUTTER_CMAKE_PATH=E:\AiCodeGitea\ven\cmake-lv\bin\cmk2.exe
if "%FLUTTER_CMAKE_PATH%"=="" echo [warn] renamed CMake not found: D:\cmake-lv\bin\cmk2.exe
if "%FLUTTER_CMAKE_PATH%"=="" echo [warn] if a transparent-encryption DLP is installed, run scripts\setup-cmake.bat first.
2026-09-18 16:50:12 +08:00
cd /d "%~dp0.."
rem --no-tree-shake-icons: bundle the full Material icon font so newly used
rem icons are always present (avoids stale/blank icons after incremental builds).
call flutter build windows --release --no-tree-shake-icons
if errorlevel 1 (
echo Build failed.
exit /b 1
)
set "RELEASE_WINDOWS=%~dp0..\..\release\windows"
set "OUT=%RELEASE_WINDOWS%\ProcessDesignSuite"
if not exist "%RELEASE_WINDOWS%" mkdir "%RELEASE_WINDOWS%"
if exist "%OUT%" rmdir /s /q "%OUT%"
mkdir "%OUT%"
xcopy /e /i /y /q "build\windows\x64\runner\Release\*" "%OUT%\" >nul
rem Release-level module registry: visible modules/<id>/module.json next to exe.
if exist "assets\modules" xcopy /e /i /y /q "assets\modules\*" "%OUT%\modules\" >nul
2026-09-18 16:50:12 +08:00
rem Create an empty license folder next to the exe and copy ONLY *.lic files.
rem IMPORTANT: never ship any documentation (the algorithm must stay private).
if not exist "%OUT%\license" mkdir "%OUT%\license"
if exist "license\*.lic" xcopy /y /q "license\*.lic" "%OUT%\license\" >nul
2026-09-18 16:50:12 +08:00
echo.
echo Build OK: %OUT%\ProcessDesignSuite.exe
2026-09-18 16:50:12 +08:00
endlocal