Permalink
Browse files

Separated out jline into its own runtime

directory so that it is easy to pull out
of the classpath.
  • Loading branch information...
1 parent 282fb73 commit 7b47c5f0861f10f0065e5fd1c67793fab21508ad Russ Olsen committed Sep 30, 2011
Showing with 44 additions and 30 deletions.
  1. +6 −5 bin/clj
  2. +31 −21 build.xml
  3. +4 −1 ivy.xml
  4. +3 −3 test/dejour-tests.clj
View
11 bin/clj
@@ -93,17 +93,18 @@ fi
# Figure out where all the key jar files are
CLOJURE_LIB=$CLOJURE_HOME/lib
+CLOJURE_SYS_LIB=$CLOJURE_HOME/syslib
-CLOJURE_JAR=$CLOJURE_LIB/clojure.jar
-JLINE_JAR=$CLOJURE_LIB/jline.jar
+JLINE_JAR=$CLOJURE_SYS_LIB/jline*.jar
CP_DELIMITER=":"
# Pick up all the jar files in dejour/lib
-LIB_DIR_CP="$CLOJURE_LIB"
+LIB_DIR_CP=""
+
for jarfile in `find "$CLOJURE_LIB" -name "*.jar"`; do
- LIB_DIR_CP=`add_to_path "$USER_CP" "$jarfile" $CP_DELIMITER`
+ LIB_DIR_CP=`add_to_path "$LIB_DIR_CP" "$jarfile" $CP_DELIMITER`
done
# Process all the - flags that this script understands
@@ -120,7 +121,7 @@ CLOJURE_MAIN_CLASS=clojure.main
CLOJURE_JLINE_CLASS=jline.ConsoleRunner
USER_CP=""
-CORE_CP="$CLOJURE_JAR"
+CORE_CP=""
while [ $# -gt 0 ]
do
View
52 build.xml
@@ -28,9 +28,8 @@
</target>
<macrodef name="create-dejour-release">
- <attribute name="release-name"/>
<attribute name="ivy-conf-name"/>
- <attribute name="name" default="@{release-name}-@{ivy-conf-name}"/>
+ <attribute name="name" default="dejour-@{ivy-conf-name}"/>
<sequential>
<mkdir dir="build/@{name}/lib"/>
@@ -41,6 +40,12 @@
</fileset>
</copy>
+ <copy todir="build/@{name}/syslib" flatten="true">
+ <fileset dir="${basedir}">
+ <include name="downloads/jline/jline*.jar"/>
+ </fileset>
+ </copy>
+
<copy todir="build/@{name}/lib" flatten="true">
<fileset dir="${basedir}">
<include name="downloads/@{ivy-conf-name}/**/*"/>
@@ -65,35 +70,40 @@
<include name="@{name}/**/*"/>
<exclude name="@{name}/bin/**/*"/>
</tarfileset>
- </tar>
- </sequential>
+ </tar> </sequential>
</macrodef>
<target name="all" depends="init" >
- <create-dejour-release release-name="dejour"
- ivy-conf-name="minimal-1.2.1c"/>
+ <create-dejour-release ivy-conf-name="minimal-1.2.1c"/>
- <create-dejour-release release-name="dejour"
- ivy-conf-name="complete-1.2.1c"/>
+ <create-dejour-release ivy-conf-name="complete-1.2.1c"/>
- <create-dejour-release release-name="dejour"
- ivy-conf-name="minimal-1.3.0c"/>
+ <create-dejour-release ivy-conf-name="minimal-1.3.0c"/>
- <create-dejour-release release-name="dejour"
- ivy-conf-name="complete-1.3.0c"/>
+ <create-dejour-release ivy-conf-name="complete-1.3.0c"/>
</target>
+ <macrodef name="test-dejour-release">
+ <attribute name="ivy-conf-name"/>
+ <attribute name="name" default="dejour-@{ivy-conf-name}"/>
+
+ <sequential>
+ <java fork="true" failonerror="true" classname="clojure.main">
+ <env key="PATH" value="build/@{name}/bin${path.separator}${env.PATH}"/>
+ <classpath>
+ <fileset dir="build/@{name}/lib">
+ <include name="*.jar"/>
+ </fileset>
+ </classpath>
+ <arg value="${basedir}/test/dejour-tests.clj"/>
+ </java>
+ </sequential>
+ </macrodef>
+
+
<target name="test">
- <java fork="true" failonerror="true" classname="clojure.main">
- <env key="PATH" value="${build-dir}/bin${path.separator}${env.PATH}"/>
- <classpath>
- <fileset dir="${build-dir}/cljlib">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- <arg value="${test-dir}/dejour-tests.clj"/>
- </java>
+ <test-dejour-release ivy-conf-name="complete-1.2.1c"/>
</target>
<target name="clean">
View
5 ivy.xml
@@ -2,6 +2,9 @@
<info organisation="org.apache" module="dejour"/>
<configurations>
+ <conf name="jline"
+ description="Just just jline"/>
+
<conf name="minimal-1.2.1c"
description="Just clojure 1.2, no contrib libraries"/>
@@ -20,7 +23,7 @@
<dependencies>
<dependency org="jline" name="jline" rev="0.9.92"
- conf="minimal-1.3.0c->default; minimal-1.2.1c->default"/>
+ conf="jline->default"/>
<dependency org="org.clojure" name="clojure" rev="1.2.1"
conf="minimal-1.2.1c->default"/>
View
6 test/dejour-tests.clj
@@ -28,9 +28,9 @@
; core jar files and main classes
-(output-matches? ["clj" "-debug"] #"cljlib.clojure\.jar" "Contains clojure.jar")
-(output-matches? ["clj" "-debug"] #"cljlib.clojure-contrib\.jar" "Contains contrib")
-(output-matches? ["clj" "-debug"] #"cljlib.jline\.jar" "Contains jline.jar")
+(output-matches? ["clj" "-debug"] #"lib.clojure\.jar" "Contains clojure.jar")
+(output-matches? ["clj" "-debug"] #"lib.clojure-contrib\.jar" "Contains contrib")
+(output-matches? ["clj" "-debug"] #"lib.jline\.jar" "Contains jline.jar")
(output-matches? ["clj" "-debug"] #"jline\.ConsoleRunner" "Contains console runner")
(output-matches? ["clj" "-debug"] #"clojure\.main$" "contains clojure main")

0 comments on commit 7b47c5f

Please sign in to comment.