开发者

How do you handle NetBeans generated build files?

开发者 https://www.devze.com 2023-01-10 09:24 出处:网络
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 t

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 开发者_Go百科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.


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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消