ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <>
Subject asynchronous tasks
Date Sat, 17 Jun 2000 14:47:38 GMT

A while back I posted a patch to allow tasks to be run in a separate thread.
I have made a few other changes now which I would like to run by everyone.
Whilst I made these changes primarily to support async operation, they do
affect the normal operation of ant.

When running multiple threads it is important to distinguish the output of
separate threads. I have therefore introduced a task name which defaults to
the task type but which can be set explicitly in the task XML. I have
created log methods in the Task class which add this task name into log
messages. These call the appropriate Project.log methods, with the taskname
as a tag. (Many tasks were doing this anyway). The resulting output would be
something like

[mkdir] Created dir: F:\Projects\jakarta\build\ant\classes
[javac] Compiling 56 source files to F:\Projects\jakarta\build\ant\classes
[javac] Copying 2 support files to F:\Projects\jakarta\build\ant\classes
Executing Target: jar
[jar] Building jar: F:\Projects\jakarta\jakarta-ant\lib\ant.jar
Executing Target: javadocs
[mkdir] Created dir: F:\Projects\jakarta\build\ant\javadocs
[javadoc] Generating Javadoc
[javadoc err] javadoc: warning - Import not found: netrexx.lang.Rexx -
[javadoc] 3 warnings
Executing Target: dist
[mkdir] Created dir: F:\Projects\jakarta\dist\ant
[copydir] Copying 60 files to F:\Projects\jakarta\dist\ant\src

I am also including two new taskdefs used in multithreaded situations
<sleep> and <join>. Sleep simply sleeps for some milliseconds and join joins
all current task threads to the main ant thread.

The diffs and new classes are attached.

If no one objects to these changes, I will commit them next week.


Conor MacNeill

View raw message