forked from zepheira/babel
-
Notifications
You must be signed in to change notification settings - Fork 1
/
babel.bat
124 lines (94 loc) · 2.84 KB
/
babel.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
117
118
119
120
121
122
123
124
@echo off
rem
rem Configuration variables
rem
rem JAVA_HOME
rem Home of Java installation.
rem
rem JAVA_OPTIONS
rem Extra options to pass to the JVM
rem
rem --- First two utilities for exiting --------------------------------------------
goto endUtils
:usage
echo Usage: %0 [options]
echo where [options] include:
echo.
echo /h print this message and exit
echo.
echo /a _action_ is what to do, the default is run
echo supported _action_s are:
echo run Run longwell
echo debug Run longwell and turn on JVM remote debug
echo profile Run longwell and turn on JVM profiling with HProf
echo shark Run longwell and turn on JVM profiling with Apple Shark (MacOSX only)
echo yourkit Run longwell and turn on JVM profiling with YourKit
echo jmx Run longwell and turn on JVM monitoring with JMX and JConsole
echo.
goto end
:fail
echo See: '%0 /h' for usage.
goto end
:endUtils
if not "%JAVA_HOME%" == "" goto gotJavaHome
echo You must set JAVA_HOME to point at your Java Development Kit installation
goto fail
:gotJavaHome
set MAVEN_OPTS=-Djava.awt.headless=true
set ACTION=run
rem --- Argument parsing --------------------------------------------
:loop
if ""%1"" == """" goto endArgumentParsing
if ""%1"" == ""/h"" goto usage
if ""%1"" == ""/a"" goto arg-a
echo ERROR: Unknown Argument: '%1'
goto fail
:arg-a
set ACTION="$2"
goto shift2loop
:shift2loop
shift
shift
goto loop
:endArgumentParsing
rem --- Fold in Environment Vars --------------------------------------------
if not "%JAVA_OPTIONS%" == "" goto gotJavaOptions
set JAVA_OPTIONS=-Xms32M -Xmx256M
:gotJavaOptions
set MAVEN_OPTS=%MAVEN_OPTS% %JAVA_OPTIONS%
if not "%JETTY_PORT%" == "" goto gotJettyPort
set JETTY_PORT=8080
:gotJettyPort
set MAVEN_OPTS=%MAVEN_OPTS% -Djetty.port=%JETTY_PORT%
rem ----- Respond to the action ----------------------------------------------------------
if ""%ACTION%"" == ""run"" goto doRun
if ""%ACTION%"" == ""debug"" goto doDebug
if ""%ACTION%"" == ""profile"" goto doProfile
if ""%ACTION%"" == ""shark"" goto doShark
if ""%ACTION%"" == ""yourkit"" goto doYourKit
if ""%ACTION%"" == ""jmx"" goto doJMX
:doRun
goto doIt
:doDebug
set MAVEN_OPTS=%MAVEN_OPTS% -Xdebug -Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n
goto doIt
:doProfile
set MAVEN_OPTS=%MAVEN_OPTS% -Xrunhprof:heap=all,cpu=samples,thread=y,depth=3
goto doIt
:doShark
set MAVEN_OPTS=%MAVEN_OPTS% -Xrunshark
goto doIt
:doYourKit
set MAVEN_OPTS=%MAVEN_OPTS% -agentlib:yjpagent
goto doIt
:doJMX
set MAVEN_OPTS=%MAVEN_OPTS% -Dcom.sun.management.jmxremote
goto doIt
:doIt
echo [INFO]: MAVEN_OPTS=%MAVEN_OPTS%
if not "%MAVEN_PARAMS%" == "" goto withMavenParams
mvn jetty:run
goto end
:withMavenParams
mvn %MAVEN_PARAMS% jetty:run
:end