ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 29027] New: - Classpath elements within taskdefs ignored when in Antlib
Date Sun, 16 May 2004 21:33:50 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=29027>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29027

Classpath elements within taskdefs ignored when in Antlib 

           Summary: Classpath elements within taskdefs ignored when in
                    Antlib
           Product: Ant
           Version: 1.6.1
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: alexmcmanus@bigfoot.com


Consider the following ant script with a taskdef that works as expected:

Test1.xml
=========
<project name="Test1" default="test">
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
        <classpath>
            <pathelement path="c:/JavaLibrary/ant-contrib-0.6/lib/ant-contrib-
0.6.jar"/>
        </classpath>
    </taskdef>
    <target name="test"/>
</project>

In this next example, I define an antlib, and move the taskdef into the antlib:

Test2.xml
=========
<project name="Test2" default="test">
    <taskdef file="${basedir}/TestAntLib.xml"/>
    <target name="test"/>
</project>

TestAntLib.xml
==============
<antlib>
    <taskdef resource="net/sf/antcontrib/antcontrib.properties">
        <classpath>
            <pathelement path="c:/JavaLibrary/ant-contrib-0.6/lib/ant-contrib-
0.6.jar"/>
        </classpath>
    </taskdef>
</antlib>

When I run the build like this, I get the following error:

  [taskdef] Could not load definitions from resource 
net/sf/antcontrib/antcontrib.properties. It could not be found.

This example is as simple as I could reduce it - in a real antlib, it seems to 
get twisted in knots when you include taskdefs with nested classpath elements. 

It seems a reasonable thing to attempt - I'm trying to define an antlib with 
some macro definitions that depend on external taskdefs, and I don't want the 
build script that calls the antlib to have to know how to setup the classpath 
for tasks that are used internally within the antlib.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message