Section "Using Ant"

原创 2004年07月22日 13:14:00


Developing Games in Java值得一看,很多地方虽然是点到即止,但重点绝不漏掉!

Apache Ant is a free Java-based build tool and can be downloaded from Because Ant is Java-based, Ant build files can be compiled on any platform. Also, Ant is integrated into many Java IDEs, so you can get up and running quickly.

Ant build files are XML files, usually named build.xml. Listing I.1 contains an example build file.

Listing I.1 Sample Ant Build File (CSDN的blog贴不出xml格式文本。。。见下面回复内容)

The sample Ant file almost describes itself. First, two properties are created to specify the srcdir and destdir directories. Properties can be referred to using the ${varName} syntax.

The build file contains four targets: clean, compile, build, and rebuild.

The compile target compiles all Java files in the source directory, putting the compiled class files in the destination directory. The clean target deletes all of these classes.

The build target depends on the compile target, so running the build target automatically runs the compile target first. The build target packs all the compiled class files into a .jar file.

Finally, the rebuild target does nothing by itself, but depends on the clean and build targets to perform a clean build.

After you've got Ant installed, just open a command prompt in the directory of the build file and type in the target you want to execute, like this:

ant compile 

This command loads the build.xml file in the current directory and executes the compile target. If you were to name no target, as in the following, the build target is executed because it's defined to be the default target in the build file:


Besides running Ant from the command line, Ant is also tightly integrated into many IDEs and text editors, such as JBuilder, jEdit, Eclipse, IDEA, and NetBeans. For example, in jEdit (see Figure I.1), the AntFarm plug-in enables you to browse Ant files, execute targets with the click of the mouse, and even send compile errors to jEdit's ErrorList plug-in so you can click on errors to go directly to the source of the compile error.


[    32.314] (==) No screen section available. Using defaults. [    32.314] (**) |-->Screen "Defaul...
  • sitelist
  • sitelist
  • 2015年02月14日 21:36
  • 1190


  • qq_37257239
  • qq_37257239
  • 2017年02月01日 10:49
  • 492


  • edg2333
  • edg2333
  • 2016年09月28日 09:17
  • 663


出处: bss段:   bss段(bss segment)通常是指用来存放程序中未初始化...
  • wuhenyouyuyouyu
  • wuhenyouyuyouyu
  • 2017年05月04日 10:42
  • 512


  • sunshine940326
  • sunshine940326
  • 2016年09月21日 11:30
  • 7482


这篇文章主要介绍了Laravel模板引擎Blade中section的一些标签的区别介绍,本文讲解了@yield 与 @section、@show 与 @stop、@append 和 @override...
  • lifushan123
  • lifushan123
  • 2015年05月09日 13:18
  • 715


// OpenMP1.cpp : 定义控制台应用程序的入口点。 //sections和section指令 #include "stdafx.h" #include "omp.h" #include ...
  • LY_624
  • LY_624
  • 2016年10月25日 12:49
  • 399


Maven 一.Maven简介 Maven是基于项目对象模型(POM),可以通过一小段描述信息来管理项目的构建,报告和文档的软件项目管理工具。 目前,绝大多数开发人员都把 Ant 当作 Java...
  • tianyazaiheruan
  • tianyazaiheruan
  • 2013年10月10日 08:54
  • 19010


  • itlwc
  • itlwc
  • 2014年04月16日 17:47
  • 4505

ant 各种标签属性参数介绍

1 没有指定任何参数时,Ant会在当前目录下查询build.xml文件2 可以指定执行一个或多个target。当省略target时,Ant使用标签的default属性所指定的target3 编写bui...
  • s646575997
  • s646575997
  • 2016年07月28日 11:29
  • 1838
您举报文章:Section "Using Ant"