ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "David TROGDON" <>
Subject Re: first build (well, not quite first)
Date Mon, 23 May 2005 13:24:05 GMT

Not that I am an expert by any stretch of the imagination:

Some targets and structure you might consider depending on your build.

init - sets properties for the build

prepare - creates build directory, test directory etc.

fetch - checkout or fetch the source code from a source code repository

compile - compiles

test - executes any JUnit testing etc,

jar - creates necessary jar files

docs - generates JavaDocs as required

deploy - generates or prepares application for deployment

In addition, additional targets could preform any or all the following:

build - incremental build

publish - output the source and binaries to a publication site

all - complete build from start to finish

main - default or basic build and test

init-debug- called from init to set up properties for a debug build

init-release - called from init to set up a release build

staging - moves project to a pre-production area

I won't say everyone needs or uses all these steps in every build. I won't
say everyone or even most use these target names but as you read and learn
about Ant you will find that you use many of these steps. If there is a
"standard" naming convention for targets, this list probably comes close.

When it comes to property names, there are probably as many variations as
there are script writers. Some examples I have used:


and so on.


|         |           THUFIR HAWAT     |
|         |           <hawat.thufir@gma|
|         | >          |
|         |                            |
|         |           05/23/2005 06:21 |
|         |           AM               |
|         |           Please respond to|
|         |           "Ant Users List" |
|         |                            |
  |       To:       Ant Users List <>                           
  |       cc:                                                                            
  |       bcc:                                                                           
  |       Subject:  first build (well, not quite first)                                  

I'm fairly new to ant, so I'm soliciting critique on what I have so
far. imports Tidy.jar, otherwise the source code is
straightforward.  I'm particularly interested in naming conventions.

[thufir@localhost java]$
[thufir@localhost java]$ cat build.xml
<project name="XHTML" default="package">

        <import file="properties.xml" />

        <target name="clean">
                <delete dir="${outputDir}" />

        <target name="prepare" depends="clean">
                <mkdir dir="${outputDir}" />

        <target name="compile" depends="prepare">
                        srcdir          ="${sourceDir}"
                        destdir         ="${outputDir}"
                        classpath       ="${includeJar}"

        <target name="package" depends="compile">
                <jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}" >
                                <attribute name="Main-Class"

[thufir@localhost java]$ cat properties.xml
<project name="properties">
        <property name="outputDir" value="/home/thufir/java/bin/" />
        <property name="sourceDir" value="/home/thufir/java/src/" />
        <property name="mainClass" value="Test16" />
        <property name="pkgPath" value="atreides.tidyXhtml." />
        <property name="includeJar" value="/home/thufir/java/lib/Tidy.jar"
        <property name="" value="thufir" />
[thufir@localhost java]$



To unsubscribe, e-mail:
For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message