Hi, 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 - ignoring! [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. Cheers Conor -- Conor MacNeill Home: [EMAIL PROTECTED] Work: [EMAIL PROTECTED] Web: www.cortexebusiness.com.au
? bin
? diffs.txt
? lib
? src/main/org/apache/tools/ant/TaskThread.java
? src/main/org/apache/tools/ant/taskdefs/Join.java
? src/main/org/apache/tools/ant/taskdefs/Sleep.java
Index: src/main/org/apache/tools/ant/Project.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.20
diff -u -r1.20 Project.java
--- src/main/org/apache/tools/ant/Project.java 2000/05/27 22:21:09 1.20
+++ src/main/org/apache/tools/ant/Project.java 2000/06/17 14:43:19
@@ -392,6 +392,7 @@
taskA.setProxy( o );
task=taskA;
}
+ task.setTaskname(taskType);
task.setProject(this);
String msg = " +Task: " + taskType;
log (msg, MSG_VERBOSE);
Index: src/main/org/apache/tools/ant/Target.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Target.java,v
retrieving revision 1.4
diff -u -r1.4 Target.java
--- src/main/org/apache/tools/ant/Target.java 2000/04/26 19:09:17 1.4
+++ src/main/org/apache/tools/ant/Target.java 2000/06/17 14:43:20
@@ -70,6 +70,11 @@
private Vector tasks = new Vector(5);
private Project project;
+ /**
+ * A list of tasks which have been started in separate threads.
+ */
+ private Vector taskThreads;
+
public void setProject(Project project) {
this.project = project;
}
@@ -111,20 +116,57 @@
public void setCondition(String property) {
this.condition = (property == null) ? "" : property;
}
+
+ /**
+ * Join all outstanding task threads.
+ */
+ public void joinThreads() throws BuildException {
+ if (taskThreads.size() != 0) {
+ synchronized(taskThreads) {
+ BuildException threadException = null;
+ try {
+ for (Enumeration e = taskThreads.elements();
e.hasMoreElements(); ) {
+ TaskThread thread = (TaskThread)e.nextElement();
+ thread.join();
+ if (threadException != null && thread.getException()
!= null) {
+ threadException = thread.getException();
+ }
+ }
+ taskThreads = new Vector();
+ }
+ catch (InterruptedException ie) {
+ // ignore
+ }
+ if (threadException != null) {
+ throw threadException;
+ }
+ }
+ }
+ }
public void execute() throws BuildException {
if (("".equals(this.condition)) ||
(project.getProperty(this.condition) != null)) {
+ taskThreads = new Vector();
Enumeration enum = tasks.elements();
while (enum.hasMoreElements()) {
Task task = (Task) enum.nextElement();
try {
- task.execute();
+ if (task.isAsyncTask()) {
+ // create a task thread with which to execute this
task.
+ TaskThread thread = new TaskThread(task);
+ taskThreads.addElement(thread);
+ thread.start();
+ }
+ else {
+ task.execute();
+ }
} catch(BuildException exc) {
exc.setLocation(task.getLocation());
throw exc;
}
}
+ joinThreads();
} else {
project.log("Skipped because property '" + this.condition + "' not
set.", this.name, Project.MSG_VERBOSE);
}
Index: src/main/org/apache/tools/ant/Task.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Task.java,v
retrieving revision 1.5
diff -u -r1.5 Task.java
--- src/main/org/apache/tools/ant/Task.java 2000/04/26 19:09:17 1.5
+++ src/main/org/apache/tools/ant/Task.java 2000/06/17 14:43:20
@@ -64,8 +64,19 @@
protected Target target = null;
protected String description=null;
protected Location location = Location.UNKNOWN_LOCATION;
+
+ /**
+ * The name of this task.
+ */
+ private String taskname;
/**
+ * Indicates if this task is to be run asynchronously
+ * (ie. in a separate thread.)
+ */
+ private boolean async = false;
+
+ /**
* Sets the project object of this task. This method is used by
* project when a task is added to it so that the task has
* access to the functions of the project. It should not be used
@@ -98,6 +109,43 @@
}
/**
+ * Sets the name of this task
+ *
+ * @param name the name to be used to refer to this task
+ */
+ public void setTaskname(String name) {
+ this.taskname = name;
+ }
+
+ /**
+ * Get the name of this task.
+ *
+ * @return the task's name.
+ */
+ public String getTaskname() {
+ return taskname;
+ }
+
+ /**
+ * Indicate that this task is to run asynchronously.
+ *
+ * @param async a string indicating whether this task is async or not.
+ */
+ public void setAsync(String s) {
+ this.async = Project.toBoolean(s);
+ }
+
+ /**
+ * Indicate whether this task runs asynchronously to other tasks within
the
+ * the same target.
+ *
+ * @return true if this task is to be run asynchronously.
+ */
+ public boolean isAsyncTask() {
+ return async;
+ }
+
+ /**
* Called by the project to let the task initialize properly. Normally it
does nothing.
*
* @throws BuildException if someting goes wrong with the build
@@ -124,5 +172,14 @@
public void setLocation(Location location) {
this.location = location;
}
+
+ public void log(String msg) {
+ log(msg, Project.MSG_INFO);
+ }
+
+ public void log(String msg, int msgLevel) {
+ project.log(msg, getTaskname(), msgLevel);
+ }
+
}
Index: src/main/org/apache/tools/ant/taskdefs/Ant.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Ant.java,v
retrieving revision 1.6
diff -u -r1.6 Ant.java
--- src/main/org/apache/tools/ant/taskdefs/Ant.java 2000/03/28 20:40:18
1.6
+++ src/main/org/apache/tools/ant/taskdefs/Ant.java 2000/06/17 14:43:21
@@ -111,7 +111,7 @@
PrintStream out=new PrintStream(new FileOutputStream(output));
p1.setOutput( out );
} catch( IOException ex ) {
- project.log( "Ant: Can't set output to " + output );
+ log( "Ant: Can't set output to " + output );
}
}
Index: src/main/org/apache/tools/ant/taskdefs/Copydir.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Copydir.java,v
retrieving revision 1.6
diff -u -r1.6 Copydir.java
--- src/main/org/apache/tools/ant/taskdefs/Copydir.java 2000/02/14 12:19:27
1.6
+++ src/main/org/apache/tools/ant/taskdefs/Copydir.java 2000/06/17 14:43:21
@@ -98,7 +98,7 @@
String[] files = ds.getIncludedFiles();
scanDir(srcDir, destDir, files);
if (filecopyList.size() > 0) {
- project.log("Copying " + filecopyList.size() + " files to "
+ log("Copying " + filecopyList.size() + " files to "
+ destDir.getAbsolutePath());
Enumeration enum = filecopyList.keys();
while (enum.hasMoreElements()) {
Index: src/main/org/apache/tools/ant/taskdefs/Delete.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Delete.java,v
retrieving revision 1.3
diff -u -r1.3 Delete.java
--- src/main/org/apache/tools/ant/taskdefs/Delete.java 2000/06/16 01:46:13
1.3
+++ src/main/org/apache/tools/ant/taskdefs/Delete.java 2000/06/17 14:43:21
@@ -122,7 +122,7 @@
+ " cannot be removed with delete. Use Deltree instead.");
}
else {
- project.log("Deleting: " + f.getAbsolutePath());
+ log("Deleting: " + f.getAbsolutePath());
f.delete();
}
}
@@ -139,12 +139,12 @@
String[] files = ds.getIncludedFiles();
if (files.length > 0) {
- project.log("Deleting " + files.length + " files from " +
delDir.getAbsolutePath());
+ log("Deleting " + files.length + " files from " +
delDir.getAbsolutePath());
for (int i = 0; i < files.length; i++) {
File f = new File(delDir, files[i]);
if (f.exists()) {
- project.log("Deleting: " + f.getAbsolutePath(), verbosity);
+ log("Deleting: " + f.getAbsolutePath(), verbosity);
f.delete();
}
}
Index: src/main/org/apache/tools/ant/taskdefs/Deltree.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Deltree.java,v
retrieving revision 1.2
diff -u -r1.2 Deltree.java
--- src/main/org/apache/tools/ant/taskdefs/Deltree.java 2000/02/24 01:34:45
1.2
+++ src/main/org/apache/tools/ant/taskdefs/Deltree.java 2000/06/17 14:43:21
@@ -72,7 +72,7 @@
}
public void execute() throws BuildException {
- project.log("Deleting: " + dir.getAbsolutePath());
+ log("Deleting: " + dir.getAbsolutePath());
if (dir.exists()) {
if (!dir.isDirectory()) {
Index: src/main/org/apache/tools/ant/taskdefs/Exec.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Exec.java,v
retrieving revision 1.9
diff -u -r1.9 Exec.java
--- src/main/org/apache/tools/ant/taskdefs/Exec.java 2000/04/01 14:25:07
1.9
+++ src/main/org/apache/tools/ant/taskdefs/Exec.java 2000/06/17 14:43:22
@@ -82,10 +82,10 @@
// test if os match
String myos = System.getProperty("os.name");
- project.log("Myos = " + myos, Project.MSG_VERBOSE);
+ log("Myos = " + myos, Project.MSG_VERBOSE);
if ((os != null) && (os.indexOf(myos) < 0)){
// this command will be executed only on the specified OS
- project.log("Not found in " + os, Project.MSG_VERBOSE);
+ log("Not found in " + os, Project.MSG_VERBOSE);
return 0;
}
@@ -105,7 +105,7 @@
try {
// show the command
- project.log(command, "exec", Project.MSG_VERBOSE);
+ log(command, Project.MSG_VERBOSE);
// exec command on system runtime
Process proc = Runtime.getRuntime().exec(command);
@@ -113,15 +113,16 @@
PrintWriter fos=null;
if( out!=null ) {
fos=new PrintWriter( new FileWriter( out ) );
- project.log("Output redirected to " + out,
Project.MSG_VERBOSE);
+ log("Output redirected to " + out, Project.MSG_VERBOSE);
}
// copy input and error to the output stream
StreamPumper inputPumper =
- new StreamPumper(proc.getInputStream(), "exec", project, fos);
+ new StreamPumper(proc.getInputStream(), getTaskname(),
project, fos);
StreamPumper errorPumper =
- new StreamPumper(proc.getErrorStream(), "error", project, fos);
+ new StreamPumper(proc.getErrorStream(), getTaskname() + "
err", project, fos);
+
// starts pumping away the generated output/error
inputPumper.start();
errorPumper.start();
@@ -138,7 +139,7 @@
// check its exit value
err = proc.exitValue();
if (err != 0) {
- project.log("Result: " + err, "exec", Project.MSG_ERR);
+ log("Result: " + err, Project.MSG_ERR);
}
} catch (IOException ioe) {
throw new BuildException("Error exec: " + command );
Index: src/main/org/apache/tools/ant/taskdefs/Expand.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Expand.java,v
retrieving revision 1.2
diff -u -r1.2 Expand.java
--- src/main/org/apache/tools/ant/taskdefs/Expand.java 2000/01/14 02:13:19
1.2
+++ src/main/org/apache/tools/ant/taskdefs/Expand.java 2000/06/17 14:43:22
@@ -77,7 +77,7 @@
File srcF=project.resolveFile(source);
File dir=project.resolveFile(dest);
- project.log("Expanding: " + srcF + " into " + dir,
Project.MSG_INFO);
+ log("Expanding: " + srcF + " into " + dir, Project.MSG_INFO);
// code from WarExpand
ZipInputStream zis = new ZipInputStream(new FileInputStream(srcF));
ZipEntry ze = null;
@@ -85,7 +85,7 @@
while ((ze = zis.getNextEntry()) != null) {
try {
File f = new File(dir, project.translatePath(ze.getName()));
- project.log("expand-file " + ze.getName() , "expand",
Project.MSG_VERBOSE );
+ log("expand-file " + ze.getName() , Project.MSG_VERBOSE );
// create intermediary directories - sometimes zip don't
add them
File dirF=new File(f.getParent());
dirF.mkdirs();
@@ -107,7 +107,7 @@
System.out.println("FileNotFoundException: " +
ze.getName() );
}
}
- project.log("</log:expand>", Project.MSG_VERBOSE );
+ log("</log:expand>", Project.MSG_VERBOSE );
} catch (IOException ioe) {
ioe.printStackTrace();
}
Index: src/main/org/apache/tools/ant/taskdefs/FixCRLF.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/FixCRLF.java,v
retrieving revision 1.5
diff -u -r1.5 FixCRLF.java
--- src/main/org/apache/tools/ant/taskdefs/FixCRLF.java 2000/02/27 01:47:46
1.5
+++ src/main/org/apache/tools/ant/taskdefs/FixCRLF.java 2000/06/17 14:43:23
@@ -223,11 +223,11 @@
}
// log options used
- project.log("options:" +
+ log("options:" +
" cr=" + (addcr==-1 ? "add" : addcr==0 ? "asis" : "remove") +
" tab=" + (addtab==-1 ? "add" : addtab==0 ? "asis" : "remove") +
" eof=" + (ctrlz==-1 ? "add" : ctrlz==0 ? "asis" : "remove"),
- "fixcrlf", project.MSG_VERBOSE);
+ project.MSG_VERBOSE);
DirectoryScanner ds = super.getDirectoryScanner(srcDir);
String[] files = ds.getIncludedFiles();
@@ -262,9 +262,9 @@
boolean eof = ((count>0) && (indata[count-1] == 0x1A));
// log stats (before fixes)
- project.log(srcFile + ": size=" + count + " cr=" + cr +
+ log(srcFile + ": size=" + count + " cr=" + cr +
" lf=" + lf + " tab=" + tab + " eof=" + eof,
- "fixcrlf", project.MSG_VERBOSE);
+ project.MSG_VERBOSE);
// determine the output buffer size (slightly pessimisticly)
int outsize = count;
Index: src/main/org/apache/tools/ant/taskdefs/GUnzip.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/GUnzip.java,v
retrieving revision 1.1
diff -u -r1.1 GUnzip.java
--- src/main/org/apache/tools/ant/taskdefs/GUnzip.java 2000/05/24 14:35:22
1.1
+++ src/main/org/apache/tools/ant/taskdefs/GUnzip.java 2000/06/17 14:43:23
@@ -109,7 +109,7 @@
}
if (source.lastModified() > dest.lastModified()) {
- project.log("Expanding "+ source.getAbsolutePath() + " to "
+ log("Expanding "+ source.getAbsolutePath() + " to "
+ dest.getAbsolutePath());
try {
Index: src/main/org/apache/tools/ant/taskdefs/GZip.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/GZip.java,v
retrieving revision 1.2
diff -u -r1.2 GZip.java
--- src/main/org/apache/tools/ant/taskdefs/GZip.java 2000/02/09 20:51:47
1.2
+++ src/main/org/apache/tools/ant/taskdefs/GZip.java 2000/06/17 14:43:23
@@ -81,13 +81,13 @@
}
public void execute() throws BuildException {
- project.log("Building gzip: " + zipFile.getAbsolutePath());
+ log("Building gzip: " + zipFile.getAbsolutePath());
try {
GZIPOutputStream zOut = new GZIPOutputStream(new
FileOutputStream(zipFile));
if (source.isDirectory()) {
- project.log ("Cannot Gzip a directory!");
+ log ("Cannot Gzip a directory!");
} else {
zipFile(source, zOut);
}
Index: src/main/org/apache/tools/ant/taskdefs/Get.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Get.java,v
retrieving revision 1.3
diff -u -r1.3 Get.java
--- src/main/org/apache/tools/ant/taskdefs/Get.java 2000/02/24 00:57:43
1.3
+++ src/main/org/apache/tools/ant/taskdefs/Get.java 2000/06/17 14:43:23
@@ -82,7 +82,7 @@
throw new BuildException(e.toString());
}
- project.log("Getting: " + source);
+ log("Getting: " + source);
File destF=new File(dest);
FileOutputStream fos = new FileOutputStream(destF);
@@ -93,11 +93,11 @@
is = url.openStream();
break;
} catch( IOException ex ) {
- project.log( "Error opening connection " + ex );
+ log( "Error opening connection " + ex );
}
}
if( is==null ) {
- project.log( "Can't get " + source + " to " + dest);
+ log( "Can't get " + source + " to " + dest);
if( ignoreErrors != null ) return;
throw new BuildException( "Can't get " + source + " to " +
dest);
}
@@ -113,7 +113,7 @@
fos.close();
is.close();
} catch (IOException ioe) {
- project.log("Error getting " + source + " to " + dest );
+ log("Error getting " + source + " to " + dest );
if( ignoreErrors != null ) return;
throw new BuildException(ioe.toString());
}
Index: src/main/org/apache/tools/ant/taskdefs/Java.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Java.java,v
retrieving revision 1.6
diff -u -r1.6 Java.java
--- src/main/org/apache/tools/ant/taskdefs/Java.java 2000/03/29 17:13:31
1.6
+++ src/main/org/apache/tools/ant/taskdefs/Java.java 2000/06/17 14:43:24
@@ -77,7 +77,7 @@
*/
public void execute() throws BuildException {
- project.log("Calling " + classname, "java", project.MSG_VERBOSE);
+ log("Calling " + classname, project.MSG_VERBOSE);
if (classname == null) {
throw new BuildException("Classname must not be null.");
@@ -104,8 +104,8 @@
run(b.toString());
} else {
Vector argList = tokenize(args);
- if (jvmargs != null) project.log("JVM args and classpath ignored
when same JVM is used.", "java", project.MSG_VERBOSE);
- project.log("Java args: " + argList.toString(), "java",
project.MSG_VERBOSE);
+ if (jvmargs != null) log("JVM args and classpath ignored when same
JVM is used.", project.MSG_VERBOSE);
+ log("Java args: " + argList.toString(), project.MSG_VERBOSE);
run(classname, argList);
}
}
Index: src/main/org/apache/tools/ant/taskdefs/Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
retrieving revision 1.12
diff -u -r1.12 Javac.java
--- src/main/org/apache/tools/ant/taskdefs/Javac.java 2000/05/23 12:08:17
1.12
+++ src/main/org/apache/tools/ant/taskdefs/Javac.java 2000/06/17 14:43:25
@@ -219,7 +219,7 @@
}
if (compileList.size() > 0) {
- project.log("Compiling " + compileList.size() +
+ log("Compiling " + compileList.size() +
" source files to " + destDir);
if (compiler.equalsIgnoreCase("classic")) {
@@ -237,7 +237,7 @@
// copy the support files
if (filecopyList.size() > 0) {
- project.log("Copying " + filecopyList.size() +
+ log("Copying " + filecopyList.size() +
" support files to " + destDir.getAbsolutePath());
Enumeration enum = filecopyList.keys();
while (enum.hasMoreElements()) {
@@ -275,7 +275,7 @@
+ ".class");
if (srcFile.lastModified() > now) {
- project.log("Warning: file modified in the future: " +
+ log("Warning: file modified in the future: " +
files[i], project.MSG_WARN);
}
@@ -343,7 +343,7 @@
target.append(File.pathSeparator);
target.append(f.getAbsolutePath());
} else {
- project.log("Dropping from classpath: "+
+ log("Dropping from classpath: "+
f.getAbsolutePath(),project.MSG_VERBOSE);
}
}
@@ -356,7 +356,7 @@
*/
private void doClassicCompile() throws BuildException {
- project.log("Using classic compiler", project.MSG_VERBOSE);
+ log("Using classic compiler", project.MSG_VERBOSE);
String classpath = getCompileClasspath();
Vector argList = new Vector();
@@ -394,7 +394,7 @@
argList.addElement(extdirs);
}
- project.log("Compilation args: " + argList.toString(),
+ log("Compilation args: " + argList.toString(),
project.MSG_VERBOSE);
String[] args = new String[argList.size() + compileList.size()];
@@ -418,7 +418,7 @@
counter++;
}
- project.log(niceSourceList.toString(), project.MSG_VERBOSE);
+ log(niceSourceList.toString(), project.MSG_VERBOSE);
// XXX
// provide the compiler a different message sink - namely our own
@@ -439,7 +439,7 @@
*/
private void doModernCompile() throws BuildException {
- project.log("Using modern compiler", project.MSG_VERBOSE);
+ log("Using modern compiler", project.MSG_VERBOSE);
String classpath = getCompileClasspath();
Vector argList = new Vector();
@@ -471,7 +471,7 @@
argList.addElement(extdirs);
}
- project.log("Compilation args: " + argList.toString(),
+ log("Compilation args: " + argList.toString(),
project.MSG_VERBOSE);
String[] args = new String[argList.size() + compileList.size()];
@@ -495,7 +495,7 @@
counter++;
}
- project.log(niceSourceList.toString(), project.MSG_VERBOSE);
+ log(niceSourceList.toString(), project.MSG_VERBOSE);
// This won't build under JDK1.2.2 because the new compiler
// doesn't exist there.
@@ -535,7 +535,7 @@
*/
private void doJikesCompile() throws BuildException {
- project.log("Using jikes compiler",project.MSG_VERBOSE);
+ log("Using jikes compiler",project.MSG_VERBOSE);
StringBuffer classpath = new StringBuffer();
classpath.append(getCompileClasspath());
@@ -613,7 +613,7 @@
if (!warnings)
argList.addElement("-nowarn");
- project.log("Compilation args: " + argList.toString(),
+ log("Compilation args: " + argList.toString(),
project.MSG_VERBOSE);
String[] args = new String[argList.size() + compileList.size()];
@@ -637,7 +637,7 @@
counter++;
}
- project.log(niceSourceList.toString(), project.MSG_VERBOSE);
+ log(niceSourceList.toString(), project.MSG_VERBOSE);
// XXX
// provide the compiler a different message sink - namely our own
Index: src/main/org/apache/tools/ant/taskdefs/Javadoc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Javadoc.java,v
retrieving revision 1.8
diff -u -r1.8 Javadoc.java
--- src/main/org/apache/tools/ant/taskdefs/Javadoc.java 2000/06/14 12:42:14
1.8
+++ src/main/org/apache/tools/ant/taskdefs/Javadoc.java 2000/06/17 14:43:27
@@ -243,7 +243,7 @@
boolean javadoc1 = (Project.getJavaVersion() == Project.JAVA_1_1);
- project.log("Generating Javadoc", project.MSG_INFO);
+ log("Generating Javadoc", project.MSG_INFO);
Vector argList = new Vector();
@@ -425,9 +425,9 @@
}
}
- project.log("Javadoc args: " + argList.toString(), "javadoc",
project.MSG_VERBOSE);
+ log("Javadoc args: " + argList.toString(), project.MSG_VERBOSE);
- project.log("Javadoc execution", project.MSG_INFO);
+ log("Javadoc execution", project.MSG_INFO);
StringBuffer b = new StringBuffer();
b.append("javadoc ");
@@ -454,9 +454,9 @@
* patterns.
*/
private void evaluatePackages(String source, Vector packages, Vector
argList) {
- project.log("Parsing source files for packages", project.MSG_INFO);
- project.log("Source dir = " + source, project.MSG_VERBOSE);
- project.log("Packages = " + packages, project.MSG_VERBOSE);
+ log("Parsing source files for packages", project.MSG_INFO);
+ log("Source dir = " + source, project.MSG_VERBOSE);
+ log("Packages = " + packages, project.MSG_VERBOSE);
Hashtable map = mapClasses(new File(source));
@@ -526,7 +526,7 @@
}
}
if (count > 0) {
- project.log("found " + count + " source files in " + path,
"javadoc", project.MSG_VERBOSE);
+ log("found " + count + " source files in " + path,
project.MSG_VERBOSE);
}
} else {
throw new BuildException("Error occurred during " + path + "
evaluation.");
@@ -547,7 +547,7 @@
while (true) {
line = reader.readLine();
if (line == null) {
- project.log("Could not evaluate package for " + file,
"javadoc", project.MSG_WARN);
+ log("Could not evaluate package for " + file,
project.MSG_WARN);
return null;
}
if (line.trim().startsWith("package ")) {
@@ -557,11 +557,11 @@
}
reader.close();
} catch (Exception e) {
- project.log("Exception " + e + " parsing " + file, "javadoc",
project.MSG_WARN);
+ log("Exception " + e + " parsing " + file, project.MSG_WARN);
return null;
}
- project.log(file + " --> " + name, "javadoc", project.MSG_VERBOSE);
+ log(file + " --> " + name, project.MSG_VERBOSE);
return name;
}
Index: src/main/org/apache/tools/ant/taskdefs/KeySubst.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/KeySubst.java,v
retrieving revision 1.2
diff -u -r1.2 KeySubst.java
--- src/main/org/apache/tools/ant/taskdefs/KeySubst.java 2000/02/13
18:20:00 1.2
+++ src/main/org/apache/tools/ant/taskdefs/KeySubst.java 2000/06/17
14:43:27
@@ -77,9 +77,9 @@
*/
public void execute() throws BuildException {
project.log("!! KeySubst is deprecated. Use Filter + CopyDir instead.
!!");
- project.log("Performing Substitions");
+ log("Performing Substitions");
if ( source == null || dest == null ) {
- project.log("Source and destinations must not be null");
+ log("Source and destinations must not be null");
return;
}
BufferedReader br = null;
@@ -152,8 +152,8 @@
String name = itok.nextToken();
String value = itok.nextToken();
-// project.log ( "Name: " + name );
-// project.log ( "Value: " + value );
+// log ( "Name: " + name );
+// log ( "Value: " + value );
replacements.put ( name, value );
}
}
Index: src/main/org/apache/tools/ant/taskdefs/Mkdir.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Mkdir.java,v
retrieving revision 1.1
diff -u -r1.1 Mkdir.java
--- src/main/org/apache/tools/ant/taskdefs/Mkdir.java 2000/01/13 10:41:41
1.1
+++ src/main/org/apache/tools/ant/taskdefs/Mkdir.java 2000/06/17 14:43:27
@@ -77,7 +77,7 @@
"succesful for an unknown reason";
throw new BuildException(msg);
}
- project.log("Created dir: " + dir.getAbsolutePath());
+ log("Created dir: " + dir.getAbsolutePath());
}
}
Index: src/main/org/apache/tools/ant/taskdefs/Property.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Property.java,v
retrieving revision 1.5
diff -u -r1.5 Property.java
--- src/main/org/apache/tools/ant/taskdefs/Property.java 2000/05/27
22:21:10 1.5
+++ src/main/org/apache/tools/ant/taskdefs/Property.java 2000/06/17
14:43:28
@@ -106,14 +106,14 @@
if (project.getUserProperty(name) == null) {
project.setUserProperty(name, v);
} else {
- project.log("Override ignored for " + name,
+ log("Override ignored for " + name,
project.MSG_VERBOSE);
}
else
if (project.getProperty(name) == null) {
project.setProperty(name, v);
} else {
- project.log("Override ignored for " + name,
+ log("Override ignored for " + name,
project.MSG_VERBOSE);
}
}
@@ -129,7 +129,7 @@
private void loadFile (String name) {
Properties props = new Properties();
- project.log("Loading " + name, project.MSG_VERBOSE);
+ log("Loading " + name, project.MSG_VERBOSE);
try {
if (new File(name).exists()) {
props.load(new FileInputStream(name));
@@ -142,7 +142,7 @@
private void loadResource( String name ) {
Properties props = new Properties();
- project.log("Resource Loading " + name, project.MSG_VERBOSE);
+ log("Resource Loading " + name, project.MSG_VERBOSE);
try {
InputStream is = this.getClass().getResourceAsStream(name);
if (is != null) {
@@ -164,14 +164,14 @@
if (project.getUserProperty(name) == null) {
project.setUserProperty(name, v);
} else {
- project.log("Override ignored for " + name,
+ log("Override ignored for " + name,
project.MSG_VERBOSE);
}
else
if (project.getProperty(name) == null) {
project.setProperty(name, v);
} else {
- project.log("Override ignored for " + name,
+ log("Override ignored for " + name,
project.MSG_VERBOSE);
}
}
Index: src/main/org/apache/tools/ant/taskdefs/Replace.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Replace.java,v
retrieving revision 1.1
diff -u -r1.1 Replace.java
--- src/main/org/apache/tools/ant/taskdefs/Replace.java 2000/01/13 10:41:41
1.1
+++ src/main/org/apache/tools/ant/taskdefs/Replace.java 2000/06/17 14:43:29
@@ -76,10 +76,10 @@
*/
public void execute() throws BuildException {
- project.log("Replacing " + token + " --> " + value);
+ log("Replacing " + token + " --> " + value);
if (src == null || token == null ) {
- project.log("File and token must not be null");
+ log("File and token must not be null");
return;
}
Index: src/main/org/apache/tools/ant/taskdefs/Rmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Rmic.java,v
retrieving revision 1.5
diff -u -r1.5 Rmic.java
--- src/main/org/apache/tools/ant/taskdefs/Rmic.java 2000/02/16 14:31:45
1.5
+++ src/main/org/apache/tools/ant/taskdefs/Rmic.java 2000/06/17 14:43:29
@@ -234,7 +234,7 @@
target.append(File.pathSeparator);
target.append(f.getAbsolutePath());
} else {
- project.log("Dropping from classpath: "+
+ log("Dropping from classpath: "+
f.getAbsolutePath(),project.MSG_VERBOSE);
}
}
Index: src/main/org/apache/tools/ant/taskdefs/Tar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Tar.java,v
retrieving revision 1.1
diff -u -r1.1 Tar.java
--- src/main/org/apache/tools/ant/taskdefs/Tar.java 2000/02/10 18:04:29
1.1
+++ src/main/org/apache/tools/ant/taskdefs/Tar.java 2000/06/17 14:43:29
@@ -84,7 +84,7 @@
}
public void execute() throws BuildException {
- project.log("Building tar: "+ tarFile.getAbsolutePath());
+ log("Building tar: "+ tarFile.getAbsolutePath());
if (baseDir == null) {
throw new BuildException("basedir attribute must be set!");
Index: src/main/org/apache/tools/ant/taskdefs/Untar.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Untar.java,v
retrieving revision 1.1
diff -u -r1.1 Untar.java
--- src/main/org/apache/tools/ant/taskdefs/Untar.java 2000/05/24 14:35:22
1.1
+++ src/main/org/apache/tools/ant/taskdefs/Untar.java 2000/06/17 14:43:29
@@ -89,7 +89,7 @@
File dir=project.resolveFile(dest);
- project.log("Expanding: " + srcF + " into " + dir,
Project.MSG_INFO);
+ log("Expanding: " + srcF + " into " + dir, Project.MSG_INFO);
// code from WarExpand
TarInputStream tis = new TarInputStream(new FileInputStream(srcF));
TarEntry te = null;
@@ -97,7 +97,7 @@
while ((te = tis.getNextEntry()) != null) {
try {
File f = new File(dir,
project.translatePath(te.getName()));
- project.log("expand-file " + te.getName() , "untar",
Project.MSG_VERBOSE );
+ log("expand-file " + te.getName() , Project.MSG_VERBOSE );
// create intermediary directories - sometimes tar don't
add them
File dirF=new File(f.getParent());
dirF.mkdirs();
Index: src/main/org/apache/tools/ant/taskdefs/Zip.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Zip.java,v
retrieving revision 1.6
diff -u -r1.6 Zip.java
--- src/main/org/apache/tools/ant/taskdefs/Zip.java 2000/05/20 10:58:17
1.6
+++ src/main/org/apache/tools/ant/taskdefs/Zip.java 2000/06/17 14:43:30
@@ -120,7 +120,7 @@
upToDate = false;
if (upToDate) return;
- project.log("Building "+ archiveType +": "+ zipFile.getAbsolutePath());
+ log("Building "+ archiveType +": "+ zipFile.getAbsolutePath());
try {
ZipOutputStream zOut = new ZipOutputStream(new
FileOutputStream(zipFile));
Index: src/main/org/apache/tools/ant/taskdefs/defaults.properties
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/defaults.properties,v
retrieving revision 1.11
diff -u -r1.11 defaults.properties
--- src/main/org/apache/tools/ant/taskdefs/defaults.properties 2000/05/24
14:35:22 1.11
+++ src/main/org/apache/tools/ant/taskdefs/defaults.properties 2000/06/17
14:43:30
@@ -29,6 +29,8 @@
filter=org.apache.tools.ant.taskdefs.Filter
fixcrlf=org.apache.tools.ant.taskdefs.FixCRLF
rename=org.apache.tools.ant.taskdefs.Rename
+sleep=org.apache.tools.ant.taskdefs.Sleep
+join=org.apache.tools.ant.taskdefs.Join
# optional tasks
script=org.apache.tools.ant.taskdefs.optional.Script
Index: src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java,v
retrieving revision 1.1
diff -u -r1.1 NetRexxC.java
--- src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java
2000/03/19 17:57:03 1.1
+++ src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java
2000/06/17 14:43:31
@@ -442,7 +442,7 @@
// compile the source files
if (compileList.size() > 0) {
- project.log("Compiling " + compileList.size() + " source files to
" + destDir);
+ log("Compiling " + compileList.size() + " source files to " +
destDir);
doNetRexxCompile();
}
}
@@ -479,7 +479,7 @@
*/
private void copyFilesToDestination() {
if (filecopyList.size() > 0) {
- project.log("Copying " + filecopyList.size() + " files to " +
destDir.getAbsolutePath());
+ log("Copying " + filecopyList.size() + " files to " +
destDir.getAbsolutePath());
Enumeration enum = filecopyList.keys();
while (enum.hasMoreElements()) {
String fromFile = (String)enum.nextElement();
@@ -499,7 +499,7 @@
* Peforms a copmile using the NetRexx 1.1.x compiler
*/
private void doNetRexxCompile() throws BuildException {
- project.log("Using NetRexx compiler", project.MSG_VERBOSE);
+ log("Using NetRexx compiler", project.MSG_VERBOSE);
String classpath = getCompileClasspath();
StringBuffer compileOptions = new StringBuffer();
StringBuffer fileList = new StringBuffer();
@@ -529,7 +529,7 @@
compileOptions.append(compileOptionsArray[i]);
compileOptions.append(" ");
}
- project.log(compileOptions.toString(), project.MSG_VERBOSE);
+ log(compileOptions.toString(), project.MSG_VERBOSE);
String eol = System.getProperty("line.separator");
StringBuffer niceSourceList = new StringBuffer("Files to be compiled:"
+ eol);
@@ -540,7 +540,7 @@
niceSourceList.append(eol);
}
- project.log(niceSourceList.toString(), project.MSG_VERBOSE);
+ log(niceSourceList.toString(), project.MSG_VERBOSE);
// need to set java.class.path property and restore it later
// since the NetRexx compiler has no option for the classpath
@@ -640,7 +640,7 @@
target.append(File.pathSeparator);
target.append(f.getAbsolutePath());
} else {
- project.log("Dropping from classpath: "+
+ log("Dropping from classpath: "+
f.getAbsolutePath(),project.MSG_VERBOSE);
}
}
Index: src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java,v
retrieving revision 1.2
diff -u -r1.2 RenameExtensions.java
--- src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java
2000/03/20 15:45:34 1.2
+++ src/main/org/apache/tools/ant/taskdefs/optional/RenameExtensions.java
2000/06/17 14:43:32
@@ -152,10 +152,10 @@
if (replace || !destFile.exists()) {
list.put(srcFile, destFile);
} else {
- project.log("Rejecting file: '" + srcFile + "' for rename
as replace is false and file exists", Project.MSG_VERBOSE);
+ log("Rejecting file: '" + srcFile + "' for rename as
replace is false and file exists", Project.MSG_VERBOSE);
}
} else {
- project.log("File '"+ filename + "' doesn't match
fromExtension: '" + fromExtension + "'", Project.MSG_VERBOSE);
+ log("File '"+ filename + "' doesn't match fromExtension: '" +
fromExtension + "'", Project.MSG_VERBOSE);
}
}
return list;
TaskThread.java
Description: Binary data
Join.java
Description: Binary data
Sleep.java
Description: Binary data
