<project name="PDFsam" default="create-bundle" basedir=".">

    <taskdef name="bundleapp"
             classname="com.oracle.appbundler.AppBundlerTask"
             classpath="lib/appbundler-1.0.jar"/>
    <property environment="env"/>

    <property name="current.dir" value="."/>
    <property name="release.dir" value="release"/>

    <!-- clean -->
    <target name="clean">
        <echo message="clean task ..."/>
        <!-- just needed for the first-time run -->
        <mkdir dir="${release.dir}"/>
        <!-- remove the old version of the app -->
        <delete dir="${release.dir}/PDFsam.app"/>
    </target>

    <!-- create mac osx 'bundle' -->
    <target name="create-bundle" depends="clean">
        <bundleapp outputdirectory="${release.dir}"
                   name="PDFsam"
                   displayname="PDFsam"
                   identifier="org.pdfsam.community.App"
                   shortversion="0.1"
                   icon="Icon.icns"
                   copyright="Andrea Vacondio"
                   applicationCategory="public.app-category.utilities"
                   mainclassname="org/pdfsam/community/App">

            <runtime dir="${env.JAVA_HOME}"/>

            <classpath file="../pdfsam-community/target/pdfsam-community-3.0.0.RELEASE-SNAPSHOT.jar"/>

            <option value="-Xdock:icon=Contents/Resources/Icon.icns"/>
            <option value="-Dapple.laf.useScreenMenuBar=true"/>
            <option value="-Dcom.apple.macos.use-file-dialog-packages=true"/>
            <option value="-Dcom.apple.macos.useScreenMenuBar=true"/>
            <option value="-Dapple.awt.application.name=PDFsam"/>
            <option value="-Dcom.apple.smallTabs=true"/>            
            <!--<option value="-Dorg.pdfsam.disable.ui.restore=true"/>-->

        </bundleapp>
    </target>
</project>
