什么是命名Ant目标的最佳实践? [英] What are the best practices for naming ant targets?

查看:92
本文介绍了什么是命名Ant目标的最佳实践?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是命名Ant目标的最佳实践?

例如,你会期望目标测试跑?所有单元测试?所有的功能测试?两者都是?

什么是用于运行不同类型的测试(单位/功能/全部)的标准名称?是否有目标名称的标准在J2SE软件部署?在J2EE?

我的项目使用Ant的使用JUnit,Swing应用程序和J2EE应用程序的Java项目。


解决方案

查看 命名约定部分:蚂蚁风格的的元素


  

下面的目标是共同的许多基础之上。始终避免改变
  一个公知的目标名称的行为。你并不需要实现
  所有这些在一个单一的项目。


 全部编译和测试的一切;创建一个分布,选择安装。
清理删除所有生成的文件和目录。
部署在部署code,平时到远程服务器。
DIST产生distributables。
distclean命令只清理分发文件。
文档生成的所有文件。
的init编译:创建目录,调用<&TSTAMP GT;和其他共同行动。
安装执行本地安装。
的javadoc生成的Javadoc页面。
printerdocs生成可打印的文档。
试运行单元测试。
卸载删除本地安装。

本页面还提供了其他好的指导方针。

What are the best practices for naming ant targets?

For example, what would you expect the target "test" to run? All unit tests? All functional tests? Both?

What are the standard names used for running different types of tests (unit/functional/all)? Are there standards for target names to deploy software in J2SE? in J2EE?

My project uses ant for a java project with junit, Swing applications, and J2EE applications.

解决方案

See the "Naming Conventions" section on this page : The Elements of Ant Style

The following targets are common to many builds. Always avoid changing the behavior of a well-known target name. You do not need to implement all of these in a single project.

all               Build and test everything; create a distribution, optionally install. 
clean             Delete all generated files and directories. 
deploy            Deploy the code, usually to a remote server. 
dist              Produce the distributables. 
distclean         Clean up the distribution files only. 
docs              Generate all documentation. 
init              Initialize the build: create directories, call <tstamp> and other common actions. 
install           Perform a local installation. 
javadocs          Generate the Javadoc pages. 
printerdocs       Generate printable documents. 
test              Run the unit tests. 
uninstall         Remove a local installation. 

This page also provides other good guidelines.

这篇关于什么是命名Ant目标的最佳实践?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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