Hello,
I am working on a JavaFX project using Netbeans 7.3.1/Java 1.7.0_45 and I am ready to deploy my project. I followed the tutorial to write an ant task to create a dmg file, which works, but I want to take it a step further and customize it. Whenever I build the project in verbose mode, it advises me to create a package/macosx/ directory to place the necessary files in order to complete the customization, as stated below
Using base JDK at: /Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk
Using default package resource [Bundle config file] (add package/macosx/Info.plist to the class path to customize)
Using custom package resource [icon] (loaded from file /Users/apple/NetBeansProjects/MyProject/package/macosx/MyProject.icns)
Creating app bundle: /Users/apple/NetBeansProjects/MyProject/dist/bundles/MyProject.app
Config files are saved to /var/folders/89/jc2r_t3d7gn5ng8bncw5dvbw0000gp/T/build7554835886597138428.fxbundler/macosx. Use them to customize package.
Building DMG package for MyProject
Using default package resource [Bundle config file] (add package/macosx/Info.plist to the class path to customize)
Using custom package resource [icon] (loaded from file /Users/apple/NetBeansProjects/MyProject/package/macosx/MyProject.icns)
Config files are saved to /var/folders/89/jc2r_t3d7gn5ng8bncw5dvbw0000gp/T/build7554835886597138428.fxbundler/macosx. Use them to customize package.
Using default package resource [dmg background] (add package/macosx/MyProject-background.png to the class path to customize)
Using custom package resource [volume icon] (loaded from file /Users/apple/NetBeansProjects/MyProject/package/macosx/MyProject.icns)
Using default package resource [script to run after application image is populated] (add package/macosx/MyProject-post-image.sh to the class path to customize)
Using default package resource [DMG setup script] (add package/macosx/MyProject-dmg-setup.scpt to the class path to customize)
Result DMG installer for MyProject: /Users/apple/NetBeansProjects/MyProject/dist/bundles/MyProject.dmg
Config files are saved to /var/folders/89/jc2r_t3d7gn5ng8bncw5dvbw0000gp/T/build7554835886597138428.fxbundler/macosx. Use them to customize package.
jfx-deployment-script:
jfx-deployment:
jar:
jfx-rebuild:
BUILD SUCCESSFUL (total time: 59 seconds)
I was able to customize the icon but the other files are not being recognized and references the default resources. I tried to add the package/macosx location in the Netbean options under Java->Ant but I was unsuccessful. I made a lot of modifications to the build.xml file and still no luck. Does anyone have any insight on how I could customize the other package resources, specifically, the MyProject-background.png, MyProject-dmg-setup.scpt and MyProject-post-image.sh? The output clearly says to add the directory to the classpath but for some reason, it is not finding the other resources. Is there another way to add the directory to the classpath?
Thanks for your help.
Here is my build.xml file
<?xml version="1.0" encoding="UTF-8"?><!-- You may freely edit this file. See commented blocks below for --><!-- some examples of how to customize the build. --><!-- (If you delete it and reopen the project it will be recreated.) --><!-- By default, only the Clean and Build commands use this build script. -->
<project name="Voisc" default="default" basedir="." xmlns:fx="javafx:com.sun.javafx.tools.ant">
<description>Builds, tests, and runs the project Voisc.</description>
<import file="nbproject/build-impl.xml"/>
<target name="-post-jfx-deploy">
<echo>${basedir}/package/macosx</echo>
<taskdef resource="com/sun/javafx/tools/ant/antlib.xml"
uri="javafx:com.sun.javafx.tools.ant"
classpath=".:/Library/Java/JavaVirtualMachines/jdk1.7.0_45.jdk/Contents/Home/lib/ant-javafx.jar"/>
<mkdir dir="package"/>
<mkdir dir="${basedir}/${dist.dir}/resources"/>
<copy todir="${basedir}/${dist.dir}/resources">
<fileset dir="${basedir}/resources"/>
</copy>
<fx:deploy width="${javafx.run.width}" height="${javafx.run.height}"
nativeBundles="all" verbose="true"
outdir="${basedir}/${dist.dir}" outfile="${application.title}">
<fx:application name="${application.title}"
mainClass="${javafx.main.class}"
version="1.1"/>
<fx:resources>
<fx:fileset dir="${basedir}/${dist.dir}" includes="${application.title}.jar"/>
<fx:fileset dir="${basedir}" includes="lib/*.jar"/>
<fx:fileset dir="${basedir}" includes="resources/lex/*.tlx"/>
<fx:fileset dir="${basedir}" includes="resources/lex/*.clx"/>
<fx:fileset dir="${basedir}" includes="resources/*.properties"/>
</fx:resources>
<fx:info title="${application.title}" vendor="${application.vendor}">
<fx:splash href="${basedir}/macosx/${application.title}-background.png"/>
<fx:icon href="${basedir}/package/macosx/${application.title}.icns" kind="default" width="512" height="512" depth="8"/>
</fx:info>
<fx:permissions elevated="true"/>
<fx:preferences install="false"/>
</fx:deploy>
</target>
</project>