-
Notifications
You must be signed in to change notification settings - Fork 1
/
BuildAndDeploy.bat
55 lines (47 loc) · 1.77 KB
/
BuildAndDeploy.bat
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
@echo on
REM Set variables based on arguments passed to the script
set projectName=%1
set buildPath=%2
set projectDir=%3
set targetDir=%4
set Configuration=%~5
set subnauticaFolder=D:\Steam\steamapps\common\Subnautica\BepInEx\plugins\%projectName%.%Configuration%\
set subnauticaZeroFolder=D:\Steam\steamapps\common\SubnauticaZero\BepInEx\plugins\%projectName%.%Configuration%\
set zipDestination=%3..\Download\%Configuration%\%projectName%.%Configuration%.zip
REM Debugging: Echo paths to verify
echo projectName=%projectName%
echo buildPath=%buildPath%
echo projectDir=%projectDir%
echo targetDir=%targetDir%
echo Configuration=%Configuration%
REM Determine the correct folder based on Configuration
if "%Configuration%"=="SN" (
set targetFolder=%subnauticaFolder%
) else if "%Configuration%"=="BZ" (
set targetFolder=%subnauticaZeroFolder%
) else (
echo "Unknown Configuration: %Configuration%"
pause
exit /b 1
)
echo targetFolder=%targetFolder%
REM Create directories if they do not exist
if not exist "%targetFolder%\Assets" (
mkdir "%targetFolder%\Assets"
)
REM Copy build files
xcopy "%buildPath%" "%targetFolder%" /y
xcopy "%projectDir%*.json" "%targetFolder%" /y
xcopy "%projectDir%Assets\*.asset" "%targetFolder%\Assets\" /y
xcopy "%projectDir%Assets\*.manifest" "%targetFolder%\Assets\" /y
xcopy "%projectDir%Assets\*.png" "%targetFolder%\Assets\" /y
REM Copy AD3D_Common.dll file
xcopy "%targetDir%\AD3D_Common.dll" "%targetFolder%" /y
xcopy "%targetDir%\Assets\*.asset" "%targetFolder%\Assets\" /y
xcopy "%targetDir%\Assets\*.manifest" "%targetFolder%\Assets\" /y
xcopy "%targetDir%\Assets\*.png" "%targetFolder%\Assets\" /y
REM Zip the mod folder
7z a -tzip "%zipDestination%" "%targetFolder%" -mx9
REM Notify completion
echo Mod build and deployment complete.
pause