On the NetBeans Platform Build System (Part 1)
The NetBeans build harness performs a number of tasks when building a NetBeans Platform application. This series of articles describes some of the issues that can be encountered when building NetBeans Platform applications in other ways than the standard use case of creating and building it on a single PC in the NetBeans IDE. It also provides some tips for customising build behaviour.
The NetBeans Platform ships with a comprehensive build harness, containing build scripts and Ant tasks that make the building of a platform application very easy. Since it consists of ant scripts, it can be used to build the application from the IDE or the command line. Most of the time the build harness does its job so well that the NetBeans Platform application developer is only vaguely aware of its existence. However, there are instances where you need something just slightly different. And that is what this series of articles is all about!
The series focuses on the build process of a NetBeans Platform application, which has a different structure from a plain Java application project or a web application project. At the time of writing this article, I was using NetBeans IDE 6.7.1, but still had 6.5 and even some older versions installed.
2. Managing Multiple Platforms in the IDE
When you first install NetBeans IDE, a folder is created for that version. For example, version 6.5 would (by default) have been installed to C:\Program Files\NetBeans 6.5. A few months later, version 6.7.1 is released and you install the second version with its own folder. It is now possible to build on top of either of the two platforms. On the Tools menu, you will find a NetBeans Platforms option, which opens up the NetBeans Platforms Manager window shown below.
Figure 1. NetBeans Platform Manager.
Here you can configure multiple platforms, allowing you to choose which platform to use when building a suite and/or modules. Note that that 6.7.1 platform is the default, and that it uses the harness supplied with the IDE. For the 6.5 platform, you could choose to rather use the one supplied with the platform, i.e. the 6.5 one.
Keep in mind that the harness uses Ant, and was running perfectly well with the version of Ant that was included with the release. However, years down the line, some Ant tasks might not exist anymore and hence a very old harness may not run entirely as expected with a much later version of the IDE.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)