[Home, Previous, Next]
2 universal configuration
Summary: Introduction Build_Common.xml, Common.xml and USAGE.TXT
Build_common.xml XML Version = "1.0" encoding = "ISO-8859-1"?>
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" /> fileset> fileset> path> path> Depends = "Project_init" Description = "Initialize ENVIRONMENT"> target> Srcfile = "$ {path.common} /"} /> target> Depends = "init" description = "prepare build directory"> fileset> copy> target> Classpath = "$ {path.common} /lib/checkstyle-all-3.4.jar" /> File = "$ {path.common} /lib/checkstyle.cache" /> checkstyle> target> DepRecation = "$ {compile.DepRecation}" Destdir = "$ {Dist} / classes" Target = "$ {compile.jdk-version.target}" Source = "$ {compile.jdk-version.source}" Optimize = "$ {compile.optimize}" SRCDIR = "$ {src}"> javac> target> Depends = "Project_clean" Description = "Wipeout All generated files"> target> Depends = "Checkstyle, Compile" Description = "CREATE BINARY Distribution"> delete> JARFILE = "$ {dist.lib} / $ {component.name} - $ {component.version} .jar"> jar> fileset> delete> target>
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"> fileset> batchtest> junit> *********************************************************** ******* *********************************************************** ******* **** One or more tests failed! Check the output ... **** *********************************************************** ******* *********************************************************** ******* lot> target> 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}> javadoc> target> Depends = "Project_Fetch" Description = "Fetch Current Source from CVS"> target> Depends = "Checkstyle, Compile" Description = "CREATES SOURCE DISTRIBUTION"> delete> Destfile = "$ {dist.lib} / $ {component.name} - $ {component.version} -src.zip" WHENEMPTY = "fail"> zip> target>
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"> target> Build -> Depends = "Clean, Fetch, Test, Jar, Javadoc, Deploy" Description = "build project" /> provject> Common.xml XML Version = "1.0" Encoding = "ISO-8859-1">
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. -> build> dist> docs>
src> JDK-VERSION> compile> root> 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]