On Nov 26, 1:45 pm, BrianS <[EMAIL PROTECTED]> wrote:
> I am looking to see if anyone has come up with an ANT task or script
> for compiling clojure CLJ files using the clojure compiler. Much
> appreciated if anyone has anything to contribute.

Hi Brian,

The latest Clojure releases (post 1101) use the AOT compiler for the
core Clojure libraries.  The Ant task looks like this:

        <property name="cljsrc" location="${src}/clj"/>
        <property name="build" location="classes"/>
        <property name="precompile" location="${cljsrc}/precompile.clj"/>
        ...
        <target name="core" depends="compile"
                description="Precompile Clojure core sources.">
                <java classname="clojure.lang.Script"
                      classpath="${build}:${cljsrc}">
                        <sysproperty key="clojure.compile.path"
value="${build}"/>
                        <arg value="${precompile}"/>
                </java>
        </target>

Where precompile.clj is a helper script containing:

(println "Compiling Clojure core sources...")

(binding [*compile-path* (System/getProperty "clojure.compile.path")]
  (compile 'clojure.core)
  (compile 'clojure.set)
  (compile 'clojure.xml)
  (compile 'clojure.zip)
  (compile 'clojure.inspector))

The standalone compiler that Stephen G. and I have been hacking will
simplify this, but it's not in Clojure SVN yet.

-Stuart Sierra



--~--~---------~--~----~------------~-------~--~----~
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