-
Notifications
You must be signed in to change notification settings - Fork 1
/
cli_work.cmd
134 lines (107 loc) · 3.63 KB
/
cli_work.cmd
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
133
134
@echo off
chcp 65001
cls
:: #####
:: Setting variables
:: #####
REM Full Project Path
set "project=%~dp0"
REM Path to Godot Executable
set "gdpath=C:\Proggen\Godot\Godot_v4.3-stable"
set "godotexe=Godot_v4.3-stable_win64.exe"
set "godotver=Godot_v4.3-stable_win64.exe --version"
REM Full Engine Path
set "build_godot=%gdpath%\%godotexe%"
REM Profilename in export_presets.cfg
REM set "build_profile=Windows Desktop"
set "build_profile=Windows"
REM export Type export-debug or export-release or export-pack (musst be .pck or .zip)
REM set "build_type=export-debug"
set "build_type=export-release"
REM set "build_type=export-pack"
REM Path to Export root folder
set "build_path=C:\Proggen\Godot\Projekte\Just4Fun_Mini_Shootergame\export\gd-4-3\"
REM Subfolder for Export Profile, overwrites preset
set "build_folder=%build_path%%build_profile%"
REM Version sufffix for binary name
set "build_version=_alpha7"
REM Version sufffix for Engine Version
set "build_gdversion="
FOR /F %%I IN ('=%gdpath%\%godotver%') DO @SET "build_gdversion=_%%I"
REM Output binary name
set "build_bin=MiniShooterGame%build_version%%build_gdversion%.exe"
REM Full Build Path+Name
set "build_project=%build_folder%\%build_bin%"
REM Full Build Log output
set "build_log=%build_folder%\export.log.txt"
:: #####
:: execute
:: #####
echo #####
call :check_engine || echo check_engine Failed && exit /b -99
echo #####
call :check_folder || echo check_folder Failed && exit /b -99
echo #####
if exist "%build_project%" (
echo Existing Binary Exports will deleted first
del "%build_project%" /F
)
echo #####
REM Godot 4.2.2 dont have the --log-file parameter
REM --log-file "%build_log%"
echo #####
echo Execute Engine for import all resources
"%build_godot%" --verbose --import --headless > "%build_log%" 2>&1
echo #####
echo Execute Build Process overwrite export_presets.cfg export path
"%build_godot%" --verbose --headless --%build_type% "%build_profile%" --path %project% "%build_project%" >> "%build_log%" 2>&1
echo #####
echo ERRORLEVEL: %ERRORLEVEL%
if %ERRORLEVEL% EQU 0 (
call :check_export_output || echo Export Failed && exit /b -99
)
exit /b 0
:: #####
:: checks before execute project export
:: #####
:check_engine
echo checking Engine Settings
echo PATH: "%build_godot%"
if NOT exist "%build_godot%" (
echo path to engine or engine executabele does not exist
exit /b -1
)
exit /b 0
:check_folder
echo checking project and export Settings
echo ProjectFile: "%project%project.godot"
if NOT exist "%project%project.godot" (
echo the project file does not exist
exit /b -1
)
echo ExportFolder: "%build_folder%"
if NOT exist "%build_folder%\." (
echo the build folder does not exist
exit /b -1
)
exit /b 0
:check_export_output
echo checking export success
echo Export Binary: %build_project%
if NOT exist "%build_project%" (
echo the Exported Binary does not exist
exit /b -1
)
echo the export was successfull
CHOICE /C XN /M "Start the exported binary [X] Execute or [N] do not" /N /D N /T 10
IF %ERRORLEVEL% EQU 1 (
call "%build_project%"
) else (
exit /b 0
)
exit /b 0
:: #####
REM "C:\Proggen\Godot\Godot_v4.2-stable\Godot_v4.2.2-stable_win64.exe" --verbose --headless
REM --log-file "C:\Proggen\Godot\Projekte\Just4Fun_Mini_Shootergame\export\gd-4-2-2_stable\Windows\export.log.txt"
REM --export-release "Windows" --path C:\Proggen\Godot\Projekte\Just4Fun_Mini_Shootergame\4.2.2-stable\\
REM "C:\Proggen\Godot\Projekte\Just4Fun_Mini_Shootergame\export\gd-4-2-2_stable\Windows\MiniShooterGame_alpha7_4.2.2.stable.official.15073afe3.exe"