ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/proposal/mutant/src/java/init/org/apache/ant/init LoaderUtils.java
Date Tue, 30 Apr 2002 14:57:03 GMT
conor       02/04/30 07:57:02

  Modified:    proposal/mutant build.xml
               proposal/mutant/build ant1compat.xml
               proposal/mutant/src/java/antcore/org/apache/ant/antcore/antlib
                        AntLibManager.java
               proposal/mutant/src/java/antcore/org/apache/ant/antcore/config
                        AntConfig.java AntConfigHandler.java
               proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution
                        ComponentManager.java Constants.java
                        CoreExecService.java ExecutionManager.java
                        Frame.java
               proposal/mutant/src/java/antlibs/ant1compat antlib.xml
               proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system
                        AntBase.java LibPath.java
               proposal/mutant/src/java/bootstrap/org/apache/ant/builder
                        Ant1CompatBuilder.java Builder.java
                        MutantBuilder.java
               proposal/mutant/src/java/init/org/apache/ant/init
                        LoaderUtils.java
  Added:       proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system
                        SubBuild.java
  Removed:     proposal/mutant/src/java/antcore/org/apache/ant/antcore/config
                        LibPathHandler.java LoadLibHandler.java
  Log:
  Make config processing use Tasks to provide config operations
  
  Revision  Changes    Path
  1.24      +8 -11     jakarta-ant/proposal/mutant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/build.xml,v
  retrieving revision 1.23
  retrieving revision 1.24
  diff -u -w -u -r1.23 -r1.24
  --- build.xml	29 Apr 2002 15:29:11 -0000	1.23
  +++ build.xml	30 Apr 2002 14:57:01 -0000	1.24
  @@ -144,28 +144,25 @@
       <delete dir="${dist.dir}"/>
     </target>
   
  -  <target name="antlibs" depends="common">
  -    <antcall target="build-lib">
  -      <param name="libset" value="system"/>
  -    </antcall>
  +  <target name="antlibs" depends="common, systemlib">
       <ant antfile="build/script.xml"/> 
     </target>
     
  -  <target name="build-lib">
  -    <mkdir dir="${bin.dir}/antlibs/${libset}"/>
  -    <mkdir dir="${distlib.dir}/antlibs"/>
  +  <target name="systemlib" depends="common">
  +    <mkdir dir="${bin.dir}/antlibs/system"/>
  +    <mkdir dir="${distlib.dir}/syslibs"/>
       <path id="classpath.antlibs">
         <path refid="classpath.common"/>
         <pathelement location="${distlib.dir}/common/common.jar"/>
       </path>
  -    <depend destdir="${bin.dir}/antlibs/${libset}" srcdir="${java.dir}/antlibs/${libset}">
  +    <depend destdir="${bin.dir}/antlibs/system" srcdir="${java.dir}/antlibs/system">
         <classpath refid="classpath.antlibs"/>
       </depend>
  -    <javac destdir="${bin.dir}/antlibs/${libset}" srcdir="${java.dir}/antlibs/${libset}" debug="${debug}">
  +    <javac destdir="${bin.dir}/antlibs/system" srcdir="${java.dir}/antlibs/system" debug="${debug}">
         <classpath refid="classpath.antlibs"/>
       </javac>
  -    <jar basedir="${bin.dir}/antlibs/${libset}" jarfile="${distlib.dir}/antlibs/${libset}.jar">
  -      <metainf dir="${java.dir}/antlibs/${libset}" 
  +    <jar basedir="${bin.dir}/antlibs/system" jarfile="${distlib.dir}/syslibs/system.jar">
  +      <metainf dir="${java.dir}/antlibs/system" 
                   includes="antlib.xml"/>
       </jar>
     </target>
  
  
  
  1.18      +4 -1      jakarta-ant/proposal/mutant/build/ant1compat.xml
  
  Index: ant1compat.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/build/ant1compat.xml,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -w -u -r1.17 -r1.18
  --- ant1compat.xml	30 Apr 2002 07:00:51 -0000	1.17
  +++ ant1compat.xml	30 Apr 2002 14:57:01 -0000	1.18
  @@ -43,6 +43,7 @@
       <exclude name="org/apache/tools/ant/ProjectHelper.java"/>
       <exclude name="org/apache/tools/ant/Task.java"/>
       <exclude name="org/apache/tools/ant/Main.java"/>
  +    <exclude name="org/apache/tools/ant/input/InputRequest.java"/>
     </patternset>
   
     <patternset id="notrequired">
  @@ -63,6 +64,7 @@
       <include name="org/apache/tools/mail/**/*.java"/>
       <include name="org/apache/tools/tar/**/*.java"/>
       <include name="org/apache/tools/ant/*.java"/>
  +    <include name="org/apache/tools/ant/input/*.java"/>
       <!-- <patternset refid="deprecated"/> -->
       <patternset refid="toohard"/>
       <patternset refid="converted"/>
  @@ -74,7 +76,7 @@
       <fileset dir="${lib.dir}/parser" includes="*.jar"/>
       <fileset dir="${lib.dir}/ant1compat" includes="*.jar"/>
       <pathelement location="${distlib.dir}/common/common.jar"/>
  -    <pathelement location="${distlib.dir}/antlibs/system.jar"/>
  +    <pathelement location="${distlib.dir}/syslibs/system.jar"/>
     </path>
   
     <!--
  @@ -480,6 +482,7 @@
          </fileset>
       </copy>
   
  +    <mkdir dir="${distlib.dir}/antlibs/"/>
       <jar basedir="${bin.dir}/ant1compat" jarfile="${distlib.dir}/antlibs/ant1compat.jar">
         <metainf dir="${java.dir}/antlibs/ant1compat" 
                   includes="antlib.xml"/>
  
  
  
  1.9       +9 -7      jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/antlib/AntLibManager.java
  
  Index: AntLibManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/antlib/AntLibManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- AntLibManager.java	7 Apr 2002 14:38:05 -0000	1.8
  +++ AntLibManager.java	30 Apr 2002 14:57:02 -0000	1.9
  @@ -152,7 +152,7 @@
        * @param librarySpecs the loaded specifications of the Ant libraries
        * @param initConfig the Ant initialization configuration
        * @param libraries the collection of libraries already configured
  -     * @param libPathsMap a map of lists of library patsh fro each library
  +     * @param libPathsMap a map of lists of library paths for each library
        * @exception ExecutionException if a library cannot be configured from
        *      the given specification
        */
  @@ -231,7 +231,7 @@
       }
   
       /**
  -     * add a library path to the given library
  +     * Add a library path to the given library
        *
        * @param antLibrary the library to which the path is to be added
        * @param path the path to be added
  @@ -320,11 +320,13 @@
               antLibrary.setParentLoader(initConfig.getCommonLoader());
               libraries.put(libraryId, antLibrary);
   
  +            if (libPathsMap != null) {
               List libPaths = (List) libPathsMap.get(libraryId);
               if (libPaths != null) {
                   for (Iterator j = libPaths.iterator(); j.hasNext();) {
                       URL pathURL = (URL) j.next();
                       addLibPath(antLibrary, pathURL);
  +                    }
                   }
               }
   
  
  
  
  1.9       +17 -119   jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/config/AntConfig.java
  
  Index: AntConfig.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/config/AntConfig.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- AntConfig.java	7 Apr 2002 14:38:05 -0000	1.8
  +++ AntConfig.java	30 Apr 2002 14:57:02 -0000	1.9
  @@ -63,6 +63,7 @@
   import org.apache.ant.common.util.ConfigException;
   import org.apache.ant.common.util.PathTokenizer;
   import org.apache.ant.init.InitUtils;
  +import org.apache.ant.common.model.BuildElement;
   
   /**
    * An AntConfig is the java class representation of the antconfig.xml files
  @@ -72,15 +73,6 @@
    * @created 20 January 2002
    */
   public class AntConfig {
  -    /** The list of additional directories to be searched for Ant libraries */
  -    private List libraryLocations = new ArrayList();
  -
  -    /**
  -     * A list of additional paths for each ant library, indexed on the
  -     * library id
  -     */
  -    private Map libPaths = new HashMap();
  -
       /** Indicates if remote libraries may be used */
       private boolean remoteLibs = false;
   
  @@ -91,6 +83,11 @@
       private boolean unsetProperties = true;
   
       /**
  +     * Configuration tasks. 
  +     */
  +    private List tasks = new ArrayList();
  +    
  +    /**
        * Indicate if unset properties are OK.
        *
        * @return true if unset properties will not cause an exception
  @@ -118,50 +115,21 @@
       }
   
       /**
  -     * Get the additional locations in which to search for Ant Libraries
  -     *
  -     * @return an iterator over the library locations
  -     */
  -    public Iterator getLibraryLocations() {
  -        return libraryLocations.iterator();
  -    }
  -
  -    /**
  -     * Get the list of additional path components for a given path
  -     *
  -     * @param libraryId the identifier for the library
  -     * @return the list of URLs for the additional paths for the given
  -     *      library
  -     */
  -    public List getLibraryPathList(String libraryId) {
  -        List libraryPathList = (List) libPaths.get(libraryId);
  -        if (libraryPathList == null) {
  -            libraryPathList = new ArrayList();
  -            libPaths.put(libraryId, libraryPathList);
  -        }
  -        return libraryPathList;
  -    }
  -
  -
  -    /**
  -     * Get the map of library paths. This map contains a collection of List
  -     * instances, indexed by the libraryIds. Each list is a set of
  -     * additional classpath entries for the given library
  +     * Get the configuration tasks
        *
  -     * @return the library paths map
  +     * @return an iterator over the set of config tasks.
        */
  -    public Map getLibraryPathsMap() {
  -        return libPaths;
  +    public Iterator getTasks() {
  +        return tasks.iterator();
       }
   
       /**
  -     * Gets the libraryIds of the AntConfig
  +     * Add a config task.
        *
  -     * @return an interator over the library identifiers for which there is
  -     *      additional path information
  +     * @param task a task to be executed as part of the configuration process.
        */
  -    public Iterator getLibraryIds() {
  -        return libPaths.keySet().iterator();
  +    public void addTask(BuildElement task) {
  +        tasks.add(task);
       }
   
       /**
  @@ -193,86 +161,16 @@
       }
   
       /**
  -     * Add an additional set of paths for the given library.
  -     *
  -     * @param libraryId The library id for which the additional class path
  -     *      is being specified
  -     * @param libraryPath the classpath style string for the library's
  -     *      additonal paths
  -     * @exception ConfigException if the appropriate URLs cannot be formed.
  -     */
  -    public void addLibPath(String libraryId, String libraryPath)
  -         throws ConfigException {
  -        try {
  -            List libraryPathList = getLibraryPathList(libraryId);
  -            PathTokenizer p = new PathTokenizer(libraryPath);
  -            while (p.hasMoreTokens()) {
  -                String pathElement = p.nextToken();
  -                File pathElementFile = new File(pathElement);
  -                URL pathElementURL = InitUtils.getFileURL(pathElementFile);
  -                libraryPathList.add(pathElementURL);
  -            }
  -        } catch (MalformedURLException e) {
  -            throw new ConfigException("Unable to process libraryPath '"
  -                 + libraryPath + "' for library '" + libraryId + "'", e);
  -        }
  -    }
  -
  -    /**
  -     * Add an additional URL for the library's classpath
  -     *
  -     * @param libraryId the library's unique Id
  -     * @param libraryURL a string which points to the additonal path
  -     * @exception ConfigException if the URL could not be formed
  -     */
  -    public void addLibURL(String libraryId, String libraryURL)
  -         throws ConfigException {
  -        try {
  -            List libraryPathList = getLibraryPathList(libraryId);
  -            libraryPathList.add(new URL(libraryURL));
  -        } catch (MalformedURLException e) {
  -            throw new ConfigException("Unable to process libraryURL '"
  -                 + libraryURL + "' for library '" + libraryId + "'", e);
  -        }
  -
  -    }
  -
  -    /**
  -     * Merge in another ocnfiguration. The configuration being merged in
  +     * Merge in another configuration. The configuration being merged in
        * takes precedence
        *
        * @param otherConfig the other AntConfig to be merged.
        */
       public void merge(AntConfig otherConfig) {
  -        // merge by
  -        List currentLibraryLocations = libraryLocations;
  -        libraryLocations = new ArrayList();
  -        libraryLocations.addAll(otherConfig.libraryLocations);
  -        libraryLocations.addAll(currentLibraryLocations);
  -
  -        Iterator i = otherConfig.libPaths.keySet().iterator();
  -        while (i.hasNext()) {
  -            String libraryId = (String) i.next();
  -            List currentList = getLibraryPathList(libraryId);
  -            List combined = new ArrayList();
  -            combined.addAll(otherConfig.getLibraryPathList(libraryId));
  -            combined.addAll(currentList);
  -            libPaths.put(libraryId, combined);
  -        }
  -
           remoteLibs = otherConfig.remoteLibs;
           remoteProjects = otherConfig.remoteProjects;
           unsetProperties = otherConfig.unsetProperties;
  -    }
  -
  -    /**
  -     * Add a new task directory to be searched for additional Ant libraries
  -     *
  -     * @param libraryLocation the location (can be a file or a URL) where
  -     *      the libraries may be loaded from.
  -     */
  -    public void addAntLibraryLocation(String libraryLocation) {
  -        libraryLocations.add(libraryLocation);
  +        tasks.addAll(otherConfig.tasks);
       }
   }
   
  
  
  
  1.9       +12 -30    jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/config/AntConfigHandler.java
  
  Index: AntConfigHandler.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/config/AntConfigHandler.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- AntConfigHandler.java	18 Mar 2002 02:44:24 -0000	1.8
  +++ AntConfigHandler.java	30 Apr 2002 14:57:02 -0000	1.9
  @@ -54,6 +54,7 @@
   package org.apache.ant.antcore.config;
   import org.apache.ant.common.util.ConfigException;
   import org.apache.ant.antcore.xml.ElementHandler;
  +import org.apache.ant.antcore.modelparser.BuildElementHandler;
   import org.xml.sax.Attributes;
   import org.xml.sax.SAXParseException;
   
  @@ -123,36 +124,17 @@
                                Attributes attributes)
            throws SAXParseException {
   
  -        try {
  -            if (qualifiedName.equals("loadlib")) {
  -                LoadLibHandler loadlibHandler
  -                     = new LoadLibHandler();
  -                loadlibHandler.start(getParseContext(), getXMLReader(),
  +        // everything else is a task
  +        BuildElementHandler buildElementHandler = new BuildElementHandler();
  +        buildElementHandler.start(getParseContext(), getXMLReader(),
                       this, getLocator(), attributes, getElementSource(),
                       qualifiedName);
  -                config.addAntLibraryLocation(loadlibHandler.getLibLocation());
  -            } else if (qualifiedName.equals("libpath")) {
  -                LibPathHandler libPathHandler
  -                     = new LibPathHandler();
  -                libPathHandler.start(getParseContext(), getXMLReader(),
  -                    this, getLocator(), attributes, getElementSource(),
  -                    qualifiedName);
  -
  -                if (libPathHandler.getLibraryPath() != null) {
  -                    config.addLibPath(libPathHandler.getLibraryId(),
  -                        libPathHandler.getLibraryPath());
  -                } else {
  -                    config.addLibURL(libPathHandler.getLibraryId(),
  -                        libPathHandler.getLibraryURL());
  -                }
  -
  -            } else {
  -                super.startElement(uri, localName, qualifiedName, attributes);
  -            }
  -        } catch (ConfigException e) {
  -            throw new SAXParseException("Unable to process config",
  -                getLocator(), e);
  -        }
  +        config.addTask(buildElementHandler.getBuildElement());
  +//        try {
  +//        } catch (ConfigException e) {
  +//            throw new SAXParseException("Unable to process config",
  +//                getLocator(), e);
  +//        }
       }
   
       /**
  
  
  
  1.14      +12 -38    jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ComponentManager.java
  
  Index: ComponentManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ComponentManager.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -u -r1.13 -r1.14
  --- ComponentManager.java	11 Apr 2002 15:24:18 -0000	1.13
  +++ ComponentManager.java	30 Apr 2002 14:57:02 -0000	1.14
  @@ -79,6 +79,7 @@
   import org.apache.ant.common.util.ExecutionException;
   import org.apache.ant.common.util.Location;
   import org.apache.ant.init.LoaderUtils;
  +import org.apache.ant.antcore.config.AntConfig;
   
   /**
    * The instance of the ComponentServices made available by the core to the
  @@ -110,7 +111,7 @@
        * These are AntLibraries which have been loaded into this component
        * manager
        */
  -    private Map antLibraries;
  +    private Map antLibraries = new HashMap();
   
       /** dynamic libraries which have been defined */
       private Map dynamicLibraries;
  @@ -122,7 +123,7 @@
        * This map stores a list of additional paths for each library indexed
        * by the libraryId
        */
  -    private Map libPathsMap;
  +    private Map libPathsMap = new HashMap();
   
       /** Reflector objects used to configure Tasks from the Task models. */
       private Map setters = new HashMap();
  @@ -132,17 +133,13 @@
        * Constructor
        *
        * @param frame the frame containing this context
  -     * @param allowRemoteLibs true if remote libraries can be loaded though
  -     *      this service.
  -     * @param configLibPaths the additional library paths specified in the
  -     *      configuration
        */
  -    protected ComponentManager(Frame frame, boolean allowRemoteLibs,
  -                               Map configLibPaths) {
  +    protected ComponentManager(Frame frame) {
           this.frame = frame;
  -        libManager = new AntLibManager(allowRemoteLibs);
  +        AntConfig config = frame.getConfig();
  +        libManager = new AntLibManager(config.isRemoteLibAllowed());
           dynamicLibraries = new HashMap();
  -        libPathsMap = new HashMap(configLibPaths);
  +        libPathsMap = new HashMap();
       }
   
       /**
  @@ -162,10 +159,11 @@
               libManager.configLibraries(frame.getInitConfig(), librarySpecs,
                   antLibraries, libPathsMap);
   
  -            if (importAll) {
                   Iterator i = librarySpecs.keySet().iterator();
                   while (i.hasNext()) {
                       String libraryId = (String) i.next();
  +                if (importAll 
  +                    || libraryId.startsWith(Constants.ANT_LIB_PREFIX)) {
                       importLibrary(libraryId);
                   }
               }
  @@ -343,30 +341,6 @@
            throws ExecutionException {
           return createComponent(loader, factory, componentClass,
               componentName, componentName, addTaskAdapter, null);
  -    }
  -
  -    /**
  -     * Set the standard libraries (i.e. those which are independent of the
  -     * build files) to be used in this component manager
  -     *
  -     * @param standardLibs A collection of AntLibrary objects indexed by
  -     *      their libraryId
  -     * @exception ExecutionException if the components cannot be imported
  -     *      form the libraries fro which such importing is automatic.
  -     */
  -    protected void setStandardLibraries(Map standardLibs)
  -         throws ExecutionException {
  -
  -        antLibraries = new HashMap(standardLibs);
  -
  -        // go through the libraries and import all standard ant libraries
  -        for (Iterator i = antLibraries.keySet().iterator(); i.hasNext();) {
  -            String libraryId = (String) i.next();
  -            if (libraryId.startsWith(Constants.ANT_LIB_PREFIX)) {
  -                // standard library - import whole library
  -                importLibrary(libraryId);
  -            }
  -        }
       }
   
       /**
  
  
  
  1.3       +0 -1      jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Constants.java
  
  Index: Constants.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Constants.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -w -u -r1.2 -r1.3
  --- Constants.java	18 Mar 2002 02:44:24 -0000	1.2
  +++ Constants.java	30 Apr 2002 14:57:02 -0000	1.3
  @@ -65,6 +65,5 @@
   
       /** The Ant aspect used to identify Ant metadata */
       public static final String ANT_ASPECT = "ant";
  -
   }
   
  
  
  
  1.13      +0 -24     jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java
  
  Index: CoreExecService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/CoreExecService.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -w -u -r1.12 -r1.13
  --- CoreExecService.java	17 Apr 2002 15:51:06 -0000	1.12
  +++ CoreExecService.java	30 Apr 2002 14:57:02 -0000	1.13
  @@ -237,30 +237,6 @@
       /**
        * Setup a sub-build.
        *
  -     * @param properties the initiali properties to be used in the build
  -     * @param model XXX Description of the Parameter
  -     * @return Description of the Return Value
  -     * @exception ExecutionException if the subbuild cannot be run
  -     */
  -    /*
  -    public Object setupBuild(File antFile, Map properties)
  -         throws ExecutionException {
  -        try {
  -            // Parse the build file into a project
  -            XMLProjectParser parser = new XMLProjectParser();
  -            Project project
  -                 = parser.parseBuildFile(InitUtils.getFileURL(antFile));
  -            return setupBuild(project, properties);
  -        } catch (MalformedURLException e) {
  -            throw new ExecutionException(e);
  -        } catch (XMLParseException e) {
  -            throw new ExecutionException(e);
  -        }
  -    }
  -*/
  -    /**
  -     * Setup a sub-build.
  -     *
        * @param model the project model to be used for the build
        * @param properties the initiali properties to be used in the build
        * @return Description of the Return Value
  
  
  
  1.16      +1 -30     jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionManager.java
  
  Index: ExecutionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionManager.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -w -u -r1.15 -r1.16
  --- ExecutionManager.java	8 Apr 2002 16:01:24 -0000	1.15
  +++ ExecutionManager.java	30 Apr 2002 14:57:02 -0000	1.16
  @@ -77,9 +77,6 @@
    * @created 12 January 2002
    */
   public class ExecutionManager implements DemuxOutputReceiver {
  -    /** The AntLibraries built from Ant's Populated Task Libraries. */
  -    private Map antLibraries = new HashMap();
  -
       /** BuildEvent support used to fire events and manage listeners */
       private BuildEventSupport eventSupport = new BuildEventSupport();
   
  @@ -122,32 +119,6 @@
        *      loaded
        */
       public void init() throws ExecutionException {
  -        Map librarySpecs = new HashMap(10);
  -        try {
  -            // start by loading the task libraries
  -            URL standardLibsURL
  -                 = new URL(initConfig.getLibraryURL(), "antlibs/");
  -
  -            AntLibManager libManager
  -                 = new AntLibManager(config.isRemoteLibAllowed());
  -
  -            libManager.loadLibs(librarySpecs, standardLibsURL);
  -            libManager.configLibraries(initConfig, librarySpecs, antLibraries,
  -                config.getLibraryPathsMap());
  -
  -            librarySpecs.clear();
  -            // add any additional libraries.
  -            for (Iterator i = config.getLibraryLocations(); i.hasNext();) {
  -                // try file first
  -                String libLocation = (String) i.next();
  -                libManager.loadLibs(librarySpecs, libLocation);
  -            }
  -            libManager.configLibraries(initConfig, librarySpecs, antLibraries,
  -                config.getLibraryPathsMap());
  -
  -        } catch (MalformedURLException e) {
  -            throw new ExecutionException("Unable to load Ant libraries", e);
  -        }
       }
   
       /**
  @@ -167,7 +138,7 @@
               // start by validating the project we have been given.
               project.validate();
   
  -            mainFrame = new Frame(antLibraries, initConfig, config);
  +            mainFrame = new Frame(initConfig, config);
               for (Iterator j = eventSupport.getListeners(); j.hasNext();) {
                   BuildListener listener = (BuildListener) j.next();
                   mainFrame.addBuildListener(listener);
  
  
  
  1.21      +143 -25   jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java
  
  Index: Frame.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/Frame.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -w -u -r1.20 -r1.21
  --- Frame.java	29 Apr 2002 23:47:27 -0000	1.20
  +++ Frame.java	30 Apr 2002 14:57:02 -0000	1.21
  @@ -54,6 +54,7 @@
   package org.apache.ant.antcore.execution;
   import java.io.File;
   import java.net.URL;
  +import java.net.MalformedURLException;
   import java.util.HashMap;
   import java.util.Iterator;
   import java.util.Map;
  @@ -98,6 +99,13 @@
       private Map referencedFrames = new HashMap();
   
       /**
  +     * The property overrides for the referenced frames. This map is indexed 
  +     * by the reference names of the frame. Each entry is another Map of 
  +     * property values indexed by their relative name.
  +     */
  +    private Map overrides = new HashMap();
  +    
  +    /**
        * The context of this execution. This contains all data object's created
        * by tasks that have been executed
        */
  @@ -109,12 +117,6 @@
        */
       private InitConfig initConfig;
   
  -    /**
  -     * These are the standard libraries from which taskdefs, typedefs, etc may
  -     * be imported.
  -     */
  -    private Map standardLibs;
  -
       /** BuildEvent support used to fire events and manage listeners */
       private BuildEventSupport eventSupport = new BuildEventSupport();
   
  @@ -158,9 +160,8 @@
        * @exception ExecutionException if a component of the library cannot be
        *      imported
        */
  -    protected Frame(Map standardLibs, InitConfig initConfig,
  +    protected Frame(InitConfig initConfig,
                       AntConfig config) throws ExecutionException {
  -        this.standardLibs = standardLibs;
           this.config = config;
           this.initConfig = initConfig;
       }
  @@ -189,11 +190,7 @@
        */
       protected void setProject(Project project) throws ExecutionException {
           this.project = project;
  -        referencedFrames = new HashMap();
  -
  -        configureServices();
  -        componentManager.setStandardLibraries(standardLibs);
  -        setMagicProperties();
  +        referencedFrames.clear();
       }
   
   
  @@ -223,9 +220,10 @@
           Frame frame = getContainingFrame(name);
   
           if (frame == null) {
  -            throw new ExecutionException("There is no project corresponding "
  -                 + "to the name \"" + name + "\"");
  +            setOverrideProperty(name, value, mutable);
  +            return;
           }
  +
           if (frame == this) {
               if (dataValues.containsKey(name) && !mutable) {
                   log("Ignoring oveeride for data value " + name,
  @@ -238,6 +236,104 @@
           }
       }
   
  +    /**
  +     * When a frame has not yet been referenced, this method is used
  +     * to set the initial properties for the frame when it is introduced.
  +     *
  +     * @param name the name of the value
  +     * @param value the actual value
  +     * @param mutable if true, existing values can be changed
  +     * @exception ExecutionException if attempting to override a property in 
  +     *                               the current frame. 
  +     */
  +    private void setOverrideProperty(String name, Object value, 
  +                                     boolean mutable) 
  +         throws ExecutionException {
  +        int refIndex = name.indexOf(Project.REF_DELIMITER);
  +        if (refIndex == -1) {
  +            throw new ExecutionException("Property overrides can only be set" 
  +                + " for properties in referenced projects - not " 
  +                + name);
  +        }
  +        
  +        String firstFrameName = name.substring(0, refIndex);
  +        
  +        String relativeName 
  +            = name.substring(refIndex + Project.REF_DELIMITER.length());
  +
  +        Map frameOverrides = (Map) overrides.get(firstFrameName);
  +        if (frameOverrides == null) {
  +            frameOverrides = new HashMap();
  +            overrides.put(firstFrameName, frameOverrides);
  +        }
  +
  +        if (mutable || !frameOverrides.containsKey(relativeName)) {
  +            frameOverrides.put(relativeName, value);
  +        }            
  +    }
  +    
  +    /**
  +     * Get a value which exists in the frame property overrides awaiting 
  +     * the frame to be introduced.
  +     *
  +     * @param name the name of the value
  +     * @return the value of the property or null if the property does not 
  +     * exist.
  +     * @exception ExecutionException if attempting to get an override in 
  +     *                               the current frame. 
  +     */
  +    private Object getOverrideProperty(String name) throws ExecutionException {
  +        int refIndex = name.indexOf(Project.REF_DELIMITER);
  +        if (refIndex == -1) {
  +            throw new ExecutionException("Property overrides can only be" 
  +                + " returned for properties in referenced projects - not " 
  +                + name);
  +        }
  +        
  +        String firstFrameName = name.substring(0, refIndex);
  +        
  +        String relativeName 
  +            = name.substring(refIndex + Project.REF_DELIMITER.length());
  +
  +        Map frameOverrides = (Map) overrides.get(firstFrameName);
  +        if (frameOverrides == null) {
  +            return null;
  +        }
  +
  +        return frameOverrides.get(relativeName);
  +    }
  +    
  +    /**
  +     * Get a value which exists in the frame property overrides awaiting 
  +     * the frame to be introduced.
  +     *
  +     * @param name the name of the value
  +     * @return the value of the property or null if the property does not 
  +     * exist.
  +     * @exception ExecutionException if attempting to check an override in 
  +     *                               the current frame. 
  +     */
  +    private boolean isOverrideSet(String name) throws ExecutionException {
  +        int refIndex = name.indexOf(Project.REF_DELIMITER);
  +        if (refIndex == -1) {
  +            throw new ExecutionException("Property overrides can only be" 
  +                + " returned for properties in referenced projects - not " 
  +                + name);
  +        }
  +        
  +        String firstFrameName = name.substring(0, refIndex);
  +        
  +        String relativeName 
  +            = name.substring(refIndex + Project.REF_DELIMITER.length());
  +
  +        Map frameOverrides = (Map) overrides.get(firstFrameName);
  +        if (frameOverrides == null) {
  +            return false;
  +        }
  +
  +        return frameOverrides.containsKey(relativeName);
  +    }
  +    
   
       /**
        * Set the initial properties to be used when the frame starts execution
  @@ -456,8 +552,7 @@
           Frame frame = getContainingFrame(name);
   
           if (frame == null) {
  -            throw new ExecutionException("There is no project corresponding "
  -                 + "to the name \"" + name + "\"");
  +            return getOverrideProperty(name);
           }
           if (frame == this) {
               return dataValues.get(name);
  @@ -480,8 +575,7 @@
           Frame frame = getContainingFrame(name);
   
           if (frame == null) {
  -            throw new ExecutionException("There is no project corresponding "
  -                 + "to the name \"" + name + "\"");
  +            return isOverrideSet(name);
           }
           if (frame == this) {
               return dataValues.containsKey(name);
  @@ -551,6 +645,14 @@
       protected void createProjectReference(String name, Project project) 
           throws ExecutionException {
          Frame referencedFrame = createFrame(project);
  +
  +       // does the frame have any overrides?
  +       Map initialProperties = (Map) overrides.get(name);
  +       if (initialProperties != null) {
  +           referencedFrame.setInitialProperties(initialProperties);
  +           overrides.remove(name);
  +       }
  +        
          referencedFrames.put(name, referencedFrame);
          referencedFrame.initialize();
       }
  @@ -565,7 +667,7 @@
       protected Frame createFrame(Project project)
            throws ExecutionException {
           Frame newFrame
  -             = new Frame(standardLibs, initConfig, config);
  +             = new Frame(initConfig, config);
   
           newFrame.setProject(project);
           for (Iterator j = eventSupport.getListeners(); j.hasNext();) {
  @@ -573,6 +675,7 @@
   
               newFrame.addBuildListener(listener);
           }
  +        
           return newFrame;
       }
   
  @@ -840,11 +943,27 @@
        *      failed
        */
       protected void initialize() throws ExecutionException {
  +        configureServices();
  +        setMagicProperties();
           determineBaseDir();
   
  -        Iterator taskIterator = project.getTasks();
  -
  -        executeTasks(taskIterator);
  +        try {        
  +            // load system ant lib
  +            URL systemLibs 
  +                = new URL(initConfig.getLibraryURL(), "syslibs/");
  +            componentManager.loadLib(systemLibs.toString(), true);
  +            
  +            // execute any config tasks
  +            executeTasks(config.getTasks());
  +    
  +            // now load other system libraries
  +            URL antLibs = new URL(initConfig.getLibraryURL(), "antlibs/");
  +            componentManager.loadLib(antLibs.toString(), false);                           
  +            
  +            executeTasks(project.getTasks());
  +        } catch (MalformedURLException e) {
  +            throw new ExecutionException("Unable to initialize antlibs", e);
  +        }
       }
   
   
  @@ -888,8 +1007,7 @@
       private void configureServices() {
           // create services and make them available in our services map
           fileService = new CoreFileService(this);
  -        componentManager = new ComponentManager(this,
  -            config.isRemoteLibAllowed(), config.getLibraryPathsMap());
  +        componentManager = new ComponentManager(this);
           dataService = new CoreDataService(this,
               config.isUnsetPropertiesAllowed());
           execService = new CoreExecService(this);
  
  
  
  1.6       +6 -0      jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/antlib.xml
  
  Index: antlib.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/antlib.xml,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -u -r1.5 -r1.6
  --- antlib.xml	4 Mar 2002 15:17:31 -0000	1.5
  +++ antlib.xml	30 Apr 2002 14:57:02 -0000	1.6
  @@ -38,6 +38,7 @@
     <taskdef name="dependset" classname="org.apache.tools.ant.taskdefs.DependSet"/>
     <taskdef name="ear" classname="org.apache.tools.ant.taskdefs.Ear"/>
     <taskdef name="echo" classname="org.apache.tools.ant.taskdefs.Echo"/>
  +  <taskdef name="echoproperties" classname="org.apache.tools.ant.taskdefs.optional.EchoProperties"/>
     <taskdef name="ejbc" classname="org.apache.tools.ant.taskdefs.optional.ejb.Ejbc"/>
     <taskdef name="ejbjar" classname="org.apache.tools.ant.taskdefs.optional.ejb.EjbJar"/>
     <taskdef name="exec" classname="org.apache.tools.ant.taskdefs.ExecTask"/>
  @@ -107,6 +108,7 @@
     <taskdef name="sosget" classname="org.apache.tools.ant.taskdefs.optional.sos.SOSGet"/>
     <taskdef name="soslabel" classname="org.apache.tools.ant.taskdefs.optional.sos.SOSLabel"/>
     <taskdef name="sound" classname="org.apache.tools.ant.taskdefs.optional.sound.SoundTask"/>
  +  <taskdef name="splash" classname="org.apache.tools.ant.taskdefs.optional.splash.SplashTask"/>
     <taskdef name="sql" classname="org.apache.tools.ant.taskdefs.SQLExec"/>
     <taskdef name="stcheckin" classname="org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckin"/>
     <taskdef name="stcheckout" classname="org.apache.tools.ant.taskdefs.optional.starteam.StarTeamCheckout"/>
  @@ -155,9 +157,13 @@
     <typedef name="filelist" classname="org.apache.tools.ant.types.FileList"/>
     <typedef name="patternset" classname="org.apache.tools.ant.types.PatternSet"/>
     <typedef name="mapper" classname="org.apache.tools.ant.types.Mapper"/>
  +  <typedef name="filterchain" classname="org.apache.tools.ant.types.FilterChain"/>
  +  <typedef name="filterreader" classname="org.apache.tools.ant.types.AntFilterReader"/>
     <typedef name="filterset" classname="org.apache.tools.ant.types.FilterSet"/>
     <typedef name="description" classname="org.apache.tools.ant.types.Description"/>
     <typedef name="classfileset" classname="org.apache.tools.ant.types.optional.depend.ClassfileSet"/>
     <typedef name="substitution" classname="org.apache.tools.ant.types.Substitution"/>
  +  <typedef name="regexp" classname="org.apache.tools.ant.types.RegularExpression"/>
     <typedef name="regularexpression" classname="org.apache.tools.ant.types.RegularExpression"/>
  +  <typedef name="xmlcatalog" classname="org.apache.tools.ant.types.XMLCatalog"/>
   </antlib>
  
  
  
  1.8       +6 -234    jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntBase.java
  
  Index: AntBase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/AntBase.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -w -u -r1.7 -r1.8
  --- AntBase.java	12 Apr 2002 14:59:56 -0000	1.7
  +++ AntBase.java	30 Apr 2002 14:57:02 -0000	1.8
  @@ -53,14 +53,8 @@
    */
   package org.apache.ant.antlib.system;
   import java.util.ArrayList;
  -import java.util.HashMap;
   import java.util.List;
   import java.util.Map;
  -import org.apache.ant.common.antlib.AbstractComponent;
  -import org.apache.ant.common.antlib.AbstractTask;
  -import org.apache.ant.common.antlib.AntContext;
  -import org.apache.ant.common.service.DataService;
  -import org.apache.ant.common.service.ExecService;
   import org.apache.ant.common.util.ExecutionException;
   
   /**
  @@ -69,153 +63,7 @@
    * @author Conor MacNeill
    * @created 4 February 2002
    */
  -public abstract class AntBase extends AbstractTask {
  -
  -    /**
  -     * Simple Property value storing class
  -     *
  -     * @author Conor MacNeill
  -     * @created 5 February 2002
  -     */
  -    public static class Property extends AbstractComponent {
  -        /** The property name */
  -        private String name;
  -
  -        /** The property value */
  -        private String value;
  -
  -
  -        /**
  -         * Gets the name of the Property
  -         *
  -         * @return the name value
  -         */
  -        public String getName() {
  -            return name;
  -        }
  -
  -
  -        /**
  -         * Gets the value of the Property
  -         *
  -         * @return the value value
  -         */
  -        public String getValue() {
  -            return value;
  -        }
  -
  -
  -        /**
  -         * Sets the name of the Property
  -         *
  -         * @param name the new name value
  -         */
  -        public void setName(String name) {
  -            this.name = name;
  -        }
  -
  -
  -        /**
  -         * Sets the value of the Property
  -         *
  -         * @param value the new value value
  -         */
  -        public void setValue(String value) {
  -            this.value = value;
  -        }
  -
  -
  -        /**
  -         * Validate this data type instance
  -         *
  -         * @exception ExecutionException if either attribute has not been set
  -         */
  -        public void validateComponent() throws ExecutionException {
  -            if (name == null) {
  -                throw new ExecutionException("\"name\" attribute of "
  -                     + "<property> must be supplied");
  -            }
  -            if (value == null) {
  -                throw new ExecutionException("\"value\" attribute of "
  -                     + "<property> must be supplied");
  -            }
  -        }
  -    }
  -
  -
  -    /**
  -     * A simple class to store information about references being passed
  -     *
  -     * @author Conor MacNeill
  -     * @created 5 February 2002
  -     */
  -    public static class Reference extends AbstractComponent {
  -        /** The id of the reference to be passed */
  -        private String refId;
  -        /** The id to be used in the sub-build for this reference */
  -        private String toId;
  -
  -
  -        /**
  -         * Gets the refId of the Reference
  -         *
  -         * @return the refId value
  -         */
  -        public String getRefId() {
  -            return refId;
  -        }
  -
  -
  -        /**
  -         * Gets the toId of the Reference
  -         *
  -         * @return the toId value
  -         */
  -        public String getToId() {
  -            return toId;
  -        }
  -
  -
  -        /**
  -         * Sets the refId of the Reference
  -         *
  -         * @param refId the new refId value
  -         */
  -        public void setRefId(String refId) {
  -            this.refId = refId;
  -        }
  -
  -
  -        /**
  -         * Sets the toId of the Reference
  -         *
  -         * @param toId the new toId value
  -         */
  -        public void setToId(String toId) {
  -            this.toId = toId;
  -        }
  -
  -
  -        /**
  -         * Validate this data type instance
  -         *
  -         * @exception ExecutionException if the refid attribute has not been
  -         *      set
  -         */
  -        public void validateComponent() throws ExecutionException {
  -            if (refId == null) {
  -                throw new ExecutionException("\"refid\" attribute of "
  -                     + "<reference> must be supplied");
  -            }
  -        }
  -    }
  -
  -
  -    /** The core's data service for manipulating the properties */
  -    private DataService dataService;
  -
  -    /** The core's ExecutionService for running builds and external programs */
  -    private ExecService execService;
  +public abstract class AntBase extends SubBuild {
       
       /**
        * flag which indicates if all current properties should be passed to the
  @@ -229,9 +77,6 @@
        */
       private boolean inheritRefs = false;
   
  -    /** The properties which will be passed to the sub-build */
  -    private Map properties = new HashMap();
  -
       /**
        * The key to the subbuild with which the Ant task can manage the subbuild
        */
  @@ -240,51 +85,6 @@
       /** The name of the target to be evaluated in the sub-build */
       private String targetName;
   
  -
  -    /**
  -     * Add a property to be passed to the subbuild
  -     *
  -     * @param property descriptor for the property to be passed
  -     */
  -    public void addProperty(Property property) {
  -        properties.put(property.getName(), property.getValue());
  -    }
  -
  -
  -    /**
  -     * Add a reference to be passed
  -     *
  -     * @param reference the descriptor of the reference to be passed
  -     * @exception ExecutionException if the reference does not reference a
  -     *      valid object
  -     */
  -    public void addReference(Reference reference) throws ExecutionException {
  -        String refId = reference.getRefId();
  -
  -        if (!dataService.isDataValueSet(refId)) {
  -            throw new ExecutionException("RefId \"" + refId + "\" is not set");
  -        }
  -        Object value = dataService.getDataValue(refId);
  -        String toId = reference.getToId();
  -
  -        if (toId == null) {
  -            toId = refId;
  -        }
  -
  -        properties.put(toId, value);
  -    }
  -
  -
  -    /**
  -     * Get the core's execution service
  -     *
  -     * @return the core's execution service.
  -     */
  -    protected ExecService getExecService() {
  -        return execService;
  -    }
  -
  -
       /**
        * Get the properties to be used with the sub-build
        *
  @@ -292,13 +92,13 @@
        */
       protected Map getProperties() {
           if (!inheritAll) {
  -            return properties;
  +            return super.getProperties();
           }
   
           // need to combine existing properties with new ones
  -        Map subBuildProperties = dataService.getAllProperties();
  +        Map subBuildProperties = getDataService().getAllProperties();
   
  -        subBuildProperties.putAll(properties);
  +        subBuildProperties.putAll(super.getProperties());
           return subBuildProperties;
       }
   
  @@ -331,7 +131,7 @@
           if (subbuildKey == null) {
               super.handleSystemErr(line);
           } else {
  -            execService.handleBuildOutput(subbuildKey, line, true);
  +            getExecService().handleBuildOutput(subbuildKey, line, true);
           }
       }
   
  @@ -349,25 +149,8 @@
           if (subbuildKey == null) {
               super.handleSystemOut(line);
           } else {
  -            execService.handleBuildOutput(subbuildKey, line, false);
  -        }
  +            getExecService().handleBuildOutput(subbuildKey, line, false);
       }
  -
  -
  -    /**
  -     * Initialise this task
  -     *
  -     * @param context core's context
  -     * @param componentType the component type of this component (i.e its
  -     *      defined name in the build file)
  -     * @exception ExecutionException if we can't access the data service
  -     */
  -    public void init(AntContext context, String componentType)
  -         throws ExecutionException {
  -        super.init(context, componentType);
  -        dataService = (DataService) getCoreService(DataService.class);
  -        execService = (ExecService) getCoreService(ExecService.class);
  -
       }
   
   
  @@ -389,17 +172,6 @@
        */
       public void setInheritRefs(boolean inheritRefs) {
           this.inheritRefs = inheritRefs;
  -    }
  -
  -
  -    /**
  -     * Set a property for the subbuild
  -     *
  -     * @param propertyName the property name
  -     * @param propertyValue the value of the property
  -     */
  -    protected void setProperty(String propertyName, Object propertyValue) {
  -        properties.put(propertyName, propertyValue);
       }
   
   
  
  
  
  1.4       +3 -0      jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/LibPath.java
  
  Index: LibPath.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/LibPath.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -u -r1.3 -r1.4
  --- LibPath.java	18 Mar 2002 02:44:26 -0000	1.3
  +++ LibPath.java	30 Apr 2002 14:57:02 -0000	1.4
  @@ -60,6 +60,7 @@
   import org.apache.ant.common.antlib.AntContext;
   import org.apache.ant.common.service.ComponentService;
   import org.apache.ant.common.util.ExecutionException;
  +import org.apache.ant.common.event.MessageLevel;
   import org.apache.ant.init.InitUtils;
   
   /**
  @@ -153,6 +154,8 @@
           AntContext context = getAntContext();
           ComponentService componentService = (ComponentService)
               context.getCoreService(ComponentService.class);
  +        log("Adding lib path " + url + " for " + libraryId, 
  +            MessageLevel.MSG_DEBUG);    
           componentService.addLibPath(libraryId, url);
       }
   
  
  
  
  1.1                  jakarta-ant/proposal/mutant/src/java/antlibs/system/org/apache/ant/antlib/system/SubBuild.java
  
  Index: SubBuild.java
  ===================================================================
  /*
   * The Apache Software License, Version 1.1
   *
   * Copyright (c) 2002 The Apache Software Foundation.  All rights
   * reserved.
   *
   * Redistribution and use in source and binary forms, with or without
   * modification, are permitted provided that the following conditions
   * are met:
   *
   * 1. Redistributions of source code must retain the above copyright
   *    notice, this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright
   *    notice, this list of conditions and the following disclaimer in
   *    the documentation and/or other materials provided with the
   *    distribution.
   *
   * 3. The end-user documentation included with the redistribution, if
   *    any, must include the following acknowlegement:
   *       "This product includes software developed by the
   *        Apache Software Foundation (http://www.apache.org/)."
   *    Alternately, this acknowlegement may appear in the software itself,
   *    if and wherever such third-party acknowlegements normally appear.
   *
   * 4. The names "The Jakarta Project", "Ant", and "Apache Software
   *    Foundation" must not be used to endorse or promote products derived
   *    from this software without prior written permission. For written
   *    permission, please contact apache@apache.org.
   *
   * 5. Products derived from this software may not be called "Apache"
   *    nor may "Apache" appear in their names without prior written
   *    permission of the Apache Group.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
   * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
   * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
   * DISCLAIMED.  IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
   * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
   * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
   * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
   * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
   * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
   * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
   * SUCH DAMAGE.
   * ====================================================================
   *
   * This software consists of voluntary contributions made by many
   * individuals on behalf of the Apache Software Foundation.  For more
   * information on the Apache Software Foundation, please see
   * <http://www.apache.org/>.
   */
  package org.apache.ant.antlib.system;
  import java.util.HashMap;
  import java.util.Map;
  import org.apache.ant.common.antlib.AbstractComponent;
  import org.apache.ant.common.antlib.AbstractTask;
  import org.apache.ant.common.antlib.AntContext;
  import org.apache.ant.common.service.DataService;
  import org.apache.ant.common.service.ExecService;
  import org.apache.ant.common.util.ExecutionException;
  
  /**
   * Common Base class all tasks that can pass references and property overrides
   * to a subbuild
   *
   * @author Conor MacNeill
   * @created 22 April 2002
   */
  public abstract class SubBuild extends AbstractTask {
  
      /**
       * Simple Property value storing class
       *
       * @author Conor MacNeill
       * @created 5 February 2002
       */
      public static class Property extends AbstractComponent {
          /** The property name */
          private String name;
  
          /** The property value */
          private String value;
  
  
          /**
           * Gets the name of the Property
           *
           * @return the name value
           */
          public String getName() {
              return name;
          }
  
  
          /**
           * Gets the value of the Property
           *
           * @return the value value
           */
          public String getValue() {
              return value;
          }
  
  
          /**
           * Sets the name of the Property
           *
           * @param name the new name value
           */
          public void setName(String name) {
              this.name = name;
          }
  
  
          /**
           * Sets the value of the Property
           *
           * @param value the new value value
           */
          public void setValue(String value) {
              this.value = value;
          }
  
  
          /**
           * Validate this data type instance
           *
           * @exception ExecutionException if either attribute has not been set
           */
          public void validateComponent() throws ExecutionException {
              if (name == null) {
                  throw new ExecutionException("\"name\" attribute of "
                       + "<property> must be supplied");
              }
              if (value == null) {
                  throw new ExecutionException("\"value\" attribute of "
                       + "<property> must be supplied");
              }
          }
      }
  
  
      /**
       * A simple class to store information about references being passed
       *
       * @author Conor MacNeill
       * @created 5 February 2002
       */
      public static class Reference extends AbstractComponent {
          /** The id of the reference to be passed */
          private String refId;
          /** The id to be used in the sub-build for this reference */
          private String toId;
  
  
          /**
           * Gets the refId of the Reference
           *
           * @return the refId value
           */
          public String getRefId() {
              return refId;
          }
  
  
          /**
           * Gets the toId of the Reference
           *
           * @return the toId value
           */
          public String getToId() {
              return toId;
          }
  
  
          /**
           * Sets the refId of the Reference
           *
           * @param refId the new refId value
           */
          public void setRefId(String refId) {
              this.refId = refId;
          }
  
  
          /**
           * Sets the toId of the Reference
           *
           * @param toId the new toId value
           */
          public void setToId(String toId) {
              this.toId = toId;
          }
  
  
          /**
           * Validate this data type instance
           *
           * @exception ExecutionException if the refid attribute has not been
           *      set
           */
          public void validateComponent() throws ExecutionException {
              if (refId == null) {
                  throw new ExecutionException("\"refid\" attribute of "
                       + "<reference> must be supplied");
              }
          }
      }
  
  
      /** The core's data service for manipulating the properties */
      private DataService dataService;
  
      /** The core's ExecutionService for running builds and external programs */
      private ExecService execService;
  
      /** The properties which will be passed to the sub-build */
      private Map properties = new HashMap();
  
  
      /**
       * Add a property to be passed to the subbuild
       *
       * @param property descriptor for the property to be passed
       */
      public void addProperty(Property property) {
          properties.put(property.getName(), property.getValue());
      }
  
  
      /**
       * Add a reference to be passed
       *
       * @param reference the descriptor of the reference to be passed
       * @exception ExecutionException if the reference does not reference a
       *      valid object
       */
      public void addReference(Reference reference) throws ExecutionException {
          String refId = reference.getRefId();
  
          if (!dataService.isDataValueSet(refId)) {
              throw new ExecutionException("RefId \"" + refId + "\" is not set");
          }
          Object value = dataService.getDataValue(refId);
          String toId = reference.getToId();
  
          if (toId == null) {
              toId = refId;
          }
  
          properties.put(toId, value);
      }
  
  
      /**
       * Get the core's execution service
       *
       * @return the core's execution service.
       */
      protected ExecService getExecService() {
          return execService;
      }
  
  
      /**
       * Get the core's date service
       *
       * @return the core's data service.
       */
      protected DataService getDataService() {
          return dataService;
      }
  
  
      /**
       * Get the properties to be used with the sub-build
       *
       * @return the properties the sub-build will start with
       */
      protected Map getProperties() {
          return properties;
      }
  
  
      /**
       * Initialise this task
       *
       * @param context core's context
       * @param componentType the component type of this component (i.e its
       *      defined name in the build file)
       * @exception ExecutionException if we can't access the data service
       */
      public void init(AntContext context, String componentType)
           throws ExecutionException {
          super.init(context, componentType);
          dataService = (DataService) getCoreService(DataService.class);
          execService = (ExecService) getCoreService(ExecService.class);
      }
  
  
      /**
       * Set a property for the subbuild
       *
       * @param propertyName the property name
       * @param propertyValue the value of the property
       */
      protected void setProperty(String propertyName, Object propertyValue) {
          properties.put(propertyName, propertyValue);
      }
  }
  
  
  
  
  1.6       +2 -1      jakarta-ant/proposal/mutant/src/java/bootstrap/org/apache/ant/builder/Ant1CompatBuilder.java
  
  Index: Ant1CompatBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/bootstrap/org/apache/ant/builder/Ant1CompatBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -u -r1.5 -r1.6
  --- Ant1CompatBuilder.java	16 Apr 2002 14:07:46 -0000	1.5
  +++ Ant1CompatBuilder.java	30 Apr 2002 14:57:02 -0000	1.6
  @@ -25,7 +25,7 @@
                           "${lib.dir}/ant1compat", "*.jar");
           helper.addPathElementToPath("classpath", "${distlib.dir}/init.jar");
           helper.addPathElementToPath("classpath", "${distlib.dir}/common/common.jar");
  -        helper.addPathElementToPath("classpath", "${distlib.dir}/antlibs/system.jar");
  +        helper.addPathElementToPath("classpath", "${distlib.dir}/syslibs/system.jar");
       }
       protected void check_for_optional_packages(BuildHelper helper) {
       }
  @@ -36,6 +36,7 @@
           helper.javac("${bin.dir}/ant1src_copy:${java.dir}/antlibs/ant1compat", "${bin.dir}/ant1compat", "classpath");
           helper.copyFileset("${bin.dir}/ant1src_copy", "${bin.dir}/ant1compat");
           helper.copyFileset("${ant1etc.dir}", "${bin.dir}/ant1compat/${optional.package}/junit/xsl");
  +        helper.mkdir("${distlib.dir}/antlibs/");
           helper.jar("${bin.dir}/ant1compat", "${distlib.dir}/antlibs/ant1compat.jar",
                      "${java.dir}/antlibs/ant1compat", "antlib.xml", null, null);
       }
  
  
  
  1.18      +1 -6      jakarta-ant/proposal/mutant/src/java/bootstrap/org/apache/ant/builder/Builder.java
  
  Index: Builder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/bootstrap/org/apache/ant/builder/Builder.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -w -u -r1.17 -r1.18
  --- Builder.java	29 Apr 2002 23:47:27 -0000	1.17
  +++ Builder.java	30 Apr 2002 14:57:02 -0000	1.18
  @@ -209,12 +209,7 @@
           mutantBuilder.antcore(mainBuild);
           mutantBuilder.start(mainBuild);
           mutantBuilder.frontend(mainBuild);
  -
  -        BuildHelper systemBuild = new BuildHelper();
  -        systemBuild.setProperty("libset", "system");
  -        systemBuild.setProperty("dist.dir", "bootstrap");
  -        mutantBuilder._init(systemBuild);
  -        mutantBuilder.build_lib(systemBuild);
  +        mutantBuilder.systemlib(mainBuild);
   
           Ant1CompatBuilder ant1Builder = new Ant1CompatBuilder();
           BuildHelper ant1Build = new BuildHelper();
  
  
  
  1.6       +6 -6      jakarta-ant/proposal/mutant/src/java/bootstrap/org/apache/ant/builder/MutantBuilder.java
  
  Index: MutantBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/bootstrap/org/apache/ant/builder/MutantBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -w -u -r1.5 -r1.6
  --- MutantBuilder.java	16 Apr 2002 14:07:46 -0000	1.5
  +++ MutantBuilder.java	30 Apr 2002 14:57:02 -0000	1.6
  @@ -78,15 +78,15 @@
       }
       protected void antlibs(BuildHelper helper) {
       }
  -    protected void build_lib(BuildHelper helper) {
  -        helper.mkdir("${bin.dir}/antlibs/${libset}");
  -        helper.mkdir("${distlib.dir}/antlibs");
  +    protected void systemlib(BuildHelper helper) {
  +        helper.mkdir("${bin.dir}/antlibs/system");
  +        helper.mkdir("${distlib.dir}/syslibs");
           helper.createPath("classpath.antlibs");
           helper.addPathElementToPath("classpath.antlibs", "${distlib.dir}/common/common.jar");
           helper.addPathToPath("classpath.antlibs", "classpath.common");
  -        helper.javac("${java.dir}/antlibs/${libset}", "${bin.dir}/antlibs/${libset}", "classpath.antlibs");
  -        helper.jar("${bin.dir}/antlibs/${libset}", "${distlib.dir}/antlibs/${libset}.jar",
  -                   "${java.dir}/antlibs/${libset}", "antlib.xml", null, null);
  +        helper.javac("${java.dir}/antlibs/system", "${bin.dir}/antlibs/system", "classpath.antlibs");
  +        helper.jar("${bin.dir}/antlibs/system", "${distlib.dir}/syslibs/system.jar",
  +                   "${java.dir}/antlibs/system", "antlib.xml", null, null);
       }
       protected void main(BuildHelper helper) {
       }
  
  
  
  1.9       +1 -0      jakarta-ant/proposal/mutant/src/java/init/org/apache/ant/init/LoaderUtils.java
  
  Index: LoaderUtils.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/init/org/apache/ant/init/LoaderUtils.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- LoaderUtils.java	7 Apr 2002 14:38:07 -0000	1.8
  +++ LoaderUtils.java	30 Apr 2002 14:57:02 -0000	1.9
  @@ -240,6 +240,7 @@
           }
   
           if (!location.isDirectory()) {
  +            urls = new URL[1];
               String path = location.getPath();
               for (int i = 0; i < extensions.length; ++i) {
                   if (path.endsWith(extensions[i])) {
  
  
  

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message