Skip to main content

Module Suite building tips (part 3)

Posted by richunger on December 20, 2005 at 1:32 PM PST

In this installment, I'll be solving 2 issues with the building of a distributable application from a NetBeans Module Suite:

  1. Including a custom conf file (instead of the default etc/netbeans.conf)
  2. Including the JDK with my distribution

First, let's take a look at my vbuilder.conf file:

# ${HOME} will be replaced by JVM user.home system property
# ${APPNAME} will be replaced by the app name specified
# in the module suite's project properties

# options used by the launcher by default, can be overridden by explicit
# command line switches
default_options="-J-Xms24m -J-Xmx128m -J-Dnetbeans.logger.console=true"

# default location of JDK/JRE, can be overridden by using --jdkhome <dir> switch
# relative paths are relative to the root of the netbeans installation

Now, I've checked this file into my module suite's nbproject/ directory. Notice that the configuration sets the default JDK to ${NETBEANS_ROOT}/jdk.

In the suite's build script, I need only override one target:

<target name="build-zip" depends="" description="Builds a ZIP distribution of V-Builder.">
    <zip destfile="dist/${}.zip" update="true">
        <!-- The JDK that's running this ant script -->
        <zipfileset dir="${java.home}/../" prefix="${}/jdk">
            <exclude name="bin/*.exe"/>
            <exclude name="jre/bin/*.exe"/>
            <exclude name=""/>
            <exclude name="src/**"/>
            <exclude name="demo/**"/>
            <exclude name="sample/**"/>
        <zipfileset dir="${java.home}/../" prefix="${}/jdk" filemode="755">
            <include name="bin/*.exe"/>
            <include name="jre/bin/*.exe"/>

        <!-- vbuilder.conf -->
        <zipfileset dir="nbproject" prefix="${}/etc">
            <include name="${}.conf"/>

...and that's all there is to it. Now the zip file generated by the IDE's "Build Zip Distribution" action will contain my custom vbuilder.conf and the JDK that was used to build it.

In the next entry, I'll show you how to set up a nightly build process.

Related Topics >>