Sorry, in my previous email the attachment did not
contain the patches for Antlib and Antjar.
In order to keep the antlib proposal of
Jose-Alberto Fernandez compatible with the current head revision of ant, I have
prepared a patch.
The patch addresses mainly changes in
:
- Project.java
- Zip.java (to make the Antjar task
still work)
It does not affect the proposal
"semantically"
Please submit quickly if you can to allow work on
this proposal to resume.
Yours
Antoine
Index: proposal/sandbox/antlib/src/main/org/apache/tools/ant/Project.java
===
RCS file:
/home/cvspublic/ant/proposal/sandbox/antlib/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.4
diff -u -r1.4 Project.java
--- proposal/sandbox/antlib/src/main/org/apache/tools/ant/Project.java 3 Mar
2002 12:37:13 - 1.4
+++ proposal/sandbox/antlib/src/main/org/apache/tools/ant/Project.java 1 Apr
2003 11:26:28 -
@@ -61,7 +61,6 @@
import java.util.Properties;
import java.util.Enumeration;
import java.util.Stack;
-import java.lang.reflect.Modifier;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;
@@ -70,8 +69,10 @@
import org.apache.tools.ant.types.FilterSet;
import org.apache.tools.ant.types.FilterSetCollection;
import org.apache.tools.ant.util.FileUtils;
+import org.apache.tools.ant.util.LazyHashtable;
import org.apache.tools.ant.types.Path;
import org.apache.tools.ant.taskdefs.Antlib;
+import org.apache.tools.ant.input.InputHandler;
/**
* Central representation of an Ant project. This class defines a Ant project
@@ -165,13 +166,16 @@
private String name;
private String description;
+/** Map of references within the project (paths etc) (String to Object). */
private Hashtable properties = new Hashtable();
private Hashtable userProperties = new Hashtable();
-private Hashtable references = new Hashtable();
+private Hashtable references = new AntRefTable(this);
private String defaultTarget;
-//private Hashtable dataClassDefinitions = new Hashtable();
-//private Hashtable taskClassDefinitions = new Hashtable();
+/** Map from data type names to implementing classes (String to Class). */
+private Hashtable dataClassDefinitions = new AntTaskTable(this, false);
+/** Map from task names to implementing classes (String to Class). */
+private Hashtable taskClassDefinitions = new AntTaskTable(this, true);
private Hashtable createdTasks = new Hashtable();
private Hashtable targets = new Hashtable();
private FilterSet globalFilterSet = new FilterSet();
@@ -185,11 +189,13 @@
*/
private ClassLoader coreLoader = null;
-/**
- * Records the latest task on a thread
- */
+/** Records the latest task to be executed on a thread (Thread to Task). */
private Hashtable threadTasks = new Hashtable();
+/** Records the latest task to be executed on a thread Group. */
+private Hashtable threadGroupTasks = new Hashtable();
+
+
/**
* Store symbol tables
*/
@@ -219,6 +225,48 @@
}
}
+/**
+ * Called to handle any input requests.
+ */
+private InputHandler inputHandler = null;
+
+/**
+ * The default input stream used to read any input
+ */
+private InputStream defaultInputStream = null;
+
+/**
+ * Sets the input handler
+ *
+ * @param handler the InputHandler instance to use for gathering input.
+ */
+public void setInputHandler(InputHandler handler) {
+inputHandler = handler;
+}
+
+/**
+ * Set the default System input stream. Normally this stream is set to
+ * System.in. This inputStream is used when no task inptu redirection is
+ * being performed.
+ *
+ * @param defaultInputStream the default input stream to use when input
+ *is reuested.
+ * @since Ant 1.6
+ */
+public void setDefaultInputStream(InputStream defaultInputStream) {
+this.defaultInputStream = defaultInputStream;
+}
+
+/**
+ * Retrieves the current input handler.
+ *
+ * @return the InputHandler instance currently in place for the project
+ * instance.
+ */
+public InputHandler getInputHandler() {
+return inputHandler;
+}
+
private FileUtils fileUtils;
@@ -302,12 +350,17 @@
private void autoLoadDefinitions() {
DirectoryScanner ds = new DirectoryScanner();
-ds.setBasedir(new File(getProperty(ant.home),autolib));
-ds.scan();
-String dirs[] = ds.getIncludedDirectories();
-for (int i = 0; i dirs.length; i++) {
-autoLoad(ds.getBasedir(), dirs[i]);
-}
+try {
+File autolib=new File(getProperty(ant.home),autolib);
+log(scanning the autolib directory
+autolib.toString(),MSG_DEBUG);
+ds.setBasedir(autolib);
+