aboutsummaryrefslogtreecommitdiff
path: root/gradlew
diff options
context:
space:
mode:
authorCarl Mastrangelo <notcarl@google.com>2016-11-23 14:43:18 -0800
committerGitHub <noreply@github.com>2016-11-23 14:43:18 -0800
commit18e628ab1d9273aefe337f1144e38efb53c1b156 (patch)
tree4a69d24885a4473a520eaca5662c0577e32e8f06 /gradlew
parent0ec395dc300506b35caa7ba511fef33bfa084db6 (diff)
downloadgrpc-grpc-java-18e628ab1d9273aefe337f1144e38efb53c1b156.tar.gz
all: update to gradle 3.2
* all: update to gradle 3.2
Diffstat (limited to 'gradlew')
-rwxr-xr-xgradlew23
1 files changed, 15 insertions, 8 deletions
diff --git a/gradlew b/gradlew
index 27309d923..4ef3a871f 100755
--- a/gradlew
+++ b/gradlew
@@ -1,4 +1,4 @@
-#!/usr/bin/env bash
+#!/usr/bin/env sh
##############################################################################
##
@@ -154,11 +154,18 @@ if $cygwin ; then
esac
fi
-# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
-function splitJvmOpts() {
- JVM_OPTS=("$@")
-}
-eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
-JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
+# Escape application args
+for s in "${@}" ; do
+ s=\"$s\"
+ APP_ARGS=$APP_ARGS" "$s
+done
+
+# Collect all arguments for the java command, following the shell quoting and substitution rules
+eval set -- "$DEFAULT_JVM_OPTS" "$JAVA_OPTS" "$GRADLE_OPTS" "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
+
+# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong
+if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then
+ cd "$(dirname "$0")"
+fi
-exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
+exec "$JAVACMD" "$@"