NetBeans Sources as a Platform
By Geertjan-Oracle on Nov 26, 2011
By default, when you create a new NetBeans module, the 'development IDE' is the platform to which you'll be deploying your module. It's a good idea to create your own platform and check that into your own repo, so that everyone working on your project will be able to work with a standardized platform, rather than whatever happens to be beneath the development IDE your using.
Something else you can do is use the NetBeans sources as your platform, once you've checked them out. That's something I did the other day when trying to see whether adding 'setActivatedNodes' to NbSheet was sufficient for getting UndoRedo enabled in the Properties Window. So that's a good use case, i.e., you'd like to change the NetBeans Platform somehow, or you're fixing a bug, in other words, in some way you need to change the NetBeans Platform sources and then would like to try out the result of your changes as a client of your changes.
In that scenario, here's how to set up and use a NetBeans Platform from the NetBeans sources.
- Run 'ant -Dcluster.config=platform build-platform' on the root of the NetBeans sources. In about two minutes, you'll end up with nbbuild/netbeans containing a subfolder 'platform' and a subfolder 'harness'. There's your NetBeans Platform.
- Go to Tools | NetBeans Platform and browse to 'nbbuild/netbeans', registering it as your NetBeans Platform.
- Create a new NetBeans module, using the new NetBeans Platform as the platform.
- Now the cool thing is you can open any of the NetBeans modules from the NetBeans Platform modules in the NetBeans sources. When you change the source code of one of these modules and then build that module, the changed JAR will automatically be added to the right place in the nbbuild/netbeans folder. And when you do a 'clean' on a NetBeans Platform module, the related JAR will be removed from nbbuild/netbeans.