构建脚本的命名
我们使用 Ant 进行构建管理,我们必须构建脚本,一个脚本用于为我们的客户创建调度,其中包含哈希信息、源代码、安装指南等,另一个构建文件位于创建的工件中,并且是为客户构建,从源代码创建 war 文件。
对于创建 war 文件的构建文件,我采用 ant 默认的 build.xml
,但是你会如何命名另一个文件呢?
We do our build-management with Ant, we have to build scripts, one to create a dispatchment for our customer, with hash informations, the sourcecode, installation-guide etc., the other build-file lies in the created artefact, and is the build for the customer which creates the war file from the sourcecode.
for the build-file which creates the war file, i take the ant default build.xml
, but how would you name the other file?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是一个决策矩阵:
如果您想在生成的目录中从命令行运行 ant 构建,请坚持使用默认的
build.xml
。这样,无论谁运行构建,都不必为非标准 ant 脚本文件的 ant 命令行开关而烦恼。如果其他 ant 脚本将被其他脚本调用,或者必须设置过多的环境才能运行构建,那么最好为该脚本指定一个自定义名称。我会在文件名中指出它是一个 ant 脚本。
Here is a decision matrix:
If you want to run an ant build from the command line in generated directory, then stick with the default
build.xml
. This way whoever runs the build will not have to struggle with ant command line switches for non-standard ant script file.If the other ant script is going to be called by some other script or excessive environment has to be set in order to run the build, then it's probably better to give a custom name to that script. I would indicate in the file name that it's an ant script.
为了给出一个好的答案,您需要提供更多的信息。
构建文件是否已生成?每个客户都是独一无二的?它是从全局构建文件自动调用的,还是由人工调用?是否必须按特定顺序调用它们?
如果“其他”构建文件位于不同的(子)目录中,您可以将它们命名为 build.xml。这将是 ant 的默认设置,并且很容易识别。否则,我会根据生成的项目或工件给他们一个后缀。因此,例如,如果工件是 aaa.jar,您可以将构建文件命名为 build-aaa.xml。如果必须以特定顺序调用它们,您可以在名称中添加一个数字(例如 build-10-aaa.xml),以便轻松排序和迭代构建文件列表。
To give a good answer, you need to give more information.
Is the build file been generated? Uniquely for each customer? Is it called from the global build file automatically, or by humans? Do they have to be called in a specific order?
If the "other" build files reside in different (sub-)directories, you can just name them build.xml. That would be the default for ant and is easily recognized. Otherwise I would give them a postfix according to the project or artifact that is generated. So, for example, if the artifact is aaa.jar you can name the build file build-aaa.xml. If they have to be called in a specific order you can add a number to the name (e.g. build-10-aaa.xml) so that it is easy to sort and iterate over a list of build files.