Use Ant to make you programs (2)

xiaoxiao2021-03-06  101

[Home, Previous, Next]

2 universal configuration

Summary: Introduction Build_Common.xml, Common.xml and USAGE.TXT

Build_common.xml

Copyright 2004 CAMRY.WU@gmail.com

This Program Is Free Software; You Can Redistribute IT and / or Modify

It Under The Terms of The GNU General Public License As Published by

The Free Software Foundation; Either Version 2 of the license, OR

ANY LATER VERSION.

This Program is Distributed in the Hope That IT Will Be Useful,

But without Any Warranty; WITHOUT EVEN THE IMPLIED WARRANTY OF

Merchantability or fitness for a particular purpose. See the

GNU General Public License for more details.

You Should Have Received A Copy of The GNU General Public License

Along with this program; if not, Write to the Free Software

Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

->

Semanticattributes = "true"

Keeproot = "false" />

Depends = "Project_init"

Description = "Initialize ENVIRONMENT">

Srcfile = "$ {path.common} /"} />

Depends = "init" description = "prepare build directory">

Classpath = "$ {path.common} /lib/checkstyle-all-3.4.jar" />

File = "$ {path.common} /lib/checkstyle.cache" />

DepRecation = "$ {compile.DepRecation}"

Destdir = "$ {Dist} / classes"

Target = "$ {compile.jdk-version.target}"

Source = "$ {compile.jdk-version.source}"

Optimize = "$ {compile.optimize}"

SRCDIR = "$ {src}">

Depends = "Project_clean"

Description = "Wipeout All generated files">

Depends = "Checkstyle, Compile"

Description = "CREATE BINARY Distribution">

JARFILE = "$ {dist.lib} / $ {component.name} - $ {component.version} .jar">

Run all Test classes in the DIST / CLASSES directory

Note that JUnit.jar is included in the LIB directory of Ant.

->

Fork = "false"

Haltonfailure = "false"

FailureProperty = "tests.failed"

Showoutput = "True">

*********************************************************** *******

*********************************************************** *******

**** One or more tests failed! Check the output ... ****

*********************************************************** *******

*********************************************************** *******

Depends = "Project_Deploy" Description = "deploy application" />

Depends = "compile"

Description = "CREATE Component Javadoc Documentation">

Bottom = "$ {component.title}"

Destdir = "$ {DOCS.API}"

Source = "$ {compile.jdk-version.source}"

DOCTITLE = "$ {component.title}"

PackageNames = "*"

Access = "protected"

SourcePath = "$ {src.main}"

Version = "True"

Windowtitle = "$ {component.title}>

Depends = "Project_Fetch" Description = "Fetch Current Source from CVS">

Depends = "Checkstyle, Compile"

Description = "CREATES SOURCE DISTRIBUTION">

Destfile = "$ {dist.lib} / $ {component.name} - $ {component.version} -src.zip"

WHENEMPTY = "fail">

Upload the source file to the server backup, upload the target file to the server release.

The contents of this task are set by yourself, usually running the FTP task.

->

Depends = "Clean, Jar, Javadoc, Src-Zip" Description = "Publish Project">

Build ->

Depends = "Clean, Fetch, Test, Jar, Javadoc, Deploy"

Description = "build project" />

Common.xml

Copyright 2004 CAMRY.WU@gmail.com

Common Ant Build Environment

->

Path configuration, basically no change.

But if you use this build tool in a strange environment,

Maybe a slightly modify the configuration of these paths.

->

USAGE.TXT $ {Component.name} build file

- - - - - - - - - - - -

Available Targets Are:

Prepare -> Initialization Project Environment

CheckStyle -> Check source file coding specification

Compile -> Compilation

Jar -> package

Build -> Build

Test -> Test

Clean -> Clear

Deploy -> Publish to the web server

Publish -> Publish products (source and target files)

FETCH -> Get the latest resources from CVS

DOCS -> Create an API document

All -> Execute Clean, Fetch, Build, Test, DOC, Deploymain -> Default Build Process (self-modify)

[Home, Previous, Next]

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

New Post(0)