Java Reference
In-Depth Information
Example 9.3 Using the PatternSet datatype
<patternset id="nontest.source">
<include name="**/*.java">
<exclude name="**/*Test.java">
<patternset>
<target name="build">
<javac destdir="build">
<src path="src"/>
<patternset refid="nontest.source"/>
</javac>
</target>
In general, datatypes give you more sophisticated control than do the at-
tributes of a task. Take a look at the Ant User's Manual 10 for full details on ant .
9.4.3
Let's take it to the next level and examine a real working buildfile.
A Real, Live Buildfile
9.4.3.1
All but the simplest of projects will require multiple classes. Some will require
libraries, multiple programs, binary deployment, Web deployment, enterprise
deployment, and so on. A project will be most successful if you plan out what
goes where in advance. We're going to present a series of suggestions for how
to organize the files involved in developing, building, and deploying a Java
project with ant . By no means is this the only way it might be done, but it has
worked well for us.
Project Organization
9.4.3.2
Example 9.4 is the actual Ant buildfile for the Payback program in our source
code examples. These examples are available on the topic's Web site. 11
The build.xml File for Payback
10. http://ant.apache.org/manual/
11. http://www.javalinuxbook.com/
Search WWH ::




Custom Search