Source

lazymap / build.xml

Full commit
<project name="lazymap" default="artifacts"
    xmlns:ivy="antlib:org.apache.ivy.ant">

    <description>
        lazymap is an implementation of a lazy map for the Clojure
        programming language. It is to maps what lazy-seq is for
        sequences. You can use Ivy to depend on the project. Put
        the following in your ivy.xml:
        &lt;dependency org="de.kotka" name="lazymap"/&gt;

        In your ivysettings.xml put the following:
        &lt;resolvers&gt;
            &lt;url name="Kotka"&gt;
                &lt;ivy pattern="http://kotka.de/ivy/[organisation]/[module]/[revision]/ivys/ivy.xml"/&gt;
                &lt;artifact pattern="http://kotka.de/ivy/[organisation]/[module]/[revision]/jars/[artifact].[ext]"/&gt;
            &lt;/url&gt;
        &lt;/resolvers&gt;

        &lt;modules&gt;
            &lt;module organisation="de.kotka" name="lazymap" resolver="Kotka"/&gt;
        &lt;/modules&gt;
    </description>

    <property name="src.dir" location="src"/>
    <property name="classes.dir" location="classes"/>
    <property name="build.dir" location="build"/>
    <property name="lib.dir" location="lib"/>

    <property name="jar.file" location="${build.dir}/lazymap.jar"/>
    <property name="srcjar.file" location="${build.dir}/lazymap-source.jar"/>

    <property name="current.version" value="2.2"/>

    <property file="local.properties"/>

    <target name="init" description="--> create build directories">
        <tstamp/>
        <mkdir dir="${classes.dir}"/>
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${lib.dir}"/>
    </target>

    <target name="resolve" depends="init"
        description="--> resolve dependencies with Ivy">
        <ivy:retrieve />
        <ivy:resolve />
    </target>

    <target name="aot" depends="resolve,init"
        description="--> AOT compile clojure sources">
        <java classname="clojure.lang.Compile">
            <classpath>
                <path location="${classes.dir}"/>
                <path location="${src.dir}"/>
                <fileset dir="${lib.dir}" includes="**/*.jar"/>
            </classpath>
            <sysproperty key="clojure.compile.path" value="${classes.dir}"/>
            <arg value="de.kotka.lazymap.LazyMapEntry"/>
            <arg value="de.kotka.lazymap.LazyMapSeq"/>
            <arg value="de.kotka.lazymap.LazyMap"/>
            <arg value="de.kotka.lazymap"/>
        </java>
    </target>

    <target name="artifacts" depends="aot"
        description="--> create source and artifact jars">
        <jar jarfile="${jar.file}">
            <fileset file="README.txt"/>
            <fileset file="LICENSE.txt"/>
            <fileset dir="${classes.dir}" includes="de/kotka/**/*.class"/>
            <manifest>
                <attribute name="Class-Path" value="."/>
            </manifest>
        </jar>

        <jar jarfile="${srcjar.file}">
            <fileset file="README.txt"/>
            <fileset file="LICENSE.txt"/>
            <fileset dir="${src.dir}" includes="**/*.clj"/>
        </jar>
    </target>

    <target name="clean" description="--> clean generated files">
        <delete dir="${classes.dir}"/>
        <delete dir="${build.dir}"/>
    </target>

    <target name="clean-lib" description="--> clean library files">
        <delete dir="${lib.dir}"/>
    </target>

    <target name="clean-local" description="--> clean local repository">
        <ivy:info />
        <delete dir="${ivy.local.default.root}/${ivy.organisation}/${ivy.module}"/>
    </target>

    <target name="clean-all" depends="clean,clean-lib,clean-local"
        description="--> clean all project files"/>

    <target name="publish"
        description="--> publish artifacts in the shared repository">
        <ivy:info />
        <ivy:buildnumber
            organisation="${ivy.organisation}"
            module="${ivy.module}"
            revision="${current.version}"/>
        <ivy:publish
            resolver="shared"
            artifactspattern="${build.dir}/[artifact].[ext]"
            pubrevision="${ivy.new.revision}"
            status="release"/>
    </target>

    <target name="publish-local"
        description="--> publish artifacts in the local repository">
        <tstamp>
            <format property="now" pattern="yyyyMMddHHmmss"/>
        </tstamp>
        <ivy:info />
        <ivy:publish
            resolver="local"
            artifactspattern="${build.dir}/[artifact].[ext]"
            pubrevision="${now}"
            pubdate="${now}"
            status="integration"
            forcedeliver="true"/>
    </target>

</project>