FOray
|
Using the FOray Ant TaskIntroductionAnt is a powerful tool for automating builds. FOray can be used from within Ant by using the custom FOray Ant Task. Define the Custom Ant TaskThe first step toward using FOray from within your Ant scripts is to define the custom task within the Ant script. It is generally desirable to define the task in a common target that is accessible to the remainder of the script, such as an "init" target. Defining the task simply tells Ant how to find the FOray Ant task class, and the classes that are needed to run FOray. In the example below, note that your location for ${foray.home} and the classpath may be different. <property name="foray.home" location="D:/foray/trunk/foray/"/> <taskdef name="foray" classname="org.foray.app.ant.FOray"> <classpath> <fileset dir="${foray.home}/build" includes="*.jar"/> <fileset dir="${foray.home}/lib" includes="*.jar"/> </classpath> </taskdef> ParametersAfter defining the task, you can use it within your script. Simply use it like any other Ant task, giving it the parameters that it needs to perform the desired processing. Parameters specified as attributes
ExamplesThe following example converts a single XSL-FO file to a PDF document: <target name="generate-pdf" description="Generate a single PDF file"> <foray format="application/pdf" fofile="D:/fo/document.fo" outfile="D:/pdf/document.pdf"/> </target> |