ant build file 用于 java 自动运行脚本类似于linux 的bash 和 windows dos script. 常用于自动deploy war ear file to server.

ant 是基于xml file 通过tag 命令执行

 

一个build.xml 至少包含project and target tag

ant build file at least has one

require
attributes: name default basedir

  require
attributes: name depends??????

print the msg out on console

 

 

######### build file 匹配模式

pattern


? - Matches one character only.


* - Matches zero or many characters.


** - Matches zero or many directories recursively.

 

######常用标签

########

define variable


###default properties
ant.file The full location of the build file.
ant.version The version of the Apache Ant installation.
basedir The basedir of the build, as specified in the basedir attribute of the project element.
ant.java.version The version of the JDK that is used by Ant.
ant.project.name The name of the project, as specified in the name atrribute of the project element.
ant.project.default-target The default target of the current project.
ant.project.invoked-targets Comma separated list of the targets that were invoked in the current project.
ant.core.lib The full location of the Ant jar file.
ant.home The home directory of Ant installation.
ant.library.dir The home directory for Ant library files - typically ANT_HOME/lib folder.

 

tag 可以定义在build file 为了可维护和提高代码robust 可以将一些属性定义在build.properties 文件里面。 通过 引用build.properties 的内容。

 

 

#### 指定文件夹下选择需要的文件。 include tag 表示包含通过pattern 来选择 excluude 就是排除哪些文件


collection of files 



  
  


就是一个路径集合 在 下通过



 
 
 
 

 

####  compile


  
  
 



 
 
 

 

补充连接详细例子和部分tags

http://blog.csdn.net/yangdayin/article/details/7681567

 

http://www.cnblogs.com/xionghui/archive/2012/03/13/2393679.html