Skip to content

Commit

Permalink
Separated out jline into its own runtime
Browse files Browse the repository at this point in the history
directory so that it is easy to pull out
of the classpath.
  • Loading branch information
Russ Olsen committed Sep 30, 2011
1 parent 282fb73 commit 7b47c5f
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 30 deletions.
11 changes: 6 additions & 5 deletions bin/clj
Expand Up @@ -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
Expand All @@ -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
Expand Down
52 changes: 31 additions & 21 deletions build.xml
Expand Up @@ -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"/>
Expand All @@ -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}/**/*"/>
Expand All @@ -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">
Expand Down
5 changes: 4 additions & 1 deletion ivy.xml
Expand Up @@ -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"/>

Expand All @@ -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"/>
Expand Down
6 changes: 3 additions & 3 deletions test/dejour-tests.clj
Expand Up @@ -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")

Expand Down

0 comments on commit 7b47c5f

Please sign in to comment.