blob: 0d1ce30aea10c3c7e683221a5f71ca596f92f4bf [file] [log] [blame]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~ Licensed to the Apache Software Foundation (ASF) under one or more
~~ contributor license agreements. See the NOTICE file distributed with
~~ this work for additional information regarding copyright ownership.
~~ The ASF licenses this file to You under the Apache License, Version 2.0
~~ (the "License"); you may not use this file except in compliance with
~~ the License. You may obtain a copy of the License at
~~
~~ http://www.apache.org/licenses/LICENSE-2.0
~~
~~ Unless required by applicable law or agreed to in writing, software
~~ distributed under the License is distributed on an "AS IS" BASIS,
~~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~~ See the License for the specific language governing permissions and
~~ limitations under the License.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----
Introduction
-----
Apache Rat Ant Task Library
The Ant Task Library provides a single Ant task and a few supporting
Ant types to run Rat, the {{{../index.html}Release Audit Tool}}, from
inside {{{http://ant.apache.org/}Apache Ant}}.
Using Ant's resource abstraction the task can be used to check files
on disk as well as tarballs or even URLs directly.
Requirements
The Rat Ant Task Library requires Apache Ant 1.7.1 or higher (it
works well with 1.8.x), Apache Rat core and transitively all
dependencies of Apache Rat core.
In order to use the tasks Java 5 is required as of Rat 0.9 - Rat 0.8
and earlier require Java 1.4.
Installation
There are several ways to use the Antlib:
* The traditional way:
-------
<taskdef
resource="org/apache/rat/anttasks/antlib.xml">
<classpath>
<pathelement location="YOUR-PATH-TO/apache-rat-${version}.jar"/>
</classpath>
</taskdef>
-------
With this you can use the report task like plain Ant tasks,
they'll live in the default namespace. I.e. if you can run
<<<exec>>> without any namespace prefix, you can do so for
<<<report>>> as well.
* Similar, but assigning a namespace URI
-------
<taskdef
uri="antlib:org.apache.rat.anttasks"
resource="org/apache/rat/anttasks/antlib.xml">
<classpath>
<pathelement location="YOUR-PATH-TO/apache-rat-${version}.jar"/>
</classpath>
</taskdef>
-------
This puts your task into a separate namespace than Ant's
namespace. You would use the tasks like
-------
<project
xmlns:rat="antlib:org.apache.rat.anttasks"
xmlns="antlib:org.apache.tools.ant">
...
<rat:report>
<fileset dir="src"/>
</rat:report>
-------
or a variation thereof.
* Using Ant's autodiscovery. Place <<<apache-rat-tasks.jar>>> and
all dependencies into a directory and use <<<ant -lib
DIR-CONTAINING-THE-JAR>>> or copy it into <<<ANT_HOME/lib>>> -
and then in your build file, simply declare the namespace on the
<<<project>>> tag:
-------
<project
xmlns:rat="antlib:org.apache.rat.anttasks"
xmlns="antlib:org.apache.tools.ant">
-------
and all tasks of this library will automatically be available in
the <<<rat>>> namespace without any <<<taskdef>>>.