Skip to content

Instantly share code, notes, and snippets.

@hlship
Created July 21, 2009 15:20
Show Gist options
  • Save hlship/151387 to your computer and use it in GitHub Desktop.
Save hlship/151387 to your computer and use it in GitHub Desktop.
Allows all .clj files to be located and compiled
<target name="compile" description="Compile Clojure sources.">
<mkdir dir="${classes.dir}" />
<!-- Seek out the namespaces to compile. Note that this will fail if the actual name of a package includes an underscore, as
all underscores are converted to dashes. -->
<pathconvert pathsep=" " property="compile.namespaces">
<fileset dir="${src.dir}" includes="**/*.clj" />
<chainedmapper>
<packagemapper from="${basedir}/${src.dir}/*.clj" to="*" />
<filtermapper>
<replacestring from="_" to="-" />
</filtermapper>
</chainedmapper>
</pathconvert>
<java classname="clojure.lang.Compile">
<classpath>
<path refid="libs.path" />
<path location="${classes.dir}" />
<path location="${src.dir}" />
</classpath>
<sysproperty key="clojure.compile.path" value="${classes.dir}" />
<arg line="${compile.namespaces}" />
</java>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment