Index: Project.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.116
diff -u -r1.116 Project.java
--- Project.java	10 Sep 2002 22:21:18 -0000	1.116
+++ Project.java	26 Nov 2002 19:30:30 -0000
@@ -56,6 +56,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.io.FileInputStream;
 import java.io.InputStream;
 import java.lang.reflect.Modifier;
 import java.util.Enumeration;
@@ -249,6 +250,62 @@
      */
     public void init() throws BuildException {
         setJavaVersionProperty();
+        final String customTypes = System.getProperty("ant.custom.types");
+        final String customTasks = System.getProperty("ant.custom.tasks");
+
+        if ( customTasks != null ) {
+            try {
+                Properties props = new Properties();
+                InputStream in = new FileInputStream( customTasks );
+                if (in != null) {
+                    props.load(in);
+                    in.close();
+
+                    Enumeration enum = props.propertyNames();
+                    while (enum.hasMoreElements()) {
+                        String key = (String) enum.nextElement();
+                        String value = props.getProperty(key);
+                        try {
+                            Class taskClass = Class.forName(value);
+                            addTaskDefinition(key, taskClass);
+                        } catch (NoClassDefFoundError ncdfe) {
+                            log("Could not load a dependent class ("
+                                + ncdfe.getMessage() + ") for task " + key, MSG_DEBUG);
+                        } catch (ClassNotFoundException cnfe) {
+                            log("Could not load class (" + value
+                                + ") for task " + key, MSG_DEBUG);
+                        }
+                    }
+                }
+            } catch (IOException ioe) {
+            }
+        }
+
+        if ( customTypes != null ) {
+            try {
+                Properties props = new Properties();
+                InputStream in = new FileInputStream( customTypes );
+                if (in != null) {
+                    props.load(in);
+                    in.close();
+
+                    Enumeration enum = props.propertyNames();
+                    while (enum.hasMoreElements()) {
+                        String key = (String) enum.nextElement();
+                        String value = props.getProperty(key);
+                        try {
+                            Class dataClass = Class.forName(value);
+                            addDataTypeDefinition(key, dataClass);
+                        } catch (NoClassDefFoundError ncdfe) {
+                            // ignore...
+                        } catch (ClassNotFoundException cnfe) {
+                            // ignore...
+                        }
+                    }
+                }
+            } catch (IOException ioe) {
+            }
+        }
 
         String defs = "/org/apache/tools/ant/taskdefs/defaults.properties";
 


