diff --git a/build.gradle b/build.gradle index 959268a..23601c2 100644 --- a/build.gradle +++ b/build.gradle @@ -66,6 +66,7 @@ task fatJar(type:Jar) { } baseName = 'lj-all' from { configurations.compile.collect { it.isDirectory() ? it : zipTree(it) } } + from files(project('ljwrappers').sourceSets.main.runtimeClasspath) with jar } diff --git a/distribution/compile.sh b/distribution/compile.sh deleted file mode 100755 index 197f1ec..0000000 --- a/distribution/compile.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -java -jar lj.jar $1 diff --git a/distribution/hello.lj b/distribution/hello.lj new file mode 120000 index 0000000..ad7e9fb --- /dev/null +++ b/distribution/hello.lj @@ -0,0 +1 @@ +../tests/io/hello-world.lj \ No newline at end of file diff --git a/distribution/lj b/distribution/lj new file mode 100755 index 0000000..784c257 --- /dev/null +++ b/distribution/lj @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# vim: set filetype=bash + +help() { + echo "Usage: $0 [options] file" + echo "" + echo " Options:" + echo " -h Print this help message and exit" + echo " -t Print type changes found by type inference" +} + +args="run" +verbose=false +while getopts :thv flag; do + case $flag in + h) + help + exit + ;; + t) + args="${args} -PprintTypeChanges" + ;; + \?) + echo "Unrecognized option $OPTARG" 1>&2 + echo + help + exit + ;; + esac +done +shift $((OPTIND - 1)) + +if ! $verbose; then + args="${args} -q" +fi + +if [ $# == 0 ]; then + echo "Expecting a file" 1>&2 + echo + help + exit +fi + +args="${args} ${1}" +java -jar lj.jar ${args} +base=$(basename $1) +upbase="$(tr '[:lower:]' '[:upper:]' <<< ${base:0:1})${base:1}" +name="LJ${upbase%.*}" +java -cp "generated:lj.jar" $name +exit diff --git a/distribution/lj.jar b/distribution/lj.jar index c19b1ee..8957144 100644 Binary files a/distribution/lj.jar and b/distribution/lj.jar differ diff --git a/distribution/lj.zip b/distribution/lj.zip deleted file mode 100644 index 7ffdb60..0000000 Binary files a/distribution/lj.zip and /dev/null differ diff --git a/distribution/run.sh b/distribution/run.sh deleted file mode 100755 index 729d8ff..0000000 --- a/distribution/run.sh +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/bash -java -cp generated Main diff --git a/distribution/test.sh b/distribution/test.sh deleted file mode 100755 index a780da2..0000000 --- a/distribution/test.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash - -printf "Compiling...\n" -if javac -cp .:lj.jar generated/Main.java; then - printf "Testing...\n" - java -cp .:generated:lj.jar org.junit.runner.JUnitCore Main -fi -