| career | drupal | java | mac | mysql | perl | scala | uml | unix  

Ant example source code file (antlib.xml)

This example Ant source code file (antlib.xml) is included in the "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Ant tags/keywords

for, for, hello, hello, to, to

The antlib.xml source code

<?xml version="1.0"?>
<project name="test">

  <property name="testcases.dir" location="../../../../build/testcases"/>

  <path id="testclasses">
    <pathelement location="${testcases.dir}" />
    <pathelement path="${java.class.path}" />

  <target name="antlib.file">
    <typedef file="test.antlib.xml"

  <target name="antlib.resource">
    <typedef resource="taskdefs/test.antlib.xml">
            <!-- To load the task classes: -->
            <path refid="testclasses"/>
            <!-- For test.antlib.xml: -->
            <pathelement location=".."/>
            <!-- For test2.antlib.xml: -->
            <pathelement location="${testcases.dir}/org/apache/tools/ant/taskdefs/test2-antlib.jar"/>

  <target name="ns.current">
    <typedef file="antlib.current-test.xml" uri="abc"/>
    <x:useecho2 xmlns:x="abc"/>
    <x:preset.echo xmlns:x="abc" name="p"/>
    <x:p xmlns:x="abc">Hello from x:p

  <target name="antlib_uri" >
    <typedef uri="antlib:org.example.tasks" onerror="failall"/>

  <target name="antlib_uri_auto" xmlns:ex="antlib:org.example.tasks">
      <echo message="inside simple" />

  <target name="antlib_uri_auto2" xmlns:ex="antlib://org/example/tasks/antlib2.xml">
      <echo message="inside simple"/>

Other Ant examples (source code examples)

Here is a short list of links related to this Ant antlib.xml source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller


new blog posts


Copyright 1998-2021 Alvin Alexander,
All Rights Reserved.

A percentage of advertising revenue from
pages under the /java/jwarehouse URI on this website is
paid back to open source projects.