ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Zvi_Q: null in the task printings
Date Mon, 23 Jun 2003 08:48:41 GMT
Task.java defines an attribute "taskname" which content is displayed in the
output.
If you instantiate a task via simple constructor (new Copy()) this attribute
isn´t set.
Like Antoine said the usual way is to use getProject().createTask() which
will invoke
ComponentHelper.createNewTask(). This method sets the "taskname" attribute
with the type
you have chosen (e.g. "copy").

So:  use   getProject().createTask( "copy" );
(same if you use <script> inside your buildfile).


Another word to the taskname-attribute.
It is very useful to set this attribute if you´re using <exec>, <java> or
<apply>.
E.g.   <java taskname="SQL-J" ... />
would produce the output
   [SQL-Q]  message ...
instead of
    [java]  message ...
and you know what program is running.


Jan



> -----Ursprüngliche Nachricht-----
> Von: Antoine Levy-Lambert [mailto:levylambert@tiscali-dsl.de]
> Gesendet am: Montag, 23. Juni 2003 10:36
> An: Ant Users List
> Betreff: Re: Zvi_Q: null in the task printings
> 
> I am not sure why you are having this problem.
> How do you programmatically create the ant or the copy task 
> in your own task
> ?
> The proper way is with getProject().createTask(taskname)
> see for instance SignJar#execute as an example of how it is done.
> Yours
> Antoine
> ----- Original Message -----
> From: "Rahamim, Zvi (Zvi) ** CTR **" <rahamim@avaya.com>
> To: "Ant Users List" <user@ant.apache.org>
> Sent: Monday, June 23, 2003 7:41 AM
> Subject: Zvi_Q: null in the task printings
> 
> 
> Hi!
> In my own created task I create ant task (e.g copy task) and 
> execute it.
> In the console window I don't see the name of the class (e.g: 
> [copy]) and
> instead I see: [null]
> How can I solve it?
> Thanks!!!
> 
> ---------------------------------------------------------------------
> 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
> 

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message