Note of Apache Ant - Core Tasks

简介:
 
Here will note some useful task of ant, this maybe used in high frequency in daily operate.  But some too common task will be not mention here, such as "ant".
 
 
< condition  property ="javamail.complete" > 
         < and > 
             < available  classname ="javax.activation.DataHandler" /> 
             < available  classname ="javax.mail.Transport" /> 
         </ and > 
     </ condition >
 
Sets the property "javamail.complete" if both the JavaBeans Activation Framework and JavaMail are available in the classpath.
 
< condition  property ="isMacOsButNotMacOsX" > 
         < and > 
             < os  family ="mac" /> 

             < not > 
                 < os  family ="unix" /> 

             </ not > 
         </ and > 
     </ condition > 
 
Sets the property "isMacOsButNotMacOsX " if the current operating system is MacOS, but not MacOS X - which Ant considers to be in the Unix family as well.
 
Copy
Copy a single file
< copy  file ="myfile.txt"  tofile ="mycopy.txt" /> 
Copy a single file to a directory
< copy  file ="myfile.txt"  todir ="../some/other/dir" />
Copy a directory to another directory
< copy  todir ="../new/dir" > 
         < fileset  dir ="src_dir" /> 
     </ copy >
 
Copy a set of files to a directory
< copy  todir ="../dest/dir" > 
         < fileset  dir ="src_dir" > 
             < exclude  name ="**/*.java" /> 
         </ fileset > 
     </ copy > 

     < copy  todir ="../dest/dir" > 
         < fileset  dir ="src_dir"  excludes ="**/*.java" /> 
     </ copy >
 
 
Zip
 
Creates a zipfile.
< zip  destfile ="${dist}/manual.zip" 
              basedir ="htdocs/manual" 
              update ="true" 
     />
zips all files in the htdocs/manual directory into a file called manual.zip in the ${dist} directory. If manual.zip doesn't exist, it is created; otherwise it is updated with the new/changed files.
 
< zip  destfile ="${dist}/manual.zip" > 
         < fileset  dir ="htdocs/manual" /> 
         < fileset  dir ="."  includes ="ChangeLog.txt" /> 
     </ zip >
zips all files in the htdocs/manual directory, and also adds the file ChangeLog.txt in the current directory. ChangeLog.txt will be added to the top of the ZIP file, just as if it had been located at htdocs/manual/ChangeLog.txt.
 
Jar
Jars a set of files.
< jar  destfile ="test.jar"  basedir ="." > 
         < include  name ="build" /> 
         < manifest > 
            <!--  Who is building this jar? --> 
             < attribute  name ="Built-By"  value ="${user.name}" /> 
            <!--  Information about the program itself --> 
             < attribute  name ="Implementation-Vendor"  value ="ACME inc." /> 
             < attribute  name ="Implementation-Title"  value ="GreatProduct" /> 
             < attribute  name ="Implementation-Version"  value ="1.0.0beta2" /> 
            <!--  details --> 
             < section  name ="common/class1.class" > 
                 < attribute  name ="Sealed"  value ="false" /> 
             </ section > 
         </ manifest > 
     </ jar >
This is an example of an inline manifest specification including the version of the build program (Implementation-Version). Note that the Built-By attribute will take the value of the Ant property ${user.name}.




    本文转自danni505 51CTO博客,原文链接:http://blog.51cto.com/danni505/172634,如需转载请自行联系原作者


相关文章
|
XML Java Apache
【Apache Ant】ANT解析以及ANT在myEclipse中的使用
【Apache Ant】ANT解析以及ANT在myEclipse中的使用
519 0
【Apache Ant】ANT解析以及ANT在myEclipse中的使用
|
Java Apache 数据格式
【Apache Ant】ANT解析以及ANT在myEclipse中的使用
转载请注明出处:http://blog.csdn.net/qq_26525215 本文源自【大学之旅_谙忆的博客】 维基百科上对Ant的介绍: Apache Ant,是一个将软件编译、测试、部署等步骤联系在一起加以自动化的一个工具,大多用于Java环境中的软件开发。
1565 0
|
Java Apache
手动利用Apache Ant构建部署自己的Java项目
虽然Eclipse从3.0开始已经继承了Ant插件,大家的项目可以自动构建 部署,此篇文章看也没多大用处,但是手动去自己使用以下 Ant来构建自己的Java项目也是一件有意义的事情,虽然现在已经没用人用Javac Java命令行的方式 来搞程序。
1186 0
|
Java Apache Maven
替代Apache Ant的最佳工具
尽管最近Apache Ant发布了最新的1.9.2版,下载地址见:http://ant.apache.org/bindownload.cgi 但是,Apache Ant毕竟是几年前的产物,它的有些方法、思想和理念已经落后于当前主流的Maven等工具。
1120 0
|
Java Apache Maven
替代Apache Ant的最佳工具
版权声明:本文为博主chszs的原创文章,未经博主允许不得转载。 https://blog.csdn.net/chszs/article/details/9322389 《替代Apache Ant的最佳工具》 作者:chszs,转载需注明。
1104 0
|
9月前
|
人工智能 数据处理 API
阿里云、Ververica、Confluent 与 LinkedIn 携手推进流式创新,共筑基于 Apache Flink Agents 的智能体 AI 未来
Apache Flink Agents 是由阿里云、Ververica、Confluent 与 LinkedIn 联合推出的开源子项目,旨在基于 Flink 构建可扩展、事件驱动的生产级 AI 智能体框架,实现数据与智能的实时融合。
1519 6
阿里云、Ververica、Confluent 与 LinkedIn 携手推进流式创新,共筑基于 Apache Flink Agents 的智能体 AI 未来
|
存储 Cloud Native 数据处理
从嵌入式状态管理到云原生架构:Apache Flink 的演进与下一代增量计算范式
本文整理自阿里云资深技术专家、Apache Flink PMC 成员梅源在 Flink Forward Asia 新加坡 2025上的分享,深入解析 Flink 状态管理系统的发展历程,从核心设计到 Flink 2.0 存算分离架构,并展望未来基于流批一体的通用增量计算方向。
701 0
从嵌入式状态管理到云原生架构:Apache Flink 的演进与下一代增量计算范式

推荐镜像

更多