ant实用手册(三)——ant中的task

  1. 什么是ant中的task
    ant通过任务实现其功能,比如:编译通过javac任务实现,打jar包通过jar任务完成等等
  2. ant中的常用任务:
    • javac:编译java代码
    • jar:打包class文件为jar
    • war:为web项目打包
    • zip:打包为zip文件
    • copy:复制文件或目录
    • delete:删除文件或目录
    • mkdir:创建文件夹
    • echo:输出信息
    • ftp:通过ftp传输文件
    • scp:通过scp传输文件
    • exec执行命令
  3. 以上列出了ant中最常用的任务,更全的任务列表请参考这里

    Given the large number of tasks available with Ant, it may bedifficult to get an overall view of what each task can do. The followingtables provide a short description of each task and a link to the completedocumentation.

    Archive Tasks
    Audit/Coverage Tasks
    Compile Tasks
    Deployment Tasks
    Documentation Tasks
    EJB Tasks
    Execution Tasks
    File Tasks
    Java2 Extensions Tasks
    Logging Tasks
    Mail Tasks
    Miscellaneous Tasks
    Pre-process Tasks
    Property Tasks
    Remote Tasks
    SCM Tasks
    Testing Tasks

    Archive Tasks [Back to top]
    Task Name Description
    BUnzip2

    Expands a file packed using GZip or BZip2.

    BZip2

    Packs a file using the GZip or BZip2 algorithm. This task does not do any dependency checking; the output file is always generated

    Cab

    Creates Microsoft CAB archive files. It is invoked similar to the Jar or Zip tasks. This task will work on Windows using the externalcabarc tool (provided by Microsoft), which must be located in your executable path.

    Ear

    An extension of the Jar task with special treatment for files that should end up in an Enterprise Application archive.

    GUnzip

    Expands a GZip file.

    GZip

    GZips a set of files.

    Jar

    Jars a set of files.

    Jlink

    Deprecated. Use the zipfileset and zipgroupfileset attributes of theJar or Zip tasks instead.

    Manifest

    Creates a manifest file.

    Rpm

    Invokes the rpm executable to build a Linux installation file. This task currently only works on Linux or other Unix platforms with RPM support.

    SignJar

    Signs a jar or zip file with the javasign command-line tool.

    Tar

    Creates a tar archive.

    Unjar

    Unzips a jarfile.

    Untar

    Untars a tarfile.

    Unwar

    Unzips a warfile.

    Unzip

    Unzips a zipfile.

    War

    An extension of the Jar task with special treatment for files that should end up in theWEB-INF/lib,WEB-INF/classes, orWEB-INF directories of the Web Application Archive.

    Zip

    Creates a zipfile.

    Audit/Coverage Tasks [Back to top]
    Task Name Description
    JDepend

    Invokes the JDepend parser. This parser "traverses a set of Java source-file directories and generates design-quality metrics for each Java package".

    Compile Tasks [Back to top]
    Task Name Description
    Depend

    Determines which classfiles are out-of-date with respect to their source, removing the classfiles of any other classes that depend on the out-of-date classes, forcing the re-compile of the removed classfiles. Typically used in conjunction with theJavac task.

    Javac

    Compiles the specified source file(s) within the running (Ant) VM, or in another VM if thefork attribute is specified.

    Apt

    Runs the annotation processor tool (apt), and then optionally compiles the original code, and any genera

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值