ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nick Southwell" <ni...@yomobile.net>
Subject RE: Loading custom Task in custom TaskContainer
Date Mon, 08 Jul 2002 17:14:23 GMT
Just to follow up, in case anyone else has a similar problem:

Adding the class file location to the global classpath made no difference.
Creating a custom jar in ant/lib made no difference.

Using 'mycontent' instead of 'MyContent' for the task name allows the script
below to work as expected.  I don't understand why.  But I'm happy for now.

Nick

-----Original Message-----
From: Nick Southwell [mailto:nicks@yomobile.net]
Sent: Friday, July 05, 2002 9:10 AM
To: Ant Dev List
Subject: Loading custom Task in custom TaskContainer


Hi,

I'm trying to create a custom TaskContainer to provide resources for a suite
of custom Tasks, but I find that I'm unable to load the custom tasks.

Ant1.5Beta2, j2sdk1.4.0, Win2000.

MyContainer is a copy of sequential
MyContent is a copy of the sample task.

MyContainer works with standard tasks, but custom tasks won't load
MyContent works inside standard TaskContainers.

    <target name="run">
        <taskdef
            name="MyContent"
            classname="com.yomobile.tasks.MyContentTask"
            classpath="classes"/>
        <taskdef
            name="MyContainer"
            classname="com.yomobile.tasks.MyContainerTask"
            classpath="classes"/>

        <echo message="Hello world from outside"/>
        <MyContainer>
            <MyContent/>        <!-- !!Causes a class loader failure -->
            <echo message="Hello world from inside"/>
        </MyContainer>
        <sequential>
            <MyContent/>
            <echo message="Hello world from inside"/>
        </sequential>
        <MyContent/>
    </target>

I've tried adding loaderref to the taskdef's, but that made no difference.
Any ideas for fixes or work-arounds would be appreciated.

Nick Southwell


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



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


Mime
View raw message