Ant common TASK

xiaoxiao2021-03-05  45

Installation:

1. set the ant_home environment variable to point to this location.

2. set the java_home environment variable to point to the jdk location.

3. Add ant_home / bin to your system's path environment variable.

Build file:

1. $ {build.dir} means referenced a var: build.dir

2. Specify DireTory:

3. Make Dir On Specified DireTory:

4. Clean Dir

5. Compile Java Files

Description = "Compiles All Source Code.">

destdir = "$ {build.classes}" />

6. Jar Java Files

Description = "generate oreilly.jar in the 'dist' Directory.">

Basedir = "$ {build.classes}"

Excludes = "** / * Test.class" />

7. Target Can Be Invoked Single: EG.

Command Line: Ant Jar

8. Specify ClassPath and Compile:

oral

9. Copy Files

10. Javadoc

SourcePath = "$ {src.dir}"

Destdir = "$ {doc.dir} / API"

Author = "True"

Version = "True"

Use = "true">

ALL IN A Build.xml File:

Description = "Compiles All Source Code.">

Description = "generate oreilly.jar in the 'dist' Directory.">

Basedir = "$ {build.classes}"

Excludes = "** / * Test.class" />

Description = "Cleans, Compiles, Then Builds the Jar File." />

转载请注明原文地址:https://www.9cbs.com/read-32947.html

New Post(0)