forked from devendrn/newb-x-mcbe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.bat
74 lines (62 loc) · 1.53 KB
/
build.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
@echo off
set MBT=env\bin\MaterialBinTool-0.8.1-native-image.exe
set SHADERC=env\bin\shaderc.exe
set MBT_ARGS=--compile --shaderc %SHADERC% --include include/
set DATA_VER=1.20.10
set DATA_DIR=data/%DATA_VER%
set BUILD_DIR=build
set MATERIALS_DIR=materials
set MATERIALS=
set TARGETS=
set ARG_MODE=
:loop_args
if "%1" == "" goto :end_args
if "%1" == "-p" goto :set_arg
if "%1" == "-t" goto :set_arg
if "%1" == "-m" goto :set_arg
if "%ARG_MODE%" == "" (
if "%1" == "deferred" set MATERIALS_DIR=materials-deferred
goto :next_arg
)
if "%ARG_MODE%" == "-p" (
set TARGETS=%TARGETS% %1
goto :next_arg
)
if "%ARG_MODE%" == "-m" (
set MATERIALS=%MATERIALS% %MATERIALS_DIR%\%1
goto :next_arg
)
if "%ARG_MODE%" == "-t" (
set THREADS=%1
goto :next_arg
)
:set_arg
set ARG_MODE=%1
:next_arg
shift
goto :loop_args
:end_args
if "%TARGETS%" == "" (
set TARGETS=windows
)
if "%MATERIALS%" == "" (
set MATERIALS=%MATERIALS_DIR%\*
)
if "%THREADS%" == "" (
set THREADS=%NUMBER_OF_PROCESSORS%
)
set MBT_ARGS=%MBT_ARGS% --threads %THREADS%
for %%f in (%MBT%) do echo %%~nxf
for %%p in (%TARGETS%) do (
echo ---------------------------
if exist %DATA_DIR%\%%p (
echo Building materials: target=%%p
for /d %%s in (%MATERIALS%) do (
echo.
echo - %%s
%MBT% %MBT_ARGS% --output %BUILD_DIR%\%%p --data %DATA_DIR%\%%p\%%~nxs %%s
)
) else (
echo Build aborted for %%p: %DATA%\%%p not found
)
)