Automated builds with Netbeans Platform 8.0.2

I've been converting UGS to run on the Netbeans Platform over the past week, and in general its been great.  The features and documentation I used while migrating UGS away from Swing were very well done. So aside from a couple hiccups, the Netbeans Platform has been great. Until a few days ago when I decided it was time to integrate my new changes with my Jenkins CI server.

It turns out that you can't build a Netbeans Platform application without connecting to the Netbeans IDE first. This has to do with the extra modules, platform components and build harness. Searching the subject online provides a lot of documentation, everything I've found is either out dated, contradictory, or I could only get it working with a new project and not my existing one.

The final solution was so simple, and minimally invasive that I wanted to create this blog post.

There are 4 interesting files for a Netbeans Platform build:
build.xml - Some documentation suggests adding a download-netbeans-rcp target here. That isn't needed. If you have a custom target you can put it here, otherwise there is no need to modify this file.
nbproject/build-impl.xml - This is loaded by build.xml, don't modify this file.
nbproject/project.properties - This file seems to identify your modules and the applications name, no need to modify this file either.
nbproject/platform.properties - Modify this file!
The Netbeans Platform has facilities built into its build script to download all required files. platform.properties is where you need to specify what it should download.
# These are used later in the build script
nbplatform.active.dir=${suite.dir}/latestStableBuild
suite.dir=${basedir}
harness.dir=${nbplatform.active.dir}/harness
# Provide some URLs
bootstrap.url=http://deadlock.netbeans.org/hudson/job/nbms-and-javadoc/lastStableBuild/artifact/nbbuild/netbeans/harness/tasks.jar
autoupdate.catalog.url=http://dlc-cdn.sun.com/netbeans/updates/8.0.2/uc/final/distribution/catalog.xml.gz
Thats it! It probably took me 5+ hours to find that. Now I can run "ant build-zip" on my Jenkins server and get a zip archive in return.

1 comments:

Anonymous said...

good post

Post a Comment