D:/HelloAntWorld>ant all
Buildfile: D:/HelloAntWorld/build.xml
init:
compile:
[javac] D:/HelloAntWorld/build.xml:26: warning: 'includeantruntime' was not
set, defaulting to build.sysclasspath=last; set to false for repeatable builds
[javac] Compiling 1 source file to D:/HelloAntWorld/classes
jar:
[jar] Building jar: D:/HelloAntWorld/lib/HelloAntWorld.jar
all:
BUILD SUCCESSFUL
Total time: 0 seconds
就这样一个简单的Ant 入门示例就OK了。
话说我这个人现在比较喜欢在网上找资料看,目前英文文档对我来说基本没什么问题,所以尽量找英
文文档,一则看得会比中文快,而且比较能够了解作者的意思。在现在的公司工作的最大的好处是我
每天除了看到英文还是英文,连OS也是英文的。really a good chance!
Ant Build 文件都是XML形式的。每一个build 文件包含一个project 和至少一个target tag.
每一个project定义了一个或者多个target.
Attribute Description Required
name the name of the project. No
default the default target to use when no target is supplied. No; however, since Ant 1.6.0 , every pr
oject includes an implicit target that contains any and all top-level tasks and/or types. This target will alw
ays be executed as part of the project's initialization, even when Ant is run with the -projecthelp option.
basedir the base directory from which all path calculations are done. This attribute might be overridde
n by setting the "basedir" property beforehand. When this is done, it must be omitted in the project ta
g. If neither the attribute nor the property have been set, the parent directory of the buildfile will be use
d. No
Target: A target is a set of tasks you want to be executed.
即命令的集合。
可以指定哪个target先执行,如果未指定,project的default被执行。