List of Listings

Chapter 1. Introducing Ant

Listing 1.1. A typical scenario: compile, document, package, and deploy

Chapter 2. A first Ant build

Listing 2.1. Our first complete build file, including packaging and executing a Java program

Chapter 4. Testing with JUnit

Listing 4.1. Integrated testing, reporting, and failure

Chapter 5. Packaging projects

Listing 5.1. Example target to generate Unix and Windows Readme files from the same original

Listing 5.2. Creating a binary Zip distribution

Listing 5.3. Creating a tar file from our expanded Zip file

Chapter 6. Executing programs

Listing 6.1. An entry point to add events to our diary

Chapter 7. Distributing our application

Listing 7.1. Uploading files to a Unix system

Listing 7.2. The offline probe from Ant’s own build file

Listing 7.3. Using <antcall> to manage a series of distribution actions

Chapter 8. Putting it all together

Listing 8.1. The entry-point targets for the build file

Listing 8.2. Setting Ant properties to the locations and values of the build file

Listing 8.3. Declaring the datatypes for the project: the paths and filesets that will be referred to by refid references in tasks.

Listing 8.4. Compiling the source and creating a JAR file

Listing 8.5. Running the unit tests and creating the reports

Listing 8.6. Preparing the documentation and scripts

Listing 8.7. Signing the JAR files

Listing 8.8. Creating the Zip files

Listing 8.9. The target to email the Zip file with a covering note

Listing 8.10. Targets to upload the files to a remote server

Chapter 9. Beyond Ant’s core tasks

Listing 9.1. Using <propertyfile> to capture build-time information

Listing 9.2. Using <propertyfile> to increment a build number and set a future date in the same file

Listing 9.3. Checkstyle.xml: checking our coding style standards

Listing 9.4. Our checkstyle-policy.xml policy file

Chapter 10. Working with big projects

Listing 10.1. An initial set of entry-point targets

Listing 10.2. Using <ant> to build subprojects

Listing 10.3. Dependency logic inside a master build file

Chapter 11. Managing dependencies

Listing 11.1. The ivy.xml file for the diary-core module

Listing 11.2. The diary’s Ivy configuration file, diary/ivyconf.xml

Chapter 12. Developing for the Web

Listing 12.1. A servlet to publish events as an Atom feed

Listing 12.2. A JSP page, happy.jsp

Listing 12.3. The web.xml file, in web/WEB-INF/web.xml

Listing 12.4. The simplest way to deploy to Tomcat is by copying the WAR file to the web application directory of the sever

Listing 12.5. Targets to compile the tests into a JAR file

Chapter 13. Working with XML

Listing 13.1. An XML schema for a file with no namespace. This can validate any XML document that doesn’t declare itself to be in any namespace.

Listing 13.2. A modified XSD file to declare the schema for a single namespace

Listing 13.3. A <presetdef> to validate documents against the SOAP1.2 specifications

Listing 13.4. The DTD for our constants, in xml/format.dtd

Listing 13.5. The initial constants file. It defines three URIs and the names of three elements in some proposed XML.

Listing 13.6. The style sheet, toJava.xsl, which generates Java from the XML constants

Listing 13.7. The toHtml.xsl style sheet. It’s a lot easier to generate HTML than Java.

Chapter 14. Enterprise Java

Listing 14.1. The interface for the calendar session bean

Listing 14.2. An application.xml file targeting JBoss

Listing 14.3. A Cactus test case to run on the server

Listing 14.4. Targets to deploy the EAR file and run the Cactus test suite

Chapter 16. Deployment

Listing 16.1. A SmartFrog file to fetch and deploy the MySQL JDBC driver

Listing 16.2. How to compose a system from components

Listing 16.3. The SmartFrog deployment descriptor to deploy everything

Chapter 17. Writing Ant tasks

Listing 17.1. A task to set a property to the size of a file

Listing 17.2. The build file for the <filesize> task

Listing 17.3. Java enumerations can be used as task attributes.

Chapter 18. Extending Ant further

Listing 18.1. An inline BeanShell script

Listing 18.2. A task written in Jython, using <scriptdef>

Listing 18.3. A condition to test for a number being even

Listing 18.4. A custom resource to generate strongly random data

Listing 18.5. A mapper that converts filenames to uppercase

Listing 18.6. A custom filter to convert read text to uppercase

Listing 18.7. A listener that collects statistics

Listing 18.8. A build file that always fails. The success and failure messages are for the logger in section 18.7.2.

Listing 18.9. A new logger, an extension of the normal one, that replaces the normal success/failure message with one from project properties

Listing 18.10. A private run of Ant

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset