Project:
Kauri
Code Location:
http://dev.outerthought.org/svn_public/outerthought_kauri/trunk/trunk
kauri.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
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
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
@echo off rem rem Kauri Runtime startup script for use during Kauri development rem meaning: there is no KAURI_HOME, Kauri artifacts are in dev's local Maven repo rem rem You can use the following environment variables to customize the startup rem rem KAURI_CLI_CLASSPATH rem additional entries to be added to the classpath rem rem KAURI_JAVA_ARGS rem additional options to be passed to the java executable rem rem KAURI_DEBUG_ARGS rem can be used to define alternative Java debug arguments rem rem KAURI_DEBUG_SUSPEND_ARGS rem can be used to define alternative Java debug arguments for suspended mode rem rem Disclaimer: this script is based on stuff from Apache Cocoon's 'cocoon.bat' script rem :: ----- Verify and Set Required Environment Variables ------------------------- if not "%JAVA_HOME%"=="" goto gotJavaHome echo JAVA_HOME not set! goto end :gotJavaHome :: ----- Find out home dir of this script -------------------------------------- if not "%KAURI_SRC_HOME%"=="" goto gotKauriSrcHome rem %~dp0 is expanded pathname of the current script under NT set KAURI_SRC_HOME=%~dp0 :gotKauriSrcHome :: ----- Check System Properties ----------------------------------------------- set LAUNCHER_JAR=%KAURI_SRC_HOME%\core\kauri-runtime-launcher\target\kauri-runtime-launcher.jar IF EXIST %LAUNCHER_JAR% goto launcherJarExists echo Launcher jar not found at %LAUNCHER_JAR% echo Please build Kauri first using 'mvn install' goto end :launcherJarExists set CLASSPATH=%LAUNCHER_JAR% rem Only add KAURI_CLI_CLASSPATH when it is not empty, to avoid adding the working dir to rem the classpath by accident. if "%KAURI_CLI_CLASSPATH%"=="" goto noExtraClassPath set CLASSPATH=%CLASSPATH%;%KAURI_CLI_CLASSPATH% :noExtraClassPath if not "%KAURI_DEBUG_ARGS%"=="" goto gotKauriDebugArgs set KAURI_DEBUG_ARGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 :gotKauriDebugArgs if not "%KAURI_DEBUG_SUSPEND_ARGS%"=="" goto gotKauriDebugSuspendArgs set KAURI_DEBUG_SUSPEND_ARGS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=5005 :gotKauriDebugSuspendArgs :: ----- Build params to forward to Kauri -------------------------------------- set action=%1 set param= shift :cliLoop if "%1"=="" goto cliLoopEnd if not "%1"=="" set param=%param% %1 shift goto cliLoop :cliLoopEnd :: ----- Check action ---------------------------------------------------------- if ""%action%"" == """" goto doRun if ""%action%"" == ""run"" goto doRun if ""%action%"" == ""debug"" goto doDebug if ""%action%"" == ""debug-suspend"" goto doDebugSuspend echo Usage: kauri (action) echo actions: echo run Run the Kauri Runtime (default) echo debug Run the Kauri Runtime, listed to debugger on port 5005 echo debug-suspend Run the Kauri Runtime, suspend for debugger on port 5005 echo: echo To see help options for Kauri, use kauri run -h echo To pass options to Kauri, use kauri run {options} goto end :doRun "%JAVA_HOME%/bin/java" %KAURI_JAVA_ARGS% org.kauriproject.launcher.RuntimeCliLauncher %param% goto end :doDebug "%JAVA_HOME%/bin/java" %KAURI_JAVA_ARGS% %KAURI_DEBUG_ARGS% org.kauriproject.launcher.RuntimeCliLauncher %param% goto end :doDebugSuspend echo: echo Don't forget: you'll need to connect with a debugger for Kauri to start echo: "%JAVA_HOME%/bin/java" %KAURI_JAVA_ARGS% %KAURI_DEBUG_SUSPEND_ARGS% org.kauriproject.launcher.RuntimeCliLauncher %param% goto end :end if "%_EXIT_ERRORLEVEL%"=="true" exit %ERRORLEVEL%
