<?xml version="1.0" encoding="UTF-8"?>
<project name="DMDirc Plugins" default="default" basedir=".">
    <description>Builds, packages and tests DMDirc plugins.</description>

    <!-- Resolve the relative directory -->
    <property name="dmdircOutput" location="${plugins.dmdirc.build.dir}"/>

    <target name="init-dependencies"/>

    <target name="compile">
        <exec executable="gradlew" dir="." failonerror="true" resolveexecutable="true" osfamily="unix">
            <arg value="--parallel"/>
            <arg value="--refresh-dependencies"/>
            <arg value="compileJava"/>
        </exec>

        <exec executable="cmd" dir="." failonerror="true" osfamily="windows">
            <arg value="/c"/>
            <arg value="gradlew.bat"/>
            <arg value="--parallel"/>
            <arg value="--refresh-dependencies"/>
            <arg value="compileJava"/>
        </exec>
    </target>

    <target name="jar">
        <exec executable="gradlew" dir="." failonerror="true" resolveexecutable="true" osfamily="unix">
            <arg value="--parallel"/>
            <arg value="--refresh-dependencies"/>
            <arg value="jar"/>
        </exec>

        <exec executable="cmd" dir="." failonerror="true" osfamily="windows">
            <arg value="/c"/>
            <arg value="gradlew.bat"/>
            <arg value="--parallel"/>
            <arg value="--refresh-dependencies"/>
            <arg value="jar"/>
        </exec>
    </target>

    <target name="clean">
        <exec executable="gradlew" dir="." failonerror="true" resolveexecutable="true" osfamily="unix">
            <arg value="--parallel"/>
            <arg value="clean"/>
        </exec>

        <exec executable="cmd" dir="." failonerror="true" osfamily="windows">
            <arg value="/c"/>
            <arg value="gradlew.bat"/>
            <arg value="--parallel"/>
            <arg value="clean"/>
        </exec>
    </target>

    <target name="with.clover"/>

    <target name="compile-for-tests" depends="compile">
        <exec executable="gradlew" dir="." failonerror="true" resolveexecutable="true" osfamily="unix">
            <arg value="--parallel"/>
            <arg value="--refresh-dependencies"/>
            <arg value="compileTestJava"/>
        </exec>

        <exec executable="cmd" dir="." failonerror="true" osfamily="windows">
            <arg value="/c"/>
            <arg value="gradlew.bat"/>
            <arg value="--parallel"/>
            <arg value="--refresh-dependencies"/>
            <arg value="compileTestJava"/>
        </exec>
    </target>

</project>
