-
Notifications
You must be signed in to change notification settings - Fork 40
Expand file tree
/
Copy pathBuild.cmd
More file actions
132 lines (115 loc) · 3.53 KB
/
Copy pathBuild.cmd
File metadata and controls
132 lines (115 loc) · 3.53 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
@Echo Off
chcp 65001 >nul
SETLOCAL ENABLEDELAYEDEXPANSION
SET PLATFORM=x64
SET CONFIG=Release
SET CEF_VERSION=145.0.28+g51162e8+chromium-145.0.7632.160
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a"
set "YYYY=%dt:~0,4%"
set "MM=%dt:~4,2%"
set "DD=%dt:~6,2%"
set "HH=%dt:~8,2%"
set "MI=%dt:~10,2%"
set "SS=%dt:~12,2%"
set DATE_STR=%YYYY%-%MM%-%DD%
set TIME_STR=%HH%:%MI%:%SS%
SET OUT_FILE="%~dp0Browser_%YYYY%%MM%%DD%%HH%%MI%.zip"
Echo ================================================
Echo Build.cmd - Browser Project Build Script
Echo ================================================
Echo Build Date: %DATE_STR% %TIME%
Echo CEF Version: %CEF_VERSION%
Echo Platform: %PLATFORM%
Echo Configuration: %CONFIG%
Echo ================================================
Echo.
Echo [Step 1/4] Parsing user input...
SET Action=Build
CHOICE /C BCE /N /D B /T 3 /M "Build(B) Clean(C) Continue(E):"
IF %ERRORLEVEL% EQU 1 (SET Action=Build && Echo Selected action: Build)
IF %ERRORLEVEL% EQU 2 (SET Action=Clean && Echo Selected action: Clean)
IF %ERRORLEVEL% EQU 3 (SET Action=END && Echo Selected action: Skip build)
:Start
IF %Action%==Clean GOTO Clean
IF %Action%==END GOTO End
:Prep
Echo.
Echo [Step 2/4] Preparing resources...
IF NOT EXIST .\Browser\Skin.zip (
Echo Creating Skin.zip...
PUSHD .\Browser\Skin\
..\..\Bin\7z.exe a ..\Skin.zip *
POPD
IF ERRORLEVEL 1 (
Echo [ERROR] Failed to create Skin.zip
GOTO Error
)
Echo Skin.zip created successfully
) ELSE (
Echo Skin.zip already exists, skipping
)
:Build
Echo.
Echo [Step 3/4] Building solution...
Echo MSBuild path detection...
SET MSBUILD=C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\MSBuild.exe
IF EXIST "%MSBUILD%" (
Echo Found MSBuild: %MSBUILD%
Echo Starting build...
"%MSBUILD%" Browser.sln /t:Build /p:Configuration=%CONFIG%;Platform=%PLATFORM% /m /v:minimal
IF ERRORLEVEL 1 (
Echo [ERROR] MSBuild failed with error code %ERRORLEVEL%
GOTO Error
)
Echo Build completed successfully
) ELSE (
Echo [ERROR] MSBuild not found at: %MSBUILD%
Echo Please install Visual Studio 2022 with MSBuild
GOTO Error
)
Echo.
Echo [Step 4/4] Post-build processing...
IF EXIST .\Bin\Binary.cmd (
CALL .\Bin\Binary.cmd
)
IF EXIST .\Bin\Package.cmd (
CALL .\Bin\Package.cmd %OUT_FILE%
)
Echo.
Echo ================================================
Echo Build completed successfully!
Echo Output: %OUT_FILE%
Echo ================================================
GOTO End
:Clean
Echo.
Echo [Clean] Cleaning temporary files...
DEL /F /Q /S /A *.sdf *.user *.ilk *.ipch *.suo *.opensdf 2>NUL
DEL /F /Q /S /A DuiLib*.lib libcef*.lib DuiLib*.pdb libcef*.pdb Browser*.exe Browser*.pdb 2>NUL
IF EXIST .vs RD /S /Q .vs
IF EXIST .\ipch RD /S /Q .\ipch
IF EXIST .\Bin\Debug RD /S /Q .\Bin\Debug
IF EXIST .\Bin\Release RD /S /Q .\Bin\Release
IF EXIST .\Bin\x64\Debug RD /S /Q .\Bin\x64\Debug
IF EXIST .\Bin\x64\Release RD /S /Q .\Bin\x64\Release
IF EXIST .\Bin\Browser.zip DEL /F /Q /S .\Bin\Browser.zip 2>NUL
IF EXIST .\Browser\Skin.zip DEL /F /Q /S .\Browser\Skin.zip 2>NUL
Echo Clean completed
ENDLOCAL
exit /B 0
:ErrorBinary
Echo [ERROR]: There was an error in downloading binary files.
:Error
Echo.
Echo ================================================
Echo [ERROR] Build failed at %DATE_STR% %TIME%
Echo CEF Version: %CEF_VERSION%
Echo Platform: %PLATFORM%
Echo Configuration: %CONFIG%
Echo Action: %Action%
Echo ================================================
PAUSE
ENDLOCAL
EXIT /B 1
:End
ENDLOCAL