什么是构建自动化软件(例如 Ant)? [英] What is build automation software (for example, Ant)?

查看:35
本文介绍了什么是构建自动化软件(例如 Ant)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常看到 ant 的引用,但我不明白它到底是什么意思?据我所知,它应该编译您的项目,但我不能通过单击 Run->Run in eclipse 来做到这一点吗?

I see reference of ant a lot but I don't get exactly what its meant to do? from what i've heard its supposed to compile your projects but can't i just do that by clicking Run->Run in eclipse?

我想我应该重新表述我的问题.我已经知道 ant 是一个构建自动化软件",我的问题是,构建自动化究竟是什么?我认为你应该测试你的应用程序,当它运行时,你在 eclipse 中或通过命令行 java 单击构建"按钮,它会从中生成一个 .jar 文件?那么为什么需要自动化"这个过程?

Edit : I guess I should rephrase my question. I already know that ant is a 'build automation software', my question is, what exactly is build automation? I thought that you're supposed to test your app, and when it is running you click the 'build' button in eclipse or through command-line java, and it makes a .jar file out of it? So why do you need to 'automate' this process?

推荐答案

我已经知道 ant 是一个构建自动化软件",我的问题是,构建自动化到底是什么?我认为你应该测试你的应用程序,当它运行时,你在 eclipse 中或通过命令行 java 单击构建"按钮,它会从中生成一个 .jar 文件?那么为什么您需要自动化"这个过程?

并不是所有的 Java 开发都是通过 eclipse 完成的,也不是所有的 jars 都可以从命令行构建(或者应该从命令行构建).

Not all the Java development is done through eclipse and not all the jars may be built from the command line ( or should be built from the command line ) .

您可能需要额外运行测试用例、单元测试和许多其他过程.

You may need additionally run test cases, unit tests, and many, many other process.

ant 所做的是提供一种机制来自动执行所有这些工作(因此您不必每次都这样做),也许您可​​以在每天下午 6 点调用这个 ant 脚本.

What ant does, is provide a mechanism to automate all this work ( so you don't have to do it every time ) and perhaps you may invoke this ant script each day at 6 p.m.

比如在一些项目中,需要每天进行一次构建,以下是可以用ant自动完成的任务,这样它们就可以在没有人为干预的情况下运行.

For instance, in some projects, a daily build is needed, the following are the task that may be automated with ant, so they can run without human intervention.

  • 连接到 Subversion 服务器.
  • 下载/更新最新版本
  • 编译应用程序
  • 运行测试用例
  • 打包应用程序(在 jar、war、ear 或其他任何地方)
  • 将此构建二进制文件提交到 Subversion.
  • 在远程服务器上安装应用程序
  • 重启服务器
  • 发送包含工作摘要的电子邮件.

当然对于其他项目来说这有点过分,但对于其他一些项目非常有帮助.

Of course for other projects this is overkill, but for some others is very helpful.

这篇关于什么是构建自动化软件(例如 Ant)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆