Ant-contrib.unkrig.de: Difference between revisions

From unkrig.de
Jump to navigation Jump to search
mNo edit summary
Line 17: Line 17:
;[[Ant-contrib.unkrig.de / Tasks / jsonProperty|<code><jsonProperty></code>]]
;[[Ant-contrib.unkrig.de / Tasks / jsonProperty|<code><jsonProperty></code>]]
:Parses a JSON document into a set of properties, in analogy with [http://ant.apache.org/manual/Tasks/xmlproperty.html the standard ANT <code><xmlproperty></code> task].
:Parses a JSON document into a set of properties, in analogy with [http://ant.apache.org/manual/Tasks/xmlproperty.html the standard ANT <code><xmlproperty></code> task].
;[[Ant-contrib.unkrig.de / Tasks / log|<code><log></code>]]
:Logs one message through <code>java.util.logging</code>.
;[[Ant-contrib.unkrig.de / Tasks / logging|<code><logging></code>]]
:Configures one or more loggers of the <code>java.util.logging</code> logging component.


;[[Ant-contrib.unkrig.de / Tasks / nslookup|<code><nslookup></code>]]
;[[Ant-contrib.unkrig.de / Tasks / nslookup|<code><nslookup></code>]]
Line 29: Line 35:
;[[Ant-contrib.unkrig.de / Tasks / setCookieHandler|<code><setCookieHandler></code>]]
;[[Ant-contrib.unkrig.de / Tasks / setCookieHandler|<code><setCookieHandler></code>]]
:Enables or disables cookie handling for Java's [http://docs.oracle.com/javase/6/docs/api/java/net/HttpURLConnection.html <code>java.net.HttpURLConnection</code>], including the [[Ant-contrib.unkrig.de / Tasks / urlConnection|<code><urlConnection></code>]] task.
:Enables or disables cookie handling for Java's [http://docs.oracle.com/javase/6/docs/api/java/net/HttpURLConnection.html <code>java.net.HttpURLConnection</code>], including the [[Ant-contrib.unkrig.de / Tasks / urlConnection|<code><urlConnection></code>]] task.
;[[Ant-contrib.unkrig.de / Tasks / simpleLogging|<code><simpleLogging></code>]]
:Configures the [http://commons.unkrig.de/javadoc/de/unkrig/commons/util/logging/SimpleLogging.html <code>de.unkrig.commons.util.logging.SimpleLogging</code>] facility.


;[[Ant-contrib.unkrig.de / Tasks / swingDialog|<code><swingDialog></code>]]
;[[Ant-contrib.unkrig.de / Tasks / swingDialog|<code><swingDialog></code>]]

Revision as of 09:37, 1 May 2014

This library contributes useful tasks and types to APACHE ANT. It integrates seamlessly with other libraries like ant-contrib (which is not to be confused with this one).

Tasks

<break>
Terminates the execution of the enclosing <forEach2>.
<continue>
Causes the enclosing <forEach2> task to continue with the next iteration element.
<follow>
Waits until a file grows.
<forEach2>
An enhanced version of the FOR task of ant-contrib.
<jsonProperty>
Parses a JSON document into a set of properties, in analogy with the standard ANT <xmlproperty> task.
<log>
Logs one message through java.util.logging.
<logging>
Configures one or more loggers of the java.util.logging logging component.
<nslookup>
Resolves a host name or IP address.
<retry2>
An enhanced version of the RETRY task.
<setAuthenticator>
Configures the authentication for all following java.net.URLConnections, including the <urlConnection> task.
<setCookieHandler>
Enables or disables cookie handling for Java's java.net.HttpURLConnection, including the <urlConnection> task.
<simpleLogging>
Configures the de.unkrig.commons.util.logging.SimpleLogging facility.
<swingDialog>
Pops up a highly configurable dialog and invites the user to fill in form fields.
<throughput>
Measures expired time and calculates and displays throughput rates and estimated remaining times.
<urlConnection>
Connects to a resource and writes data to it and/or reads data from it.

Resource Collections

A resource collection represents a group of resources. A resource is an entity that has a name and a value. An often-used example of a resource collection is the <fileSet> type, where each resource is a file with its name and its contents.

<resourceCollectionDelta>
Selects the subset of resources that was added, deleted or modified since the last check.
<resourceNames>
Replaces the resources' values with their names.
<literalResource>
A read-only resource with a name and a literal value - configurable either through value="..." or nested text.

Filter Readers

Filter readers are an ANT concept that mimics the functionality of UNIX' pipes: A stream of bytes is read through a chain of filter readers, where each filter reader modifies the byte stream and/or performs some additional actions.

<progress>
Prints dots (".") to STDERR as data is read through it. This implements a kind of 'progress monitoring' for slow tasks that read some data.

Conditions

Conditions are nested elements of the <condition>, <waitfor> and several other tasks.

<true>, <false>
Always evaluate to true resp. false.
<every>
Evaluates to true when it is evaluated for the first time, and when the last evaluation to true has been more than a configured interval ago.
<successful>
Executes the tasks configured as subelements sequentially and evaluates to whether all subtasks have completed successfully.

Download and installation

The JAR file can be downloaded from http://ant-contrib.unkrig.de/download/.

To make the contributions available in your ANT scripts, write

<taskdef resource="de/unkrig/antcontrib/ant.xml" classpath="path/to/de.unkrig.ant-contrib.jar" />

, or, if you put the JAR file on ANT's default classpath, just

<taskdef resource="de/unkrig/antcontrib/ant.xml" />

Source code

The source code is available in the SUBVERSION repository. The repository URL is

https://svn.code.sf.net/p/loggifier/code

License

ANT-CONTRIB is published under the "New BSD License".