Apache Ant User Manual Guide – Version 1.6.0 12/29/2003 9:39 AM
Total Page:16
File Type:pdf, Size:1020Kb
Apache Ant User Manual Guide – Version 1.6.0 12/29/2003 9:39 AM Apache Ant User Manual Guide Version 1.6.0 Compiled by: Abdul Habra (www.tek271.com) From: http://ant.apache.org/ 12/2003 Copyright © 2000-2003 Apache Software Foundation. All rights Reserved. 1 of 130 Apache Ant User Manual Guide – Version 1.6.0 12/29/2003 9:39 AM 2 of 130 Apache Ant User Manual Guide – Version 1.6.0 12/29/2003 9:39 AM Contents At A Glance 1 Apache Ant User Manual Authors ............................................................................................................9 2 Feedback and Troubleshooting .............................................................................................................10 3 Introduction.........................................................................................................................................11 4 Installing Ant .......................................................................................................................................12 5 Running Ant ........................................................................................................................................18 6 Using Ant ............................................................................................................................................23 7 Concepts .............................................................................................................................................30 8 Listeners & Loggers..............................................................................................................................86 9 Ant in Anger (Using Apache Ant in a Production Development System) ...................................................90 10 Apache Ant Task Design Guidelines.................................................................................................. 102 11 Writing Your Own Task ................................................................................................................... 108 12 Tasks Designed for Extension .......................................................................................................... 114 13 InputHandler .................................................................................................................................. 115 14 Using Ant Tasks Outside of Ant........................................................................................................ 116 15 Tutorial: Writing Tasks .................................................................................................................... 118 16 License........................................................................................................................................... 130 3 of 130 Apache Ant User Manual Guide – Version 1.6.0 12/29/2003 9:39 AM Table Of Contents 1 Apache Ant User Manual Authors ............................................................................................................9 2 Feedback and Troubleshooting .............................................................................................................10 3 Introduction.........................................................................................................................................11 3.1 Why? .........................................................................................................................................11 4 Installing Ant .......................................................................................................................................12 4.1 Getting Ant.................................................................................................................................12 4.1.1 Binary Edition .........................................................................................................................12 4.1.2 Source Edition ........................................................................................................................12 4.2 System Requirements .................................................................................................................12 4.3 Installing Ant..............................................................................................................................12 4.3.1 Setup .....................................................................................................................................13 4.3.2 Optional Tasks ........................................................................................................................13 4.3.3 Windows and OS/2 .................................................................................................................13 4.3.4 Unix (bash) ............................................................................................................................13 4.3.5 Unix (csh) ..............................................................................................................................13 4.3.6 Advanced ...............................................................................................................................13 4.4 Building Ant................................................................................................................................14 4.5 Library Dependencies ..................................................................................................................15 4.6 Platform Issues...........................................................................................................................16 4.6.1 Unix.......................................................................................................................................16 4.6.2 Microsoft Windows..................................................................................................................16 4.6.3 Cygwin ...................................................................................................................................16 4.6.4 Apple MacOS X .......................................................................................................................17 4.6.5 Novell Netware .......................................................................................................................17 4.6.6 Other platforms ......................................................................................................................17 5 Running Ant ........................................................................................................................................18 5.1 Command Line ...........................................................................................................................18 5.1.1 Command-line Options Summary.............................................................................................18 5.1.2 Library Directories...................................................................................................................19 5.1.3 Files.......................................................................................................................................20 5.1.4 Environment Variables ............................................................................................................20 5.1.5 Java System Properties ...........................................................................................................20 5.1.6 Cygwin Users..........................................................................................................................21 5.1.7 OS/2 Users .............................................................................................................................22 5.2 Running Ant via Java ..................................................................................................................22 6 Using Ant ............................................................................................................................................23 6.1 Writing a Simple Buildfile.............................................................................................................23 6.1.1 Projects ..................................................................................................................................23 6.1.2 Targets ..................................................................................................................................23 6.1.3 Tasks .....................................................................................................................................24 6.1.4 Properties...............................................................................................................................25 6.1.5 Built-in Properties ...................................................................................................................25 6.1.6 Example Buildfile ....................................................................................................................25 6.1.7 Token Filters ..........................................................................................................................26 6.1.8 Path-like Structures.................................................................................................................27 6.1.9 Command-line Arguments .......................................................................................................28 6.1.10 References .............................................................................................................................29