ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Magesh Umasankar" <umag...@apache.org>
Subject Re: AntTest Test Failure: WinNT 4.0, JDK 1.3.0_02, 1.4.0_b92
Date Mon, 08 Apr 2002 14:23:46 GMT
From: "Stefan Bodewig" <bodewig@apache.org>


> On Fri, 5 Apr 2002, Magesh Umasankar <umagesh@apache.org> wrote:
> 
> > Seems like the created log files are
> > not being closed
> 
> This is not only in <ant*>, Ant itself doesn't close the logfile
> either if you invoke it with -logfile.
> 
> BuildLoggers don't know whether they print to the console or a file,
> so they cannot simply close the streams in buildFinished.  

We should perhaps add something like this to Project.java:

private boolean isLogFileUsed;

public boolean isLogFileUsed() {
  return isLogFileUsed;
}

public void setLogFileUsed(boolean b) {
  isLogFileUsed = b;
}

setLogFileUsed(true) must be invoked whenever
logfile is being used.

BuildLogger's buildFinished's parameter BuildEvent 
has a handle to the Project instance from which
it can find out if the stream is to be closed or
not.

> This means we need to take care of it from the 
> outside.

How would you do that without having a handle to
the open file stream object?

> 
> Stefan
> 

Cheers,
Magesh

*********************************************
*  When in doubt, mumble; when in trouble,  *
*  delegate; when in charge, ponder.        *
*                          - James H. Boren *
*********************************************



--
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