-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathjvnw.bat
More file actions
123 lines (108 loc) · 3.47 KB
/
jvnw.bat
File metadata and controls
123 lines (108 loc) · 3.47 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
@echo off
setlocal EnableExtensions DisableDelayedExpansion
set "gradlew=%~dp0gradlew.bat"
if not exist "%gradlew%" (
echo JVN wrapper error: missing "%gradlew%" 1>&2
exit /b 1
)
set "raw=0"
if "%JVN_WRAPPER_RAW%"=="1" set "raw=1"
if "%raw%"=="0" if "%~1"=="" goto help
if /I "%~1"=="--raw" (
set "raw=1"
shift
)
if "%raw%"=="0" (
if /I "%~1"=="help" goto help
if /I "%~1"=="-h" goto help
if /I "%~1"=="--help" goto help
if "%~1"=="" goto help
set "command=%~1"
shift
)
set "forwarded="
set "console_specified=0"
:collect_args
if "%~1"=="" goto dispatch
set "arg_unquoted=%~1"
if /I "%arg_unquoted%"=="--console" set "console_specified=1"
if /I "%arg_unquoted:~0,10%"=="--console=" set "console_specified=1"
set "forwarded=%forwarded% %1"
shift
goto collect_args
:dispatch
if "%raw%"=="1" goto run_raw
set "resolved="
if /I "%command%"=="launcher" set "resolved=:editor:runLauncher"
if /I "%command%"=="editor" set "resolved=:editor:run"
if /I "%command%"=="runtime" set "resolved=:runtime:run"
if /I "%command%"=="run" set "resolved=:runtime:run"
if /I "%command%"=="game" set "resolved=:runtime:run"
if /I "%command%"=="build" set "resolved=build"
if /I "%command%"=="test" set "resolved=test"
if /I "%command%"=="check" set "resolved=check"
if /I "%command%"=="clean" set "resolved=clean"
if /I "%command%"=="dist" set "resolved=assembleJvnGamePortableCurrent"
if /I "%command%"=="dist-all" set "resolved=assembleJvnGamePortable"
if /I "%command%"=="distAll" set "resolved=assembleJvnGamePortable"
if /I "%command%"=="portable-all" set "resolved=assembleJvnGamePortable"
if /I "%command%"=="portableAll" set "resolved=assembleJvnGamePortable"
if /I "%command%"=="jar" set "resolved=:runtime:jar"
set "console_arg=--console=plain"
if "%console_specified%"=="1" set "console_arg="
if /I "%command%"=="gradle" goto run_gradle
if defined resolved (
if defined console_arg (
call "%gradlew%" %console_arg% %resolved%%forwarded%
) else (
call "%gradlew%" %resolved%%forwarded%
)
exit /b %ERRORLEVEL%
)
if defined console_arg (
call "%gradlew%" %console_arg% %command%%forwarded%
) else (
call "%gradlew%" %command%%forwarded%
)
exit /b %ERRORLEVEL%
:run_gradle
if defined console_arg (
call "%gradlew%" %console_arg%%forwarded%
) else (
call "%gradlew%"%forwarded%
)
exit /b %ERRORLEVEL%
:run_raw
if defined forwarded (
call "%gradlew%"%forwarded%
) else (
call "%gradlew%"
)
exit /b %ERRORLEVEL%
:help
echo jvnw
echo.
echo Use jvnw for common tasks. Known commands map to Gradle tasks; everything else passes through.
echo.
echo Common commands:
echo jvnw launcher Run the standalone launcher
echo jvnw editor Run the editor
echo jvnw runtime Run the runtime
echo jvnw build Build the workspace
echo jvnw test Run the test suite
echo jvnw check Run verification tasks
echo jvnw clean Remove build outputs
echo jvnw dist -PjvnGameProject=^<dir^> Create a game zip for this OS/arch
echo jvnw dist-all -PjvnGameProject=^<dir^> Create game zips for every supported OS/arch
echo jvnw jar Build the runtime jar
echo.
echo Advanced usage:
echo jvnw gradle ^<gradle-args^> Pass through to Gradle with wrapper status output
echo jvnw --raw ^<gradle-args^> Call gradlew directly with full Gradle output
echo gradlew ^<gradle-task^> Optional low-level Gradle entrypoint
echo.
echo Examples:
echo jvnw launcher
echo jvnw runtime --args="--script scripts/story/prologue.vns"
echo jvnw gradle :editor:compileJava
exit /b 0