You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Sr...@timeinc.com on 2005/04/07 22:03:48 UTC
Question regarding Ant custom task
I have a Java class with couple of public methods. When this method is
called in a target task .
public String statcollection(){
if (j>0){
System.out.println("Problem with the messages");
System.out.println("The number of messages in the queue
since "+ minutesinput +"minutes " + j );
System.out.println("Actual Directory for messages is "
+ ActualDir);
}else
{
System.out.println("The number of messages in the
queue since "+ minutesinput +"minutes " + j );
System.out.println("The total number of messages in
the queue " + i);
}
return ActualDir;
}
The variable j is global. Is it possible inside the task to check for
the value of j and use a subtask to send out an email.
Your input is highly appreciated.
Thanks
srikrishna
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: Question regarding Ant custom task
Posted by Rainer Noack <ra...@noacks.net>.
Hi srikrishna,
1. What do you mean with a "global variable" in Java?
2. You can use Project.createTask("mail") to create a mailtask.
3. Another way (easier): set a ant-property with the value of j from inside
your javacode
and call the mailtask from your build script depending on the existence
or value of this property.
Cheers
Rainer
> -----Original Message-----
> From: Srikrishna_Parthasarathy@timeinc.com
> [mailto:Srikrishna_Parthasarathy@timeinc.com]
> Sent: Thursday, April 07, 2005 10:04 PM
> To: user@ant.apache.org
> Subject: Question regarding Ant custom task
>
>
>
> I have a Java class with couple of public methods. When this
> method is called in a target task .
>
>
> public String statcollection(){
>
>
>
>
> if (j>0){
>
> System.out.println("Problem with the messages");
>
> System.out.println("The number of messages in
> the queue since "+ minutesinput +"minutes " + j );
>
>
> System.out.println("Actual Directory for messages is "
> + ActualDir);
>
> }else
> {
> System.out.println("The number of messages in the
> queue since "+ minutesinput +"minutes " + j );
>
> System.out.println("The total number of messages in
> the queue " + i);
>
> }
>
>
> return ActualDir;
> }
>
>
> The variable j is global. Is it possible inside the task to
> check for the value of j and use a subtask to send out an email.
>
>
> Your input is highly appreciated.
>
> Thanks
> srikrishna
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org