You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by tek1 <te...@pobox.com> on 2002/04/18 18:43:00 UTC

getting null when trying to call custom ant task

hello.

i've written 2 custom ant tasks and am trying to have one (say "ATask") 
call the other ("BTask")

i tried the following in ATask (to reference BTask):


someMethod() {

	this.project.addDataTypeDefinition("atask",Class.forName("com.test.ATask"));
	// also tried without the above line, but the result is the same

	ATask task = (ATask)this.project.createTask("atask");

}



however, "task" is turning out to be null.

i'd appreciate any advice.  thank you. 


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: getting null when trying to call custom ant task

Posted by tek1 <te...@pobox.com>.
actually, i double checked the 2nd custom task that was being called by the 
1st.  discovered that the 2nd custom task wasn't setting the classpath 
correctly.  my apologies.

your previous reply did solve the first problem that i was having with the 
task.  again, thank you.



At 15:35 02/04/19 +0900, you wrote:
>thank you adam.
>
>it helped, as the "task" instance is no longer null.  however, i'm still 
>getting a null error when i try to call one of the methods of the "task" 
>instance.
>
>what is the standard way/code for calling another custom task from your 
>own custom task?
>
>thank you very much.
>
>
>
>
>At 13:01 02/04/19 +1000, you wrote:
>>On Fri, 19 Apr 2002 02:43, tek1 wrote:
>> > hello.
>> >
>> > i've written 2 custom ant tasks and am trying to have one (say "ATask")
>> > call the other ("BTask")
>> >
>> > i tried the following in ATask (to reference BTask):
>> >
>> >
>> > someMethod() {
>> >
>> > this.project.addDataTypeDefinition("atask",Class.forName("com.test.ATask")
>>
>>Shouldn't that be project.addTaskDefinition()?
>>
>> >
>> >       ATask task = (ATask)this.project.createTask("atask");
>> >
>>
>>--
>>Adam
>>
>>--
>>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: getting null when trying to call custom ant task

Posted by tek1 <te...@pobox.com>.
thank you adam.

it helped, as the "task" instance is no longer null.  however, i'm still 
getting a null error when i try to call one of the methods of the "task" 
instance.

what is the standard way/code for calling another custom task from your own 
custom task?

thank you very much.




At 13:01 02/04/19 +1000, you wrote:
>On Fri, 19 Apr 2002 02:43, tek1 wrote:
> > hello.
> >
> > i've written 2 custom ant tasks and am trying to have one (say "ATask")
> > call the other ("BTask")
> >
> > i tried the following in ATask (to reference BTask):
> >
> >
> > someMethod() {
> >
> > 
> this.project.addDataTypeDefinition("atask",Class.forName("com.test.ATask")
>
>Shouldn't that be project.addTaskDefinition()?
>
> >
> >       ATask task = (ATask)this.project.createTask("atask");
> >
>
>--
>Adam
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: getting null when trying to call custom ant task

Posted by Adam Murdoch <ad...@apache.org>.
On Fri, 19 Apr 2002 02:43, tek1 wrote:
> hello.
>
> i've written 2 custom ant tasks and am trying to have one (say "ATask")
> call the other ("BTask")
>
> i tried the following in ATask (to reference BTask):
>
>
> someMethod() {
>
> 	this.project.addDataTypeDefinition("atask",Class.forName("com.test.ATask")

Shouldn't that be project.addTaskDefinition()?

>
> 	ATask task = (ATask)this.project.createTask("atask");
>

-- 
Adam

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>