2013-10-23 19:21:31 +00:00
|
|
|
#!/usr/bin/env bash
|
2012-04-10 09:47:47 +00:00
|
|
|
|
|
|
|
|
# we want jruby-complete to take care of all things ruby
|
|
|
|
|
unset GEM_HOME
|
|
|
|
|
unset GEM_PATH
|
|
|
|
|
|
2023-12-18 10:58:18 -06:00
|
|
|
JAVA_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"
|
2015-09-24 11:48:01 -07:00
|
|
|
|
2025-03-18 13:55:35 -07:00
|
|
|
# This code supports both:
|
|
|
|
|
# ./go "namespace:task[--arg1,--arg2]" --rake-flag
|
|
|
|
|
# ./go namespace:task --arg1 --arg2 -- --rake-flag
|
|
|
|
|
|
2025-03-16 11:22:35 -07:00
|
|
|
# The first argument is always the Rake task name
|
|
|
|
|
task="$1"
|
|
|
|
|
shift
|
|
|
|
|
|
2025-03-18 13:55:35 -07:00
|
|
|
# Initialize arrays for rake flags and task arguments
|
|
|
|
|
rake_flags=()
|
|
|
|
|
task_args=()
|
2025-03-16 11:22:35 -07:00
|
|
|
|
2025-03-18 13:55:35 -07:00
|
|
|
# Arguments before -- are task arguments
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
|
if [ "$1" = "--" ]; then
|
|
|
|
|
shift
|
|
|
|
|
break
|
2025-03-16 11:22:35 -07:00
|
|
|
fi
|
2025-03-18 13:55:35 -07:00
|
|
|
task_args+=("$1")
|
|
|
|
|
shift
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
# Remaining arguments are rake flags
|
|
|
|
|
rake_flags=("$@")
|
|
|
|
|
|
|
|
|
|
# If we have task args, format them
|
|
|
|
|
if [ ${#task_args[@]} -gt 0 ]; then
|
|
|
|
|
# Convert task args array to comma-separated string
|
|
|
|
|
args=$(IFS=','; echo "${task_args[*]}")
|
|
|
|
|
task="$task[$args]"
|
|
|
|
|
echo "Executing rake task: $task"
|
2025-03-16 11:22:35 -07:00
|
|
|
fi
|
|
|
|
|
|
2012-04-10 09:47:47 +00:00
|
|
|
|
2025-03-18 13:55:35 -07:00
|
|
|
java $JAVA_OPTS -jar third_party/jruby/jruby-complete.jar -X-C -S rake $task "${rake_flags[@]}"
|