ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jay Glanville" <dic...@nortelnetworks.com>
Subject Has anyone else thought of this -- an <output> attribute?
Date Wed, 01 Nov 2000 14:24:03 GMT
There is one thing I find surprisingly lacking in Ant.  I want to check to
see if it's been though of before I even think of how to implement it
myself.

I want all output from a task to go to (or be appended to) a file.

I know that this can be done using a build event listener, but I feel that
it should be generally available to all tasks, to all users.

Why do I want this?  Think of the following scenario:

<project ... default="all" ...
   <property name="javac.output" 
      value="v:\\temp\\javac.out" />
   <task name="compile">
      <javac ...>
         <output file="${javac.output}"
            append="false" />
      </javac>
   </task>
   <task name="notify>
      <mail from="Loadbuild"
         tolist="load.dist.list@here"
         files="${javac.output}"
         subject="Loadbuild results - ${TODAY}"
      />
   </task>
   <task name="all" depends="compile,mail" />
</project>


If I could summarize, capture all output from a task (this case, the compile
task )into a file and then mail that file to someone.

The way that ant's current built in logging system works, I can't do this.
I would first need to run something like this:
   ant -logfile log.file
and then wrap the previous command into a batch file (platform dependent
thing - ugly), and then in that batch file, mail the file (either using an
OS specific way, or use the mail task in ant, calling ant again).


The nested attribute <output> could have the following attributes:
file - the file to send the output to.
append - [boolean] obvious
stream - [enum: stdout stderr] which streams to capture.


So, what do people think?  Would other people find it useful to capture the
output on a task-by-task basis?


----------------------------------------------------------------------------
-----
Jay Dickon Glanville
P068 - SiteManager Development, Nortel Networks
613-765-1144 (ESN 395-1144)
MS: 045/55/A05
E-Mail: dickon@nortelnetworks.com


Mime
View raw message