Antology: Difference between revisions

From unkrig.de
Jump to navigation Jump to search
mNo edit summary
 
(10 intermediate revisions by the same user not shown)
Line 9: Line 9:
=== In Alphabetical Order ===
=== In Alphabetical Order ===


: [http://antology.unkrig.de/antdoc/index.html?tasks/break.html           <code><break></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/break.html               <code><break></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/continue.html         <code><continue></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/continue.html           <code><continue></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/follow.html           <code><follow></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/cookieHandler.html      <code><cookieHandler></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/forEach2.html         <code><forEach2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/follow.html             <code><follow></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/ftp2.html             <code><ftp2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/forEach2.html           <code><forEach2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/jsonProperty.html     <code><jsonProperty></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/ftp2.html               <code><ftp2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/log.html             <code><log></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/httpsUrlConnections.html <code><httpsUrlConnections></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/logging.html         <code><logging></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/jsonProperty.html       <code><jsonProperty></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/nslookup.html         <code><nslookup></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/log.html                 <code><log></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/propertyXml2.html     <code><propertyXml2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/logging.html             <code><logging></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/retry.html           <code><retry2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/nslookup.html           <code><nslookup></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/setAuthenticator.html <code><setAuthenticator></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/propertyXml2.html       <code><propertyXml2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/setCookieHandler.html <code><setCookieHandler></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/retry2.html             <code><retry2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/simpleLogging.html   <code><simpleLogging></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/setAuthenticator.html   <code><setAuthenticator></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/swingDialog.html     <code><swingDialog></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/setCookieHandler.html   <code><setCookieHandler></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/swingLookAndFeel.html <code><swingLookAndFeel></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/simpleLogging.html       <code><simpleLogging></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/throughput.html       <code><throughput></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/swingDialog.html         <code><swingDialog></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/urlConnection.html   <code><urlConnection></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/swingLookAndFeel.html   <code><swingLookAndFeel></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/xmlProperty2.html     <code><xmlProperty2></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/throughput.html         <code><throughput></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/urlConnection.html       <code><urlConnection></code>]
: [http://antology.unkrig.de/antdoc/index.html?tasks/xmlProperty2.html       <code><xmlProperty2></code>]


=== By Function Group ===
=== By Function Group ===
Line 45: Line 47:
:An enhanced version of [http://ant-contrib.sourceforge.net/tasks/tasks/for.html the <code><for></code> task of ant-contrib.sourceforge.net].
:An enhanced version of [http://ant-contrib.sourceforge.net/tasks/tasks/for.html the <code><for></code> task of ant-contrib.sourceforge.net].


;[http://antology.unkrig.de/antdoc/index.html?tasks/retry.html <code><retry2></code>]
;[http://antology.unkrig.de/antdoc/index.html?tasks/retry2.html <code><retry2></code>]
:An enhanced version of the standard [http://ant.apache.org/manual/Tasks/retry.html <code><retry></code>] task.
:An enhanced version of the standard [http://ant.apache.org/manual/Tasks/retry.html <code><retry></code>] task.


Line 74: Line 76:


==== Networking Tasks ====
==== Networking Tasks ====
;[http://antology.unkrig.de/antdoc/index.html?tasks/cookieHandler.html <code><cookieHandler></code>]
:Performs various actions on the JRE's "cookie handler".


;[http://antology.unkrig.de/antdoc/index.html?tasks/ftp2.html <code><ftp2></code>]
;[http://antology.unkrig.de/antdoc/index.html?tasks/ftp2.html <code><ftp2></code>]
:Extends ANT's standard <code><ftp></code> with support for proxies.
:Extends ANT's standard <code><ftp></code> with support for proxies.
;[http://antology.unkrig.de/antdoc/index.html?tasks/httpsUrlConnections.html <code><httpsUrlConnections></code>]
:Configures Java's <code>HttpsURLConnection</code>.


;[http://antology.unkrig.de/antdoc/index.html?tasks/nslookup.html <code><nslookup></code>]
;[http://antology.unkrig.de/antdoc/index.html?tasks/nslookup.html <code><nslookup></code>]
Line 100: Line 108:
== Resource Collections ==
== Resource Collections ==


A [http://antology.org/manual/Types/resources.html#collection 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 <code><fileSet></code> type, where each resource is a file with its name and its contents.
A [http://antology.org/manual/Types/resources.html#collection resource collection] represents a group of resources (e.g. local files, archive entries, etc.). A resource is an entity that has a name and a value. An often-used example of a resource collection is the <code><fileSet></code> type, where each resource is a file with its name and its contents.


;[http://antology.unkrig.de/antdoc/index.html?resourceCollections/literalResource.html <code><literalResource></code>]
;[http://antology.unkrig.de/antdoc/index.html?resourceCollections/literalResource.html <code><literalResource></code>]
Line 116: Line 124:


;[http://antology.unkrig.de/antdoc/index.html?chainableReaders/progress.html <code><progress></code>]
;[http://antology.unkrig.de/antdoc/index.html?chainableReaders/progress.html <code><progress></code>]
:Prints dots (".") to STDERR as data is read through it. This implements a kind of 'progress monitoring' for slow tasks that read some data.
:Prints dots (".") to STDERR as data is read through it. This implements a kind of "progress monitoring" for tasks that read data slowly.


;[http://antology.unkrig.de/antdoc/index.html?chainableReaders/tee.html <code><tee></code>]
;[http://antology.unkrig.de/antdoc/index.html?chainableReaders/tee.html <code><tee></code>]
:Passes data through unmodified, and copies it to a second filter chain.
:Passes data through unmodified, and copies it to a second filter chain.
;[http://antology.unkrig.de/antdoc/index.html?chainableReaders/patch.html <code><patch></code>]
:Modifies the data by applying a patch file.


== Conditions ==
== Conditions ==
Line 145: Line 150:
[https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=de.unkrig&a=antology&v=LATEST&c=jar-with-dependencies MAVENCENTRAL].
[https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=de.unkrig&a=antology&v=LATEST&c=jar-with-dependencies MAVENCENTRAL].


To make the contributions available in your ANT scripts, write
To make Antology's tasks and types available in your ANT scripts, write


  <taskdef resource="de/unkrig/antology/ant.xml" classpath="path/to/antology-jar-with-dependencies-x.y.z.jar" />
  <taskdef resource="de/unkrig/antology/ant.xml" classpath="path/to/antology-x.y.z-jar-with-dependencies.jar" />


, or, if you put the JAR file on ANT's default classpath, just
, or, if you put the JAR file on ANT's default classpath, just
Line 153: Line 158:
  <taskdef resource="de/unkrig/antology/ant.xml" />
  <taskdef resource="de/unkrig/antology/ant.xml" />


ANTDOC documentation can be found [https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=de.unkrig&a=antology&v=LATEST&c=javadoc here].
ANTDOC documentation for Antology can be found online [http://antology.unkrig.de/antdoc/ here], or offline [https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=de.unkrig&a=antology&v=LATEST&c=javadoc here].


A [[Antology Change Log|Change Log]] is also available.
A [[Antology Change Log|Change Log]] is also available.

Latest revision as of 13:19, 13 September 2019

<meta name="keywords" content="apache, ant, antlib, library, extension, tasks, types, filters"></meta> <meta name="description" content="A library for APACHE ANT that contributes many useful, resource collections, and other types"></meta> This library contributes useful tasks and types to APACHE ANT. It integrates seamlessly with other libraries like ant-contrib.

ANTOLOGY was formerly known as "Ant-contrib.unkrig.de".

Tasks[edit]

In Alphabetical Order[edit]

<break>
<continue>
<cookieHandler>
<follow>
<forEach2>
<ftp2>
<httpsUrlConnections>
<jsonProperty>
<log>
<logging>
<nslookup>
<propertyXml2>
<retry2>
<setAuthenticator>
<setCookieHandler>
<simpleLogging>
<swingDialog>
<swingLookAndFeel>
<throughput>
<urlConnection>
<xmlProperty2>

By Function Group[edit]

Control Flow Tasks[edit]

<break>
Terminates the execution of the enclosing <forEach2> task.
<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.sourceforge.net.
<retry2>
An enhanced version of the standard <retry> task.
<throughput>
Measures expired time and calculates and displays throughput rates and estimated remaining times.

Text Processing Tasks[edit]

<jsonProperty>
Parses a JSON document into a set of properties, in analogy with the standard ANT <xmlproperty> task.
<propertyXml2>
Creates an XML document from ANT properties; the counterpart of the <xmlProperty2> task.
<xmlProperty2>
Parses an XML document into ANT properties. Resembles ANT's standard <xmlproperty> task, but maps the XML DOM in a different, more detailed way.

Logging Tasks[edit]

<log>
Logs one message through java.util.logging.
<logging>
Configures one or more loggers of the java.util.logging logging component.
<simpleLogging>
Configures the de.unkrig.commons.util.logging.SimpleLogging facility.

Networking Tasks[edit]

<cookieHandler>
Performs various actions on the JRE's "cookie handler".
<ftp2>
Extends ANT's standard <ftp> with support for proxies.
<httpsUrlConnections>
Configures Java's HttpsURLConnection.
<nslookup>
Resolves a host name or IP address.
<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.
<urlConnection>
Connects to a resource and writes data to it and/or reads data from it.

UI Tasks[edit]

<swingDialog>
Pops up a highly configurable dialog and invites the user to fill in form fields.
<swingLookAndFeel>
Sets the SWING look-and-feel for this JVM, or retrieves look-and-feel-related information from the JVM.

Resource Collections[edit]

A resource collection represents a group of resources (e.g. local files, archive entries, etc.). 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.

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

Chainable Readers[edit]

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 tasks that read data slowly.
<tee>
Passes data through unmodified, and copies it to a second filter chain.

Conditions[edit]

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

<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.
<false>
Always evaluates to false.
<successful>
Executes the tasks configured as subelements sequentially and evaluates to whether all subtasks have completed successfully.
<true>
Always evaluates to true.

Download and installation[edit]

Download the "jar-with-dependencies.jar" file from MAVENCENTRAL.

To make Antology's tasks and types available in your ANT scripts, write

<taskdef resource="de/unkrig/antology/ant.xml" classpath="path/to/antology-x.y.z-jar-with-dependencies.jar" />

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

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

ANTDOC documentation for Antology can be found online here, or offline here.

A Change Log is also available.

Source code[edit]

The source code is available on GITHUB: https://github.com/aunkrig/antology

License[edit]

ANTOLOGY is published under the "New BSD License".