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: Question about TaskContainer implementation
Date Thu, 08 May 2003 13:55:55 GMT
> This question remains:
> 
>  || Also when I use the log method from a taskcontainer the 
>  || name of the task doesn't appear in the output (see the 
>  || output) but instead "null". What's causing this?
> 
>  || =======
>  || OUTPUT:
>  || 
>  || test-session:
>  ||      [null] executing task
>  ||      [null] executing task
>  || 


Task.java implements the log() method with
    public void log(String msg, int msgLevel) {
        getProject().log(this, msg, msgLevel);
    }

Maybe the getProject() doesn´t give a proper value.


Suggestion:
- write a task for test:
  - prints out the project
- if that is null insert a setProject() statement before execute():
  public void execute() throws BuildException {
    for (Enumeration enumeration = nestedTasks.elements();
enumeration.hasMoreElements();) {
      log("executing task");
      Task task =(Task) enumeration.nextElement();
      task.setProject( getProject() );
      task.execute();
    }
  }



Jan

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