<?xml version="1.0" encoding="UTF-8"?>
<project name="PackPartitions" default="default" basedir=".">
    <description>Builds the PackPartitions tool.</description>
    <import file="nbproject/build-impl.xml"/>
    <!-- override javasdoc target, since we have no Java sources -->
    <target depends="init" description="Don't build Javadoc." name="javadoc"/>
    <!-- use local groovy jar instead of NetBeans' version -->
    <property name="libs.groovy-all.classpath" value="./lib/groovy-4.0.13.jar:./lib/groovy-ant-4.0.13.jar:./lib/groovy-xml-4.0.13.jar:./lib/groovy-json-4.0.13.jar"/>
    <!-- put the current time/date into a file for engine timestamping -->
    <exec executable="date" output="dist/tstamp.txt">
        <arg value="+%s000"/>
    </exec>
    <!-- after building the 'thin' jar, make a 'thick' one incorporating all dependencies -->
    <target name="-post-jar">
        <echo message="Packaging ${application.title} into a single JAR at ${dist.jar}"/>
        <move file="${dist.jar}" tofile="dist/${application.title}-thin.jar"/>
        <jar jarfile="${dist.jar}">
            <zipfileset src="../PLASMA/src/plasm.jar"/>
            <zipfileset src="../ACME/src/acme.jar"/>
            <zipfileset src="../A2Copy/dist/A2Copy.jar"/>
            <zipfileset src="../A2Copy/lib/ac.jar"/>
            <zipfileset src="./lib/groovy-4.0.13.jar"/>
            <zipfileset src="./lib/groovy-xml-4.0.13.jar"/>
            <zipfileset src="./lib/groovy-json-4.0.13.jar"/>
            <zipfileset src="dist/${application.title}-thin.jar" />
            <manifest>
                <attribute name="Main-Class" value="org.badvision.A2PackPartitions"/>
            </manifest>
            <fileset dir="dist">
                <include name="tstamp.txt"/>
            </fileset>
            <fileset dir="../..">
                <include name="virtual/src/**/*.pla"/>
                <include name="virtual/src/**/*.plh"/>
                <include name="virtual/src/**/*.s"/>
                <include name="virtual/src/**/*.i"/>
                <include name="virtual/src/**/*.ct"/>
                <include name="virtual/data/disks/*.gz"/>
                <include name="tools/PLASMA/src/PLVM02#4000"/>
                <include name="tools/ProRWTS/PRORWTS2#4000"/>
                <include name="tools/ProRWTS/PROBOOT#800"/>
            </fileset>
        </jar>
    </target>
</project>
