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:
repository1.project.version
repository2.project.version
build.root
resources.dir
version.folder
archive.dir
install.dir
and so on.
David
|---------+---------------------------->
| | THUFIR HAWAT |
| | <[EMAIL PROTECTED]|
| | il.com> |
| | |
| | 05/23/2005 06:21 |
| | AM |
| | Please respond to|
| | "Ant Users List" |
| | |
|---------+---------------------------->
>------------------------------------------------------------------------------------------------------------------------------|
|
|
| To: Ant Users List <[email protected]>
|
| 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. Test16.java imports Tidy.jar, otherwise the source code is
straightforward. I'm particularly interested in naming conventions.
[EMAIL PROTECTED] java]$
[EMAIL PROTECTED] java]$ cat build.xml
<project name="XHTML" default="package">
<import file="properties.xml" />
<target name="clean">
<delete dir="${outputDir}" />
</target>
<target name="prepare" depends="clean">
<mkdir dir="${outputDir}" />
</target>
<target name="compile" depends="prepare">
<javac
srcdir ="${sourceDir}"
destdir ="${outputDir}"
classpath ="${includeJar}"
/>
</target>
<target name="package" depends="compile">
<jar jarfile="${outputDir}/${mainClass}.jar"
basedir="${outputDir}" >
<manifest>
<attribute name="Main-Class"
value="${pkgPath}${mainClass}"/>
</manifest>
</jar>
</target>
</project>
[EMAIL PROTECTED] 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="user.name" value="thufir" />
</project>
[EMAIL PROTECTED] java]$
thanks,
Thufir
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]