Getting started > How to run it? > The Integration into Ant | 2005-10-04 00:11:20 v0.90 | |
Jacson, say Jackson, think J-ScanThe Integration into Ant |
Download Jacson | Sourceforge Project Summary | Jacson Home | SourceForge Home |
What is Jacson? Getting started Download instructions How to install? Configuration How to run it? The Commandline The Integration into Ant The Jacson Ant Task Embed in a Java Program How it works? Contact How to Contribute? Developer Information Other information | Let's assume you know what Jakarta Ant is. There are two entirely different ways to embed Jacson into a Ant task.
The Ant Task
The <taskdef name="jacson" classname="de.spieleck.app.jacson.ant.JacsonTask"/>in your build.xml .
A sample for a startable task in the shipped build.xml 01: <target name="demo3" depends="taskdemo-prepare"> 02: <property name="count" value="42"/> 03: <jacson config="${sample.dir}/head.conf" out="demo3.txt" 04: in="${sample.dir}/data/access.log.gz" 05: /> 06: <echo>count="${count}"</echo> 07: </target>This task starts the configuration explained above. When you run it, you will observe, that the task grabs the first 42 lines of the log file access.log.gz
instead of the first 2. That is, settings in the
build.xml override settings in the head.conf .
Note: This is not entirely true as demonstrated in other
demo tasks. Once the JacsonTask has set a
variable Ant refuses to change it. This could
easily be changed in the ProjectJacsonState , but maybe
it is a feature and not a bug.
Fore more information please
have a look at the Note: There are is a problem concerning Ant Tasks right
now. To avoid getting strange output and Ant configuration
should only have one toplevel report and no filename attached to it!
Then the AntTask
The Filter
The
Of course you need to have Jacson in your classpath or
use the
The second most important thing about the Filter is that you need
a Ant Filter parameter <filterchain> ... more filters ... <filterreader classname="de.spieleck.app.jacson.ant.JacsonAntFilter"> <classpath ...point.to.jacson.jar.if.not.globaly/> <param name="config" value="point.to.your.configuration"/> </filterreader> ... more filters ... </filterchain> Note: | ||
| |||
top |