aboutsummaryrefslogtreecommitdiff
path: root/sbt
diff options
context:
space:
mode:
authorJosh Rosen <joshrosen@apache.org>2013-12-15 18:39:30 -0800
committerJosh Rosen <joshrosen@apache.org>2013-12-15 18:51:31 -0800
commitf8ba89da217a1f1fd5c856a95a27a3e535017643 (patch)
tree746c7e73e63aed04303a3c17da64ccde959b6366 /sbt
parentd2ced6d58c5e8aea23f909c2fc4ac11aa1b55607 (diff)
downloadspark-f8ba89da217a1f1fd5c856a95a27a3e535017643.tar.gz
spark-f8ba89da217a1f1fd5c856a95a27a3e535017643.tar.bz2
spark-f8ba89da217a1f1fd5c856a95a27a3e535017643.zip
Fix Cygwin support in several scripts.
This allows the spark-shell, spark-class, run-example, make-distribution.sh, and ./bin/start-* scripts to work under Cygwin. Note that this doesn't support PySpark under Cygwin, since that requires many additional `cygpath` calls from within Python and will be non-trivial to implement. This PR was inspired by, and subsumes, #253 (so close #253 after this is merged).
Diffstat (limited to 'sbt')
-rwxr-xr-xsbt/sbt21
1 files changed, 18 insertions, 3 deletions
diff --git a/sbt/sbt b/sbt/sbt
index c31a0280ff..5942280585 100755
--- a/sbt/sbt
+++ b/sbt/sbt
@@ -17,12 +17,27 @@
# limitations under the License.
#
-EXTRA_ARGS=""
+cygwin=false
+case "`uname`" in
+ CYGWIN*) cygwin=true;;
+esac
+
+EXTRA_ARGS="-Xmx1200m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=256m"
if [ "$MESOS_HOME" != "" ]; then
- EXTRA_ARGS="-Djava.library.path=$MESOS_HOME/lib/java"
+ EXTRA_ARGS="$EXTRA_ARGS -Djava.library.path=$MESOS_HOME/lib/java"
fi
export SPARK_HOME=$(cd "$(dirname $0)/.." 2>&1 >/dev/null ; pwd)
export SPARK_TESTING=1 # To put test classes on classpath
-java -Xmx1200m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=256m $EXTRA_ARGS $SBT_OPTS -jar "$SPARK_HOME"/sbt/sbt-launch-*.jar "$@"
+SBT_JAR="$SPARK_HOME"/sbt/sbt-launch-*.jar
+if $cygwin; then
+ SBT_JAR=`cygpath -w $SBT_JAR`
+ export SPARK_HOME=`cygpath -w $SPARK_HOME`
+ EXTRA_ARGS="$EXTRA_ARGS -Djline.terminal=jline.UnixTerminal -Dsbt.cygwin=true"
+ stty -icanon min 1 -echo > /dev/null 2>&1
+ java $EXTRA_ARGS $SBT_OPTS -jar $SBT_JAR "$@"
+ stty icanon echo > /dev/null 2>&1
+else
+ java $EXTRA_ARGS $SBT_OPTS -jar $SBT_JAR "$@"
+fi \ No newline at end of file