views:

31

answers:

2

I'm working on a project that uses NetBeans to generate the ANT build files. I come from an environment where the build file is something checked into source control, but with it being generated by the local NetBeans application, that doesn't seem correct. I'd like to add some custom targets to the build file, which I see that NetBeans has support for, but I'm concerned with making this custom and creating the need to check it in.

So, my main question for those of you out there who use NetBeans, how do you deal with the generated build files? Also, how do you automated builds on a build machine in this type of environment? Do you then have to install NetBeans on the build machine?

Thanks much.

A: 

I usually create my own build file and create a netbeans free-form project that uses that build file. Then you can check in the build file to source control.

Braden
+1  A: 

Netbeans uses Ant tasks that are custom to the IDE environment, so you do need to dig into the bowels of Netbeans to extract -at a minimum- these ant tasks (they come in their own JARs IIRC).

Still if you absolutely must you can modify build.xml to add additional targets: Netbeans writes its build file in nbproject/build-impl.xml which is imported in build.xml. Effectively build.xml is nothing but a front that imports the real build script (build-impl.xml) and allows you to override or add build targets yourself.

But it is much easier to work with plain Ant and your own build script for simple compile source/docs/tests and generate JAR files than it is to keep dealing with Netbeans idiosyncrasies.

Yeah, this is kind of the direction I was thinking, but there are quite a few processes in place that take advantage of the Netbeans build process (such as for deploys). It seems like re-inventing the wheel to rewrite all that kind of stuff.
Dante617