Source

neman / build.xml

Full commit
<project name='neman' xmlns:ivy='antlib:org.apache.ivy.ant'>

    <property file='${basedir}/zg/ivy.properties'/>

    <target name='ivy-download' unless='skip.ivy'>
        <mkdir dir='${ivy.jar.dir}'/>
        <get
            src='${ivy.jar.src}' dest='${ivy.jar.dst}' usetimestamp='yes'/>
    </target>

    <target name='ivy-install' depends='ivy-download'>
        <path id='ivy.lib.path'>
            <fileset dir='${ivy.jar.dir}' includes='*.jar'/>
        </path>
        <taskdef
            resource='org/apache/ivy/ant/antlib.xml'
            uri='antlib:org.apache.ivy.ant'
            classpathref='ivy.lib.path'/>
    </target>

    <target name='buildlist' depends='ivy-install'>
        <ivy:buildlist reference='build-path' skipbuildwithoutivy='true'>
            <fileset dir='neman' includes='**/build.xml'/>
        </ivy:buildlist>
    </target>

    <!-- Toplevel task for all subprojects. -->

    <target name='repl' depends='buildlist, ivy-install'>
    <ivy:retrieve conf='dev'/>
    <script language='javascript'><![CDATA[
        importClass(java.io.File);
        var buildPath = project.getReference('build-path').list();

        var projectPaths = Array();
        for(var i = 0; i < buildPath.length; i++) {
            projectPaths[i] = (new File(buildPath[i])).getParentFile();
        }

        var sourcePaths = Array();
        for(var i = 0; i < projectPaths.length; i++) {
            sourcePaths[i] = new File(projectPaths[i], "src");
        }

        var classPaths = Array();
        for(var i = 0; i < projectPaths.length; i++) {
            classPaths[i] = new File(new File(projectPaths[i], "target"), "classes");
        }

        var paths = sourcePaths.concat(classPaths, "\"lib/*\"").join(":");

        var echo = project.createTask('echo');
        echo.setFile(new File('clojure'));
        echo.setMessage(
            "CP=" + paths + "\njava -cp $CP jline.ConsoleRunner clojure.lang.Repl\n");
        echo.perform();
    ]]></script>
    <chmod file='clojure' perm='+x'/>
    </target>

    <macrodef name='subproject'>
        <attribute name='target'/>
        <sequential>
            <subant target='@{target}' buildpathref='build-path'/>
        </sequential>
    </macrodef>

    <target name='publish-all' depends='buildlist'>
        <subproject target='publish'/>
    </target>

    <target name='test-all' depends='buildlist'>
        <subproject target='test'/>
    </target>

    <target name='clean' depends='buildlist'>
        <subproject target='clean'/>
        <ivy:cleancache/>
    </target>
</project>