From be3e84bd0983f01dde5c44f4eb8f749a12ad2159 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Thu, 12 May 2016 10:20:24 +0200 Subject: Add dotty runner script able to run dotty-compiled class with `main` --- bin/dotty | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 bin/dotty (limited to 'bin') diff --git a/bin/dotty b/bin/dotty new file mode 100755 index 000000000..3d8a6697a --- /dev/null +++ b/bin/dotty @@ -0,0 +1,25 @@ +#!/bin/bash + +# Try to autodetect real location of the script +DOTTY_ROOT="`readlink \"$0\"`" # relative, symbolic links resolved +if [[ "$DOTTY_ROOT" == "" ]]; then + DOTTY_ROOT="$0" +fi +DOTTY_ROOT="`dirname \"$DOTTY_ROOT\"`" +DOTTY_ROOT="`( cd \"$DOTTY_ROOT\" && pwd )`/.." # absolute + +# CLASS_PATH is derived from the DOTTY_ROOT +CLASS_PATH="-J-Xbootclasspath/a:.:$DOTTY_ROOT/target/scala-2.11/classes/" + +function runMain { + scala $CLASS_PATH $@ +} + +if [ -z "$1" ]; then + echo "usage: $0 MainClass args" + echo "" + echo " missing class argument" + exit 1 +else + runMain "$@" +fi -- cgit v1.2.3