[RSS]

I want to combine the 5.0 Platform with the 5.0 Update 1 build harness in one binary. Can I?

Q: I am building an application based on the NetBeans Platform 5.0 release. I have updated my 5.0-based IDE to include the 5.0 Update 1 release of the module development tools, which works. But I keep my target platform binary under version control for repeatable builds and it still includes the older build harness (5.0). Can I update just the build harness to have the new features?

A. Unfortunately the netbeans.org site does not currently offer a download of the 5.0 Platform combined with the 5.0u1 build harness. However you can make such a binary yourself, basically by unpacking the NBM for the new harness on top of the old Platform binary. Here is a script which does it:

<?xml version="1.0" encoding="UTF-8"?>
<project name="5.0u1-platform" default="platform" basedir=".">
    <target name="get">
        <mkdir dir="download"/>
        <presetdef name="my.get">
            <get usetimestamp="true" verbose="true"/>
        </presetdef>
        <my.get src="http://us1.mirror.netbeans.org/download/5_0/fcs/200601251500/netbeans-5_0-platform.tar.bz2" dest="download/nbp-50.tar.bz2"/>
        <my.get src="http://www.netbeans.org/download/nbms/50/stable/Libraries/org-netbeans-modules-apisupport-harness.1.8.2.nbm" dest="download/apisupport-harness-50u1.nbm"/>
    </target>
    <target name="platform" depends="get">
        <untar src="download/nbp-50.tar.bz2" dest="." compression="bzip2"/>
        <move file="netbeans" tofile="nbp50u1"/>
        <delete dir="nbp50u1/harness"/>
        <unzip src="download/apisupport-harness-50u1.nbm" dest=".">
            <patternset>
                <include name="netbeans/"/>
            </patternset>
        </unzip>
        <move file="netbeans" tofile="nbp50u1/harness"/>
        <delete>
            <fileset dir="nbp50u1" includes="*"/>
        </delete>
    </target>
    <target name="clean">
        <delete dir="netbeans"/>
        <delete dir="nbp50u1"/>
    </target>
    <target name="real-clean" depends="clean">
        <delete dir="download"/>
    </target>
</project>

As an alternative, you can use a pristine 5.0 platform download (or 5.0 platform built from sources) and use an external harness without sacrificing repeatable builds. Just as the 5.0u1 in-IDE module development support defaults to using the (5.0u1) harness included with the IDE, ignoring the harness bundled with the platform, so you can configure your module or suite to use a specific harness location. As described in harness/README set up a relative path for the platform, but make the harness separate, e.g.

suite.dir=${basedir}
netbeans.dest.dir=${suite.dir}/../nb_sources/nbbuild/netbeans
# Rather than:
#harness.dir=${netbeans.dest.dir}/harness
# use:
harness.dir=${suite.dir}/../harness50u1

Applies to: NetBeans 5.0