fix: rebuild MES as compilable go-zero+ent backend (renamed bj_power_mes), restore 3 workstation projects from pristine original, align naming; all Go projects go build clean
This commit is contained in:
+11
-20
@@ -3,7 +3,7 @@ setlocal enabledelayedexpansion
|
||||
|
||||
chcp 65001 >nul
|
||||
|
||||
set "EXE_NAME=bj_power_mes"
|
||||
set "EXE_NAME=back_cover"
|
||||
set "OUTPUT_DIR=.\bin"
|
||||
set "GOOS=windows"
|
||||
set "GOARCH=amd64"
|
||||
@@ -17,38 +17,29 @@ for /f "tokens=*" %%a in ('powershell -Command "Get-Date -Format 'yyyy-MM-dd_HH:
|
||||
set "LDFLAGS=-s -w -H=windowsgui -X main.Version=%VERSION% -X main.Commit=%COMMIT% -X main.BuildTime=%BUILD_TIME%"
|
||||
set "BUILD_FLAGS=-trimpath"
|
||||
|
||||
echo Step 1: Build frontend...
|
||||
cd frontend
|
||||
call npm run build
|
||||
if errorlevel 1 (
|
||||
echo Frontend build failed
|
||||
exit /b 1
|
||||
)
|
||||
cd ..
|
||||
|
||||
echo Step 2: Copy frontend output to public/ ...
|
||||
if exist "public" rmdir /s /q "public"
|
||||
mkdir "public"
|
||||
xcopy "frontend\dist\*" "public\" /E /I /Y >nul 2>&1
|
||||
|
||||
echo Step 3: Clean up...
|
||||
echo Cleaning up...
|
||||
if exist "%OUTPUT_DIR%" rmdir /s /q "%OUTPUT_DIR%"
|
||||
if not exist "%OUTPUT_DIR%" mkdir "%OUTPUT_DIR%"
|
||||
|
||||
echo Step 4: Build Go binary...
|
||||
echo Generating version info for Windows...
|
||||
go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo@latest
|
||||
goversioninfo -icon=app.ico -manifest=app.manifest -64 -o=app.syso
|
||||
|
||||
echo Building %EXE_NAME% for %GOOS%/%GOARCH% ...
|
||||
set "CGO_ENABLED=0"
|
||||
go build %BUILD_FLAGS% -ldflags "%LDFLAGS%" -o "%OUTPUT_DIR%\%EXE_NAME%.exe" .
|
||||
if errorlevel 1 (
|
||||
echo Go build failed
|
||||
echo Build failed
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Step 5: Copy config files...
|
||||
xcopy ".\etc" "%OUTPUT_DIR%\etc" /I /Y >nul 2>&1
|
||||
echo Copying config files...
|
||||
xcopy ".\etc" "%OUTPUT_DIR%\etc" /I/Y >nul 2>&1
|
||||
if errorlevel 1 (
|
||||
echo Copy config files failed
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
echo Build completed: %OUTPUT_DIR%\%EXE_NAME%.exe
|
||||
|
||||
endlocal
|
||||
Reference in New Issue
Block a user