<project name="Personal Issue Tracker CLI">

    <property file="project.properties"/>

    <import file="../jdb-build-1.6.xml"/>

    <target name="init">
        <fail
            unless="env.GROOVY_HOME"
            message="GROOVY_HOME environment variable is not set."/>
        <echo message="GROOVY_HOME: ${env.GROOVY_HOME}"/>

        <fail message="Could not find PIT ${version} library.">
            <condition>
                <not>
                    <available
                        file="${basedir}/../libpit/release/libpit-${version}.jar"/>
                </not>
            </condition>
        </fail>
    </target>

    <target name="lib">
        <copy todir="${build.dir}/lib/compile/jar"
              file="${basedir}/../libpit/release/libpit-${version}.jar"/>
        <copy todir="${build.dir}/lib/runtime/jar"
              file="${basedir}/../libpit/release/libpit-${version}.jar"/>
    </target>

    <target name="release" depends="build">
        <mkdir dir="${release.dir}/lib"/>
        <copy todir="${release.dir}/lib">
            <fileset dir="${build.dir}/lib/runtime/jar"/></copy>
        <copy tofile="${release.dir}/${name}-${version}.jar"
              file="${build.dir}/${name}-${version}.${build.number}.jar"/>
    </target>
</project>
