diff --git a/README.md b/README.md index c8e84ba..5854c5e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,9 @@ clojure-1.3.0-alpha1.jar needs to be placed in a directory `lib` under this project. You can use Leiningen (http://github.com/technomancy/leiningen) to -automatically install the Clojure jar in the right place. +automatically install the Clojure jar in the right place. Leiningen will also +get you a couple more jarfiles, including JLine, which allows you some of the +functionality of readline (command-line history, for example). After you have leiningen installed, run diff --git a/project.clj b/project.clj index 632026e..2c29b73 100644 --- a/project.clj +++ b/project.clj @@ -1,3 +1,4 @@ (defproject functional-koans "0.1.0" :description "The functional koans" - :dependencies [[org.clojure/clojure "1.3.0-alpha1"]]) + :dependencies [[org.clojure/clojure "1.3.0-alpha1"] + [jline "0.9.94"]]) diff --git a/repl.bat b/repl.bat index 2964cfc..e539881 100755 --- a/repl.bat +++ b/repl.bat @@ -1,2 +1,13 @@ @echo off -java -jar lib\clojure-1.3.0-alpha1.jar +setLocal EnableDelayedExpansion +set CLASSPATH=" +for /R ./lib %%a in (*.jar) do ( + set CLASSPATH=!CLASSPATH!;%%a +) +set CLASSPATH=!CLASSPATH!" +set CLASSPATH=%CLASSPATH%;src + +set JLINE=jline.ConsoleRunner + +java -Xmx1G -cp "%CLASSPATH%" %JLINE% clojure.main + diff --git a/repl.sh b/repl.sh index 4f49c82..d85108c 100755 --- a/repl.sh +++ b/repl.sh @@ -1,2 +1,8 @@ -java -jar lib/clojure-1.3.0-alpha1.jar -echo +#!/bin/sh +CLASSPATH=src + +for f in lib/*.jar; do + CLASSPATH=$CLASSPATH:$f +done + +java -Xmx1G -cp $CLASSPATH jline.ConsoleRunner clojure.main diff --git a/run.bat b/run.bat index 6c884c6..ca5f466 100755 --- a/run.bat +++ b/run.bat @@ -1,2 +1,11 @@ @echo off -java -cp lib\clojure-1.3.0-alpha1.jar;src clojure.main -e "(load \"path_to_enlightenment\")" -e "(do (in-ns 'path-to-enlightenment) (run))" +setLocal EnableDelayedExpansion +set CLASSPATH=" +for /R ./lib %%a in (*.jar) do ( + set CLASSPATH=!CLASSPATH!;%%a +) +set CLASSPATH=!CLASSPATH!" +set CLASSPATH=%CLASSPATH%;src + +java -Xmx1G -cp "%CLASSPATH%" clojure.main -e "(load \"path_to_enlightenment\")" -e "(do (in-ns 'path-to-enlightenment) (run))" + diff --git a/run.sh b/run.sh index c3036c8..f1364a5 100755 --- a/run.sh +++ b/run.sh @@ -1,2 +1,9 @@ -java -cp lib/clojure-1.3.0-alpha1.jar:src clojure.main -e '(load "path_to_enlightenment")' -e "(do (in-ns 'path-to-enlightenment) (run))" +#!/bin/sh +CLASSPATH=src + +for f in lib/*.jar; do + CLASSPATH=$CLASSPATH:$f +done + +java -cp "$CLASSPATH" clojure.main -e '(load "path_to_enlightenment")' -e "(do (in-ns 'path-to-enlightenment) (run))" echo diff --git a/test.bat b/test.bat index f15ba8f..0314e35 100755 --- a/test.bat +++ b/test.bat @@ -1,2 +1,9 @@ @echo off -java -cp lib\clojure-1.3.0-alpha1.jar;src clojure.main -e "(load \"path_to_answer_sheet\")" -e "(do (in-ns 'path-to-answer-sheet) (run))" +setLocal EnableDelayedExpansion +set CLASSPATH=" +for /R ./lib %%a in (*.jar) do ( + set CLASSPATH=!CLASSPATH!;%%a +) +set CLASSPATH=!CLASSPATH!" + +java -Xmx1G -cp "%CLASSPATH%" clojure.main -e "(load \"path_to_answer_sheet\")" -e "(do (in-ns 'path-to-answer-sheet) (run))" diff --git a/test.sh b/test.sh index c387cd3..fd142a0 100755 --- a/test.sh +++ b/test.sh @@ -1,2 +1,9 @@ -java -cp lib/clojure-1.3.0-alpha1.jar:src clojure.main -e '(load "path_to_answer_sheet")' -e "(do (in-ns 'path-to-answer-sheet) (run))" +#!/bin/sh +CLASSPATH=src + +for f in lib/*.jar; do + CLASSPATH=$CLASSPATH:$f +done + +java -cp "$CLASSPATH" clojure.main -e '(load "path_to_answer_sheet")' -e "(do (in-ns 'path-to-answer-sheet) (run))" echo