Skip to content

Commit bff9d74

Browse files
committed
Merge branch 'before-removing-persiangulf'
2 parents 9f2341f + b21c2b2 commit bff9d74

File tree

206 files changed

+594
-59389
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

206 files changed

+594
-59389
lines changed

build.cmd

+166-10
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,174 @@
11
@echo off
2-
echo -
3-
echo ------------------------------
4-
echo building OpenTraining
5-
echo ------------------------------
2+
set MISSION_NAME=VEAF_OpenTraining_Caucasus
3+
echo.
4+
echo ----------------------------------------
5+
echo building %MISSION_NAME%
6+
echo ----------------------------------------
7+
echo.
68

7-
rem -- prepare the folders
8-
rd /s /q .\build
9-
mkdir .\build
10-
mkdir .\build\tempsrc
9+
rem -- default options values
10+
echo This script can use these environment variables to customize its behavior :
11+
echo ----------------------------------------
12+
echo VERBOSE_LOG_FLAG if set to "true", will create a mission with tracing enabled (meaning that, when run, it will log a lot of details in the dcs log file)
13+
echo defaults to "false"
14+
IF [%VERBOSE_LOG_FLAG%] == [] GOTO DefineDefaultVERBOSE_LOG_FLAG
15+
goto DontDefineDefaultVERBOSE_LOG_FLAG
16+
:DefineDefaultVERBOSE_LOG_FLAG
17+
set VERBOSE_LOG_FLAG=false
18+
:DontDefineDefaultVERBOSE_LOG_FLAG
19+
echo current value is "%VERBOSE_LOG_FLAG%"
20+
21+
echo ----------------------------------------
22+
echo LUA_SCRIPTS_DEBUG_PARAMETER can be set to "-debug" or "-trace" (or not set) ; this will be passed to the lua helper scripts (e.g. veafMissionRadioPresetsEditor and veafMissionNormalizer)
23+
echo defaults to not set
24+
IF [%LUA_SCRIPTS_DEBUG_PARAMETER%] == [] GOTO DefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
25+
goto DontDefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
26+
:DefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
27+
set LUA_SCRIPTS_DEBUG_PARAMETER=
28+
:DontDefineDefaultLUA_SCRIPTS_DEBUG_PARAMETER
29+
echo current value is "%LUA_SCRIPTS_DEBUG_PARAMETER%"
30+
31+
echo ----------------------------------------
32+
echo SECURITY_DISABLED_FLAG if set to "true", will create a mission with security disabled (meaning that no password is ever required)
33+
echo defaults to "false"
34+
IF [%SECURITY_DISABLED_FLAG%] == [] GOTO DefineDefaultSECURITY_DISABLED_FLAG
35+
goto DontDefineDefaultSECURITY_DISABLED_FLAG
36+
:DefineDefaultSECURITY_DISABLED_FLAG
37+
set SECURITY_DISABLED_FLAG=false
38+
:DontDefineDefaultSECURITY_DISABLED_FLAG
39+
echo current value is "%SECURITY_DISABLED_FLAG%"
40+
41+
echo ----------------------------------------
42+
echo MISSION_FILE_SUFFIX (a string) will be appended to the mission file name to make it more unique
43+
echo defaults to the current iso date
44+
IF [%MISSION_FILE_SUFFIX%] == [] GOTO DefineDefaultMISSION_FILE_SUFFIX
45+
goto DontDefineDefaultMISSION_FILE_SUFFIX
46+
:DefineDefaultMISSION_FILE_SUFFIX
47+
set TIMEBUILD=%TIME: =0%
48+
set MISSION_FILE_SUFFIX=%date:~-4,4%%date:~-7,2%%date:~-10,2%
49+
:DontDefineDefaultMISSION_FILE_SUFFIX
50+
set MISSION_FILE=.\build\%MISSION_NAME%_%MISSION_FILE_SUFFIX%
51+
echo current value is "%MISSION_FILE_SUFFIX%"
1152

53+
echo ----------------------------------------
54+
echo SEVENZIP (a string) points to the 7za executable
55+
echo defaults "7za", so it needs to be in the path
56+
IF [%SEVENZIP%] == [] GOTO DefineDefaultSEVENZIP
57+
goto DontDefineDefaultSEVENZIP
58+
:DefineDefaultSEVENZIP
59+
set SEVENZIP=7za
60+
:DontDefineDefaultSEVENZIP
61+
echo current value is "%SEVENZIP%"
62+
63+
echo ----------------------------------------
64+
echo LUA (a string) points to the lua executable
65+
echo defaults "lua", so it needs to be in the path
66+
IF [%LUA%] == [] GOTO DefineDefaultLUA
67+
goto DontDefineDefaultLUA
68+
:DefineDefaultLUA
69+
set LUA=lua
70+
:DontDefineDefaultLUA
71+
echo current value is "%LUA%"
72+
echo ----------------------------------------
73+
74+
echo.
1275
echo fetching the veaf-mission-creation-tools package
1376
call npm update
77+
rem echo on
78+
79+
rem -- prepare the folders
80+
echo preparing the folders
81+
rd /s /q .\build
82+
mkdir .\build
83+
mkdir .\build\tempsrc
84+
85+
echo building the mission
86+
rem -- copy all the source mission files and mission-specific scripts
87+
xcopy /y /e src\mission .\build\tempsrc\ >nul 2>&1
88+
xcopy /y src\options .\build\tempsrc\ >nul 2>&1
89+
xcopy /y /e src\scripts\*.lua .\build\tempsrc\l10n\Default\ >nul 2>&1
90+
91+
rem -- set the radio presets according to the settings file
92+
echo set the radio presets according to the settings file
93+
pushd node_modules\veaf-mission-creation-tools\scripts\veaf
94+
"%LUA%" veafMissionRadioPresetsEditor.lua ..\..\..\..\build\tempsrc ..\..\..\..\src\radioSettings.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
95+
popd
96+
97+
rem -- copy the documentation images to the kneeboard
98+
xcopy /y /e doc\*.png .\build\tempsrc\KNEEBOARD\IMAGES\ >nul 2>&1
99+
100+
rem -- copy all the community scripts
101+
copy .\src\scripts\community\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
102+
copy .\node_modules\veaf-mission-creation-tools\scripts\community\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
103+
104+
rem -- copy all the common scripts
105+
copy .\node_modules\veaf-mission-creation-tools\scripts\veaf\*.lua .\build\tempsrc\l10n\Default >nul 2>&1
106+
107+
rem -- set the flags in the scripts according to the options
108+
powershell -Command "(gc .\build\tempsrc\l10n\Default\veaf.lua) -replace 'veaf.Development = false', 'veaf.Development = %VERBOSE_LOG_FLAG%' | sc .\build\tempsrc\l10n\Default\veaf.lua" >nul 2>&1
109+
powershell -Command "(gc .\build\tempsrc\l10n\Default\veaf.lua) -replace 'veaf.SecurityDisabled = false', 'veaf.SecurityDisabled = %SECURITY_DISABLED_FLAG%' | sc .\build\tempsrc\l10n\Default\veaf.lua" >nul 2>&1
110+
111+
rem -- normalize and prepare the version for night
112+
echo normalize and prepare the version for night
113+
pushd node_modules\veaf-mission-creation-tools\scripts\veaf
114+
"%LUA%" veafMissionNormalizer.lua ..\..\..\..\build\tempsrc ..\..\..\..\src\weatherAndTime-night.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
115+
popd
116+
117+
rem -- compile the mission
118+
"%SEVENZIP%" a -r -tzip %MISSION_FILE%-night.miz .\build\tempsrc\* -mem=AES256 >nul 2>&1
119+
120+
rem -- normalize and prepare the version for dawn
121+
echo normalize and prepare the version for dawn
122+
pushd node_modules\veaf-mission-creation-tools\scripts\veaf
123+
"%LUA%" veafMissionNormalizer.lua ..\..\..\..\build\tempsrc ..\..\..\..\src\weatherAndTime-dawn.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
124+
popd
125+
126+
rem -- compile the mission
127+
"%SEVENZIP%" a -r -tzip %MISSION_FILE%-dawn.miz .\build\tempsrc\* -mem=AES256 >nul 2>&1
128+
129+
rem -- normalize and prepare the version for noon
130+
echo normalize and prepare the version for noon
131+
pushd node_modules\veaf-mission-creation-tools\scripts\veaf
132+
"%LUA%" veafMissionNormalizer.lua ..\..\..\..\build\tempsrc ..\..\..\..\src\weatherAndTime-noon.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
133+
popd
134+
135+
rem -- compile the mission
136+
"%SEVENZIP%" a -r -tzip %MISSION_FILE%-noon.miz .\build\tempsrc\* -mem=AES256 >nul 2>&1
137+
138+
rem -- normalize and prepare the version for afternoon
139+
echo normalize and prepare the version for afternoon
140+
pushd node_modules\veaf-mission-creation-tools\scripts\veaf
141+
"%LUA%" veafMissionNormalizer.lua ..\..\..\..\build\tempsrc ..\..\..\..\src\weatherAndTime-afternoon.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
142+
popd
143+
144+
rem -- compile the mission
145+
"%SEVENZIP%" a -r -tzip %MISSION_FILE%-afternoon.miz .\build\tempsrc\* -mem=AES256 >nul 2>&1
146+
147+
rem -- normalize and prepare the version for dusk
148+
echo normalize and prepare the version for dusk
149+
pushd node_modules\veaf-mission-creation-tools\scripts\veaf
150+
"%LUA%" veafMissionNormalizer.lua ..\..\..\..\build\tempsrc ..\..\..\..\src\weatherAndTime-dusk.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
151+
popd
152+
153+
rem -- compile the mission
154+
"%SEVENZIP%" a -r -tzip %MISSION_FILE%-dusk.miz .\build\tempsrc\* -mem=AES256 >nul 2>&1
155+
156+
rem -- normalize and prepare the version for morning-storm
157+
echo normalize and prepare the version for morning-storm
158+
pushd node_modules\veaf-mission-creation-tools\scripts\veaf
159+
"%LUA%" veafMissionNormalizer.lua ..\..\..\..\build\tempsrc ..\..\..\..\src\weatherAndTime-morning-storm.lua %LUA_SCRIPTS_DEBUG_PARAMETER%
160+
popd
161+
162+
rem -- compile the mission
163+
"%SEVENZIP%" a -r -tzip %MISSION_FILE%-morning-storm.miz .\build\tempsrc\* -mem=AES256 >nul 2>&1
164+
165+
rem -- cleanup
166+
rd /s /q .\build\tempsrc
14167

15-
call build_one.cmd caucasus
16-
call build_one.cmd persiangulf
168+
echo.
169+
echo ----------------------------------------
170+
rem -- done !
171+
echo Built %MISSION_FILE%.miz
172+
echo ----------------------------------------
17173

18174
pause

build_one.cmd

-115
This file was deleted.

extract_one.cmd extract.cmd

+8-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
@echo off
2-
set VERSION=%1
3-
echo -
4-
echo ------------------------------
5-
echo extracting %VERSION%
6-
echo ------------------------------
2+
set MISSION_NAME=VEAF_OpenTraining_Caucasus
3+
echo.
4+
echo ----------------------------------------
5+
echo extracting %MISSION_NAME%
6+
echo ----------------------------------------
7+
echo.
78

89
rem -- default options values
910
echo This script can use these environment variables to customize its behavior :
@@ -21,7 +22,7 @@ echo current value is "%LUA_SCRIPTS_DEBUG_PARAMETER%"
2122
echo ----------------------------------------
2223
echo SEVENZIP (a string) points to the 7za executable
2324
echo defaults "7za", so it needs to be in the path
24-
IF ["%SEVENZIP%"] == [] GOTO DefineDefaultSEVENZIP
25+
IF [%SEVENZIP%] == [] GOTO DefineDefaultSEVENZIP
2526
goto DontDefineDefaultSEVENZIP
2627
:DefineDefaultSEVENZIP
2728
set SEVENZIP=7za
@@ -46,7 +47,7 @@ rem echo on
4647

4748
rem extracting MIZ files
4849
echo extracting MIZ files
49-
set MISSION_PATH=%cd%\src\%VERSION%\mission
50+
set MISSION_PATH=%cd%\src\mission
5051
"%SEVENZIP%" x -y *%MISSION_NAME%*.miz -o"%MISSION_PATH%\"
5152

5253
rem removing unwanted scripts

extract_caucasus.cmd

-2
This file was deleted.

extract_persiangulf.cmd

-2
This file was deleted.
File renamed without changes.

0 commit comments

Comments
 (0)