File tree Expand file tree Collapse file tree 2 files changed +58
-4
lines changed Expand file tree Collapse file tree 2 files changed +58
-4
lines changed Original file line number Diff line number Diff line change @@ -6,5 +6,23 @@ unset GEM_PATH
66
77JAVA_OPTS=" -client -Xmx4096m -XX:ReservedCodeCacheSize=512m -XX:MetaspaceSize=1024m --add-modules java.se --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/javax.crypto=ALL-UNNAMED"
88
9- java $JAVA_OPTS -jar third_party/jruby/jruby-complete.jar -X-C -S rake $*
9+ # The first argument is always the Rake task name
10+ task=" $1 "
11+
12+ # Shift the task off and get the remaining arguments
13+ shift
14+
15+ # Leave task alone if already passing in arguments the normal way
16+ if [[ " $task " != * [* ]* ]]; then
17+ # Combine remaining arguments into a single string, clean up spaces after commas, and replace spaces with commas
18+ args=$( IFS=' ' ; echo " $* " | sed -e ' s/,[ ]*/,/g' -e ' s/ /,/g' )
19+
20+ # If there are any arguments, format them as task[arg1,arg2,...]
21+ if [ -n " $args " ]; then
22+ task=" $task [$args ]"
23+ echo " Executing rake task: $task "
24+ fi
25+ fi
26+
27+ java $JAVA_OPTS -jar third_party/jruby/jruby-complete.jar -X-C -S rake $task
1028
Original file line number Diff line number Diff line change 11@ echo off
2- SETLOCAL
2+ SETLOCAL EnableDelayedExpansion
33
44REM we want jruby-complete to take care of all things ruby
55SET GEM_HOME =
66SET GEM_PATH =
77
8- SET JAVA_OPTS = -client -Xmx4096m -XX:ReservedCodeCacheSize=512m --add-modules java.se --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/javax.crypto=ALL-UNNAMED
8+ REM The first argument is always the Rake task name
9+ SET task = %1
910
10- java %JAVA_OPTS% -jar third_party\jruby\jruby-complete.jar -X-C -S rake %*
11+ REM Check for arguments
12+ IF " %task% " == " " (
13+ echo No task specified
14+ exit /b 1
15+ )
16+
17+ REM Shift the task off and get the remaining arguments
18+ SHIFT
19+
20+ REM Leave task alone if already passing in arguments the normal way
21+ ECHO %task% | FINDSTR /C:" [" > NUL
22+ IF %ERRORLEVEL% EQU 0 (
23+ GOTO execute
24+ )
25+
26+ REM Process remaining arguments
27+ SET args =
28+ :process_args
29+ IF " %1 " == " " GOTO done_args
30+ IF " !args! " == " " (
31+ SET args = %1
32+ ) ELSE (
33+ SET args = !args! ,%1
34+ )
35+ SHIFT
36+ GOTO process_args
37+
38+ :done_args
39+ REM If there are any arguments, format them as task[arg1,arg2,...]
40+ IF NOT " !args! " == " " (
41+ SET task = %task% [!args! ]
42+ ECHO Executing rake task: %task%
43+ )
44+
45+ :execute
46+ java %JAVA_OPTS% -jar third_party\jruby\jruby-complete.jar -X-C -S rake %task%
You can’t perform that action at this time.
0 commit comments