Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 887 invoked from network); 12 Nov 2001 07:59:20 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 12 Nov 2001 07:59:20 -0000 Received: (qmail 21982 invoked by uid 97); 12 Nov 2001 07:59:20 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 21958 invoked by uid 97); 12 Nov 2001 07:59:19 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 21933 invoked by uid 97); 12 Nov 2001 07:59:17 -0000 Date: 12 Nov 2001 07:46:27 -0000 Message-ID: <20011112074627.97946.qmail@icarus.apache.org> From: stevel@apache.org To: jakarta-ant-cvs@apache.org Subject: cvs commit: jakarta-ant/docs/manual/CoreTasks antjar.html antlib.html X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N stevel 01/11/11 23:46:27 Added: docs/manual/CoreTasks antjar.html antlib.html Log: Jose Alberto Fernandez's ant descriptor loader Revision Changes Path 1.1 jakarta-ant/docs/manual/CoreTasks/antjar.html Index: antjar.html =================================================================== Ant User Manual

AntJar

Description

An extension of the Jar task with special treatment for the library descriptor file that should end up in the META-INF directory of the Ant Archive.

This task validates the provided library descriptor making certain it specifies the following SYSTEM ID: "http://jakarta.apache.org/ant/AntlibV1_0.dtd". This DTD is defined as follows:

  <?xml version='1.0' encoding="UTF8" ?>
  
  <!-- 
  This file defines the XML format for ANT library descriptors.
  Descriptors must especify a DOCTYPE of 
  "http://jakarta.apache.org/ant/Antlib-V1_0.dtd"
  as the SystemId for the document.
  -->
  
  <!-- Root element for the Antlib descriptor.                 -->
  <!ELEMENT antlib (task | type)* >
  <!ATTLIST antlib
            version  CDATA #IMPLIED
  >
  
  <!-- Declaration of tasks contained in the library.          -->
  <!ELEMENT task EMPTY>
  <!ATTLIST task 
            name     CDATA #REQUIRED
            class    CDATA #REQUIRED
  >
  
  <!-- Declaration of datatypes contained in the library       -->
  <!ELEMENT type EMPTY>
  <!ATTLIST type 
            name     CDATA #REQUIRED
            class    CDATA #REQUIRED
  >
  
  

Parameters

Attribute Description Required
antxml The library descriptor to use (META-INF/antlib.xml). Yes
Others... All attributes inherited form the Jar task.

Nested elements

See the nested elements of the Jar task.

Examples

  <jar file="${dist}/lib/app.jar" 
         antxml="${src}/applib.xml" basedir="${build}/classes"/>

jars all files in the ${build}/classes directory into a file called app.jar in the ${dist}/lib directory and sets the content of ${src}/applib.xml as the library descriptor in META-INF/antlib.xml.

Here is a sample META-INF/antlib.xml:

  <?xml version="1.0" encoding="UTF8" ?>
  <!DOCTYPE antlib  SYSTEM "http://jakarta.apache.org/ant/Antlib-V1_0.dtd" >
  
  <antlib version="1.0" >
    <task name="case" class="org.apache.ant.contrib.Case" />
  </antlib>
  
  

Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.

1.1 jakarta-ant/docs/manual/CoreTasks/antlib.html Index: antlib.html =================================================================== Ant User Manual

AntLib

Description

Defines and loads any tasks and datatypes contained in an ANT library.

It also allows the aliasing of the names being defined in order to avoid collisions and provides means to override definitions with the ones defined in the library.

Ant libraries can be loaded in the current classloader, which is more efficient, but requires the tasks to be in the path already (such as in the ant lib directory) - set useCurrentClassloader to true to enable this. It is also possible to add more libraries to the path, such as any libraries the task is dependent on.

Parameters

Attribute Description Required
file The jar-file of the library. at least one of the two
library The name of a library relative to ${ant.home}/lib.
override Replace any existing definition with the same name. ("true"/"false"). When "false" already defined tasks and datatytes take precedence over those in the library. Default is "false" when omitted. No
useCurrentClassloader Set to "true" to avoid using a separate ClassLoader for the tasks in the library. Using this option requires that the library jar is already accessible by the ClassLoader of the project. Default is "false". No
classpath A classpath for extra libraries to pull in. No

Parameters specified as nested elements

alias

Specifies the usage of a different name from that defined in the library descriptor.

Attribute Description Required
name The name used in the library descriptor. Yes
as The alias to use in the project. Yes

Specifies the usage of a different name from that defined in the library descriptor. This is used to deal with name clashes

classpath

classpath

A classpath of extra libraries to import to support this task.

classpathref

A reference to an existing classpath.

Examples

  <antlib file="${build}/lib/mylib.jar"/>

loads the definitions from the library located at ${build}/lib/ant.jar.

  <antlib library="optional.jar"/>

loads the definitions from the library optional.jar located at ${ant.home}/lib.

  <antlib file="${build}/lib/mylib.jar">
      <alias name="echo" as="myecho"/>
    </antlib>
  

loads the definitions from the library located at ${build}/lib/ant.jar but uses the name "myecho" for the "echo" task declared in the library.


Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.

-- To unsubscribe, e-mail: For additional commands, e-mail: