简体   繁体   English

您如何处理NetBeans生成的生成文件?

[英]How do you handle NetBeans generated build files?

I'm working on a project that uses NetBeans to generate the ANT build files. 我正在使用NetBeans生成ANT构建文件的项目。 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. 我来自一个环境,在该环境中,构建文件已签入源代码管理,但是由本地NetBeans应用程序生成,似乎不正确。 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. 我想向构建文件中添加一些自定义目标,我看到NetBeans支持该目标,但是我担心要进行此自定义并需要签入。

So, my main question for those of you out there who use NetBeans, how do you deal with the generated build files? 因此,对于那些使用NetBeans的人来说,我的主要问题是,如何处理生成的构建文件? 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? 然后,您是否必须在构建计算机上安装NetBeans?

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). Netbeans使用针对IDE环境定制的Ant任务,因此您确实需要深入研究Netbeans的内容以提取(至少)这些Ant任务(它们包含在它们自己的JAR 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. 仍然,如果绝对必须,您可以修改build.xml以添加其他目标:Netbeans将其构建文件写入nbproject / build-impl.xml中,该文件导入到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. 实际上,build.xml只是导入实际构建脚本(build-impl.xml)并允许您自己覆盖或添加构建目标的前端。

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. 但是,与普通的Ant和您自己的生成脚本(用于简单的编译源/文档/测试并生成JAR文件)相比,保持NetBeans特质容易得多

I usually create my own build file and create a netbeans free-form project that uses that build file. 我通常创建自己的构建文件,并创建一个使用该构建文件的netbeans自由格式项目。 Then you can check in the build file to source control. 然后,您可以将构建文件检入到源代码管理中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM