diff --git a/README.TXT b/README.TXT index 5f09259..706c259 100644 --- a/README.TXT +++ b/README.TXT @@ -29,19 +29,7 @@ Build ===== To build: - - Copy clojure.jar to: ./liverepl-server/lib/clojure.jar - - Run ant - -The build will be copied to: ./build/ - ----------------------------------------- - -Configuration -============= - -Edit liverepl.bat to point to your installed JDK + lein uberjar ---------------------------------------- @@ -51,18 +39,18 @@ Operation To see a list of running Java processes on the system, and their process ids, enter: - liverepl + lein run To see the available ClassLoaders for a specific process, enter: - liverepl + lein run -- where the pid is the process id for the process, obtained in the step above. To connect a repl to the process, enter: - liverepl + lein run -- where the pid is the process id for the process. -- and the classloader-id was obtained in the step above. diff --git a/build.xml b/build.xml deleted file mode 100644 index 07a2908..0000000 --- a/build.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/liverepl-agent/build.xml b/liverepl-agent/build.xml deleted file mode 100644 index 312fe7b..0000000 --- a/liverepl-agent/build.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/liverepl-agent/lib/empty.dir b/liverepl-agent/lib/empty.dir deleted file mode 100644 index e69de29..0000000 diff --git a/liverepl-agent/src/META-INF/MANIFEST.MF b/liverepl-agent/src/META-INF/MANIFEST.MF deleted file mode 100644 index c90400e..0000000 --- a/liverepl-agent/src/META-INF/MANIFEST.MF +++ /dev/null @@ -1,3 +0,0 @@ -Manifest-Version: 1.0 -Agent-Class: net.djpowell.liverepl.agent.Agent -Main-Class: net.djpowell.liverepl.client.Main diff --git a/liverepl-server/build.xml b/liverepl-server/build.xml deleted file mode 100644 index 398a0b4..0000000 --- a/liverepl-server/build.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/liverepl-server/lib/put-clojure.jar-here b/liverepl-server/lib/put-clojure.jar-here deleted file mode 100644 index e69de29..0000000 diff --git a/liverepl-server/src/META-INF/MANIFEST.MF b/liverepl-server/src/META-INF/MANIFEST.MF deleted file mode 100644 index 9d885be..0000000 --- a/liverepl-server/src/META-INF/MANIFEST.MF +++ /dev/null @@ -1 +0,0 @@ -Manifest-Version: 1.0 diff --git a/liverepl.bat b/liverepl.bat deleted file mode 100644 index 18ca4ee..0000000 --- a/liverepl.bat +++ /dev/null @@ -1,8 +0,0 @@ -@echo off -rem Starter script for Clojure liverepl - -set JDK_HOME=c:\jdk -set LIVEREPL_HOME=%~dp0 -set CLOJURE_JAR=%LIVEREPL_HOME%\clojure.jar - -"%JDK_HOME%\bin\java" -cp "%LIVEREPL_HOME%\liverepl-agent.jar";"%JDK_HOME%\lib\tools.jar" net.djpowell.liverepl.client.Main "%CLOJURE_JAR%" "%LIVEREPL_HOME%\liverepl-agent.jar" "%LIVEREPL_HOME%\liverepl-server.jar" %* diff --git a/liverepl.sh b/liverepl.sh deleted file mode 100755 index 3b005a3..0000000 --- a/liverepl.sh +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/sh -# Starter script for Clojure liverepl - -[ -z "$JDK_HOME" ] && JDK_HOME=/usr/lib/jvm/default-java -LIVEREPL_HOME="$(cd -P -- "$(dirname -- "$0")" && pwd -P)" - -MAIN=net.djpowell.liverepl.client.Main -CLOJURE_JAR=$(find $LIVEREPL_HOME/build -name 'clojure-*[0-9].jar' | head -1) -AGENT_JAR="$LIVEREPL_HOME/build/liverepl-agent.jar" -SERVER_JAR="$LIVEREPL_HOME/build/liverepl-server.jar" - - -if [ "Darwin" = "`uname -s`" ]; then - CLASSPATH="${CLASSPATH}${JAVA_HOME}/bundle/Classes/classes.jar" -elif [ ! -f "$JDK_HOME/lib/tools.jar" ]; then - echo 'Unable to find $JDK_HOME/lib/tools.jar' - echo "Please set the JDK_HOME environment variable to the location of your JDK." - exit 1 -else - CLASSPATH="${CLASSPATH}${JDK_HOME}/lib/tools.jar" -fi - -if [ "$TERM" != "dumb" ]; then - if which rlwrap >/dev/null ; then - echo "Found rlwrap" - breakchars="(){}[],^%$#@\"\";:''|\\" - WRAP="exec rlwrap --remember -c -b \"$breakchars\" " - fi -fi - -CLASSPATH="$CLASSPATH:$AGENT_JAR" - -${WRAP}java -cp $CLASSPATH $MAIN "$CLOJURE_JAR" "$AGENT_JAR" "$SERVER_JAR" "$@" - - - diff --git a/nrepl.clj b/nrepl.clj new file mode 100644 index 0000000..f91996f --- /dev/null +++ b/nrepl.clj @@ -0,0 +1,6 @@ +(use '[clojure.tools.nrepl.server :only (start-server stop-server)]) +(defn nrepl-handler [] + (require 'cider.nrepl) + (ns-resolve 'cider.nrepl 'cider-nrepl-handler)) +(defonce server (start-server :port 7889 + :handler (nrepl-handler))) diff --git a/project.clj b/project.clj new file mode 100644 index 0000000..6321d2e --- /dev/null +++ b/project.clj @@ -0,0 +1,11 @@ +(defproject liverepl "1.2.0-SNAPSHOT" + :dependencies [[org.clojure/clojure "1.7.0"] + [org.clojure/tools.nrepl "0.2.12"] + [clojure-complete "0.2.3"] + [cider/cider-nrepl "0.18.0-SNAPSHOT"]] + :java-source-paths ["liverepl-agent/src" "liverepl-server/src"] + :manifest {"Agent-Class" "net.djpowell.liverepl.agent.Agent" + "Main-Class" "net.djpowell.liverepl.client.Main"} + :uberjar-name "liverepl.jar" + :main liverepl.main + :plugins [[lein-jdk-tools "0.1.1"]]) diff --git a/src/liverepl/main.clj b/src/liverepl/main.clj new file mode 100644 index 0000000..a60645d --- /dev/null +++ b/src/liverepl/main.clj @@ -0,0 +1,14 @@ +(ns liverepl.main) + +(defn- liverepl-jar-path [] + (str (System/getProperty "user.dir") "/target/liverepl.jar")) + +(defn- gen-args [& args] + (let [jar-path (liverepl-jar-path) + jar-args [jar-path jar-path jar-path] + full-args (reduce conj jar-args args)] + (into-array full-args))) + +(defn -main [& args] + (let [full-args (if args (apply gen-args args) (gen-args))] + (net.djpowell.liverepl.client.Main/main full-args))) \ No newline at end of file