<?xml version="1.0" encoding="utf-8"?>
<project name="josm-plugins" default="dist" basedir=".">
    <target name="compile_josm" unless="skip-josm">
        <ant dir="../core" target="dist"/>
    </target>
    <target name="compile_josm_test" unless="skip-josm">
        <ant dir="../core" target="test-compile"/>
    </target>
    <property name="ordered_plugins" value="jna/build.xml
                                            jts/build.xml
                                            gson/build.xml
                                            ejml/build.xml
                                            geotools/build.xml
                                            utilsplugin2/build.xml
                                            log4j/build.xml
                                            apache-commons/build.xml
                                            apache-http/build.xml
											austriaaddresshelper/build.xml"/>
    <macrodef name="iterate">
        <attribute name="target"/>
        <sequential>
            <subant target="@{target}" inheritall="true">
                <filelist dir="." files="${ordered_plugins}"/>
                <fileset  dir="." includes="*/build.xml" excludes="00_*/build.xml *.wip/build.xml ${ordered_plugins}"/>
            </subant>
        </sequential>
    </macrodef>
    <target name="clean">
        <iterate target="clean"/>
    </target>
    <target name="compile">
        <iterate target="compile"/>
    </target>
    <target name="dist" depends="compile_josm">
        <mkdir dir="../dist"/>
        <iterate target="dist"/>
        <property name="skip-dist" value="true"/>
        <property name="skip-compile" value="true"/>
        <property name="skip-revision" value="true"/>
    </target>
    <target name="install" depends="dist">
        <iterate target="install"/>
    </target>
    <target name="test" depends="compile_josm_test">
        <iterate target="test"/>
    </target>
    <target name="checkstyle">
        <iterate target="checkstyle"/>
    </target>
    <target name="spotbugs">
        <iterate target="spotbugs"/>
    </target>
    <target name="javadoc">
        <iterate target="javadoc"/>
    </target>
</project>
