I'm in a rush and need to clean this up, but here's something that  
works:

Index: build.xml
===================================================================
--- build.xml   (revision 1088)
+++ build.xml   (working copy)
@@ -11,6 +11,7 @@
        <property name="build" location="classes"/>
        <property name="clojure_jar" location="clojure.jar"/>
        <property name="bootclj" location="${cljsrc}/clojure/boot.clj"/>
+        <property name="versioninfo" location="versioninfo"/>

        <target name="init">
                <tstamp/>
@@ -22,10 +23,18 @@
                <javac srcdir="${jsrc}" destdir="${build}"  
includeJavaRuntime="yes" debug="true" target="1.5"/>
        </target>

-       <target name="jar" depends="compile"
+        <target name="version"
+                description="Generate version information file.">
+          <exec executable="svnversion" spawn="false" dir="."  
output="${versioninfo}">
+            <arg line="."/>
+          </exec>
+        </target>
+
+       <target name="jar" depends="compile, version"
                description="Create jar file.">
                <jar jarfile="${clojure_jar}" basedir="${build}">
                        <fileset dir="${cljsrc}" includes="**/*.clj"/>
+                        <fileset dir="." includes="**/versioninfo"/>
                        <manifest>
                                <attribute name="Main-Class" 
value="clojure.lang.Repl"/>
                                <attribute name="Class-Path" value="."/>


Index: src/clj/clojure/boot.clj
===================================================================
--- src/clj/clojure/boot.clj    (revision 1088)
+++ src/clj/clojure/boot.clj    (working copy)
@@ -3674,3 +3674,4 @@
    "defs the supplied var names with no bindings, useful for making  
forward declarations."
    [& names] `(do ~@(map #(list 'def %) names)))

+(def *version* (. (java.io.BufferedReader.  
(java.io.InputStreamReader. (ClassLoader/getSystemResourceAsStream  
"versioninfo"))) readLine))



user> *version*
"1088M"

The build.xml script now runs a version task that creates a  
"versioninfo" file.  That file is added to clojure.jar and read in  
boot.clj where the value is stored in *version*.

-Matt

On Nov 7, 2008, at 2:41 PM, Mike Hinchey wrote:

>
> Haven't we been through this before?
> http://groups.google.com/group/clojure/browse_thread/thread/1ae7eae292765d40/f49c4ccdaca67a23
>
> >


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to clojure@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to