Ant is becoming increasingly widely used as a build and deploy tool for Java applications. This chapter is about how I am using Ant in this tutorial. It is nothing particular to do with Jini. This chapter can be skipped until you start building and deploying examples from this book.
Applications consisting of multiple source benefit from having some
build tool to automate compilation, deployment, testing, etc.
Many of these tools are operating system specific such as
This tutorial is being adapted to use
There are two general parameters that need to be set for your own environment
Similar to many projects, we adopt the following directory structure
The following targets are defined
The toplevel file
Each project is defined in an Ant file in the
Each project uses only a small number of the files from the
<property name="src.files"
value="
common/MIMEType.java,
common/FileClassifier.java,
complete/FileClassifierImpl.java,
complete/FileClassifierServer.java
"
/>
Since Jini is a distributed system, not all class files are required by all components. Typically a server will require some files whereas a client will require others. These are defined by two further variables
<!-- Class files to run the server -->
<property name="class.files"
value="
common/MIMEType.class,
common/FileClassifier.class,
complete/FileClassifierImpl.class,
complete/FileClassifierServer.class
"
/>
<!-- Class files for the client to download --->
<property name="class.files.dl"
value="
complete/FileClassifierImpl.class
"
/>
The rest of each project file is fairly straightforward. The
The complete project file for
If you found this chapter of value, the full book is available from APress or Amazon . There is a review of the book at Java Zone . The current edition of the book does not yet deal with Jini 2.0, but the next edition will.
This work is licensed under a
Creative Commons License, the replacement for the earlier Open Content License.