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/common/org/apache/ant/common/service ComponentService.java
Date Mon, 04 Mar 2002 15:17:32 GMT
conor       02/03/04 07:17:32

  Modified:    proposal/mutant bootstrap.bat build.xml
               proposal/mutant/build ant1compat.xml
               proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution
                        ComponentManager.java CoreExecService.java
                        ExecutionContext.java
               proposal/mutant/src/java/antlibs/ant1compat antlib.xml
               proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant
                        Project.java Task.java
               proposal/mutant/src/java/bootstrap/org/apache/ant/builder
                        Ant1CompatBuilder.java MutantBuilder.java
               proposal/mutant/src/java/common/org/apache/ant/common/antlib
                        AntContext.java
               proposal/mutant/src/java/common/org/apache/ant/common/service
                        ComponentService.java
  Added:       proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/taskdefs
                        Ant.java CallTarget.java
  Log:
  New facades for ant and antcall tasks.
  
  Revision  Changes    Path
  1.2       +3 -0      jakarta-ant/proposal/mutant/bootstrap.bat
  
  Index: bootstrap.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/bootstrap.bat,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- bootstrap.bat	19 Feb 2002 02:12:21 -0000	1.1
  +++ bootstrap.bat	4 Mar 2002 15:17:31 -0000	1.2
  @@ -27,3 +27,6 @@
   
   REM Use the full build as the build used by the build script
   xcopy /s dist bootstrap
  +
  +REM clean up after bootstrap
  +java -classpath bootstrap\lib\start.jar:bootstrap\lib\init.jar org.apache.ant.start.Main
clean
  
  
  
  1.14      +11 -8     jakarta-ant/proposal/mutant/build.xml
  
  Index: build.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/build.xml,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -w -u -r1.13 -r1.14
  --- build.xml	18 Feb 2002 12:36:03 -0000	1.13
  +++ build.xml	4 Mar 2002 15:17:31 -0000	1.14
  @@ -35,7 +35,8 @@
     </path>
   
     <target name="buildsetup">
  -    <available file="../checkstyle" property="checkstyle.available"/>
  +    <available classname="com.puppycrawl.tools.checkstyle.CheckStyleTask" 
  +               property="checkstyle.available"/>
       <mkdir dir="${bin.dir}"/>
       <mkdir dir="${distlib.dir}"/>
       <copy todir="${distlib.dir}/parser">
  @@ -99,6 +100,14 @@
           <attribute name="Main-Class" value="org.apache.ant.start.Main"/>
           <attribute name="Class-Path" value="init.jar"/>
         </manifest>
  +      <include name="org/apache/ant/**/*"/>
  +    </jar>
  +    <jar basedir="${bin.dir}/start" jarfile="${distlib.dir}/ant.jar">
  +      <manifest>
  +        <attribute name="Main-Class" value="org.apache.tools.ant.Main"/>
  +        <attribute name="Class-Path" value="start.jar"/>
  +      </manifest>
  +      <include name="org/apache/tools/ant/**/*"/>
       </jar>
     </target>
   
  @@ -155,14 +164,8 @@
     <target name="main" depends="cli, antlibs, ant1compat, remote, checkstyle"/> 
     
     <target name="checkstyle" if="checkstyle.available">
  -    <property name="checkstyle.bin" value="../checkstyle"/>
  -    <path id="checkstyle.path">
  -      <fileset dir="${checkstyle.bin}"/>
  -    </path>
       <taskdef name="checkstyle"
  -             classname="com.puppycrawl.tools.checkstyle.CheckStyleTask">
  -        <classpath refid="checkstyle.path"/>
  -    </taskdef>
  +             classname="com.puppycrawl.tools.checkstyle.CheckStyleTask"/>
       <mkdir dir="${bin.dir}/check"/>
       <checkstyle maxlinelen="80"
                   memberpattern="[a-z].*"
  
  
  
  1.5       +1 -2      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.4
  retrieving revision 1.5
  diff -u -w -u -r1.4 -r1.5
  --- ant1compat.xml	2 Mar 2002 14:14:49 -0000	1.4
  +++ ant1compat.xml	4 Mar 2002 15:17:31 -0000	1.5
  @@ -32,8 +32,6 @@
     <patternset id="converted">
       <exclude name="org/apache/tools/ant/taskdefs/Ant.java"/>
       <exclude name="org/apache/tools/ant/taskdefs/CallTarget.java"/>
  -    <exclude name="org/apache/tools/ant/taskdefs/Parallel.java"/>
  -    <exclude name="org/apache/tools/ant/taskdefs/Sequential.java"/>
     </patternset>
   
     <fileset id="ant1src" dir="../../src/main">
  @@ -68,6 +66,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.tsk"/>
     </path>
   
     <target name="check_for_optional_packages">
  
  
  
  1.9       +130 -56   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.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- ComponentManager.java	26 Feb 2002 13:43:53 -0000	1.8
  +++ ComponentManager.java	4 Mar 2002 15:17:31 -0000	1.9
  @@ -323,6 +323,29 @@
       }
   
       /**
  +     * Create a component given its class. The component will have a context
  +     * but will not be configured. It should be configured using the
  +     * appropriate set methods and then validated before being used.
  +     *
  +     * @param componentClass the component's class
  +     * @param factory the factory to create the component
  +     * @param loader the classloader associated with the component
  +     * @param addTaskAdapter whenther the returned component should be a
  +     *      task, potentially being wrapped in an adapter
  +     * @param componentName the name of the component type
  +     * @return the created component. The return type of this method depends
  +     *      on the component type.
  +     * @exception ExecutionException if the component cannot be created
  +     */
  +    public Object createComponent(AntLibFactory factory, ClassLoader loader,
  +                                  Class componentClass, boolean addTaskAdapter,
  +                                  String componentName)
  +         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
        *
  @@ -421,6 +444,10 @@
       protected Object createComponent(String componentName, BuildElement model)
            throws ExecutionException {
   
  +        Location location = Location.UNKNOWN_LOCATION;
  +        if (model != null) {
  +            location = model.getLocation();
  +        }
           ImportInfo definition = getDefinition(componentName);
           if (definition == null) {
               throw new ExecutionException("There is no definition of the <"
  @@ -430,73 +457,26 @@
               
           ComponentLibrary componentLibrary
                = definition.getComponentLibrary();
  +        boolean isTask = definition.getDefinitionType() == AntLibrary.TASKDEF;
           String localName = definition.getLocalName();
           try {
               ClassLoader componentLoader = componentLibrary.getClassLoader();
               Class componentClass
                    = Class.forName(className, true, componentLoader);
               AntLibFactory libFactory = getLibFactory(componentLibrary);
  -            Location location = Location.UNKNOWN_LOCATION;
  -            if (model != null) {
  -                location = model.getLocation();
  -            }
  -
  -            Object component
  -                 = libFactory.createComponent(componentClass, localName);
  -
  -            ExecutionComponent execComponent = null;
  -            if (definition.getDefinitionType() == AntLibrary.TASKDEF) {
  -                if (component instanceof Task) {
  -                    execComponent = (Task)component;
  -                } else {
  -                    execComponent = new TaskAdapter(componentName, component);
  -                }
  -            } else if (component instanceof ExecutionComponent) {
  -                execComponent = (ExecutionComponent)component;
  -            }
  -
  -            ExecutionContext context
  -                 = new ExecutionContext(frame, execComponent, location);
  -            context.setClassLoader(componentLoader);
  -            ClassLoader currentLoader
  -                 = LoaderUtils.setContextLoader(componentLoader);
  -            if (execComponent != null) {
  -                execComponent.init(context, componentName);
  -            }
  -            if (model != null) {
  -                configureElement(libFactory, component, model);
  -                if (execComponent != null) {
  -                    execComponent.validateComponent();
  -                }
  -            }
  -            LoaderUtils.setContextLoader(currentLoader);
  -            if (execComponent != null) {
  -                return execComponent;
  -            }
  -
  -            return component;
  +            return createComponent(componentLoader, libFactory, componentClass,
  +                componentName, localName, isTask, model);
           } catch (ClassNotFoundException e) {
               throw new ExecutionException("Class " + className
                    + " for component <" + componentName + "> was not found", e,
  -                model.getLocation());
  +                location);
           } catch (NoClassDefFoundError e) {
               throw new ExecutionException("Could not load a dependent class ("
                    + e.getMessage() + ") for component " + componentName,
  -                e, model.getLocation());
  -        } catch (InstantiationException e) {
  -            throw new ExecutionException("Unable to instantiate component "
  -                 + "class " + className + " for component <" + componentName
  -                 + ">", e, model.getLocation());
  -        } catch (IllegalAccessException e) {
  -            throw new ExecutionException("Unable to access task class "
  -                 + className + " for component <" + componentName + ">",
  -                e, model.getLocation());
  +                e, location);
           } catch (ExecutionException e) {
               e.setLocation(model.getLocation(), false);
               throw e;
  -        } catch (RuntimeException e) {
  -            throw new ExecutionException(e.getClass().getName() + ": "
  -                 + e.getMessage(), e, model.getLocation());
           }
       }
   
  @@ -543,6 +523,100 @@
   
           setters.put(c, setter);
           return setter;
  +    }
  +
  +    /**
  +     * Create a component - handles all the variations
  +     *
  +     * @param loader the component's classloader
  +     * @param componentClass The class of the component.
  +     * @param componentName The component's name in the global context
  +     * @param addTaskAdapter whether the component should add a Task adapter
  +     *      to make this component a Task.
  +     * @param localName The name of the component within its library
  +     * @param model the BuildElement model of the component's configuration
  +     * @param factory the facrtory object used to create the component
  +     * @return the required component potentially wrapped in a wrapper
  +     *      object.
  +     * @exception ExecutionException if the component cannot be created
  +     */
  +    private Object createComponent(ClassLoader loader, AntLibFactory factory,
  +                                   Class componentClass, String componentName,
  +                                   String localName, boolean addTaskAdapter,
  +                                   BuildElement model)
  +         throws ExecutionException {
  +        // set the location to unknown unless we have a build model to use
  +        Location location = Location.UNKNOWN_LOCATION;
  +        if (model != null) {
  +            location = model.getLocation();
  +        }
  +
  +        try {
  +            // create the component using the factory
  +            Object component
  +                 = factory.createComponent(componentClass, localName);
  +
  +            // wrap the component in an adapter if required.
  +            ExecutionComponent execComponent = null;
  +            if (addTaskAdapter) {
  +                if (component instanceof Task) {
  +                    execComponent = (Task)component;
  +                } else {
  +                    execComponent = new TaskAdapter(componentName, component);
  +                }
  +            } else if (component instanceof ExecutionComponent) {
  +                execComponent = (ExecutionComponent)component;
  +            }
  +
  +            // set the context loader to that for the component
  +            ClassLoader currentLoader
  +                 = LoaderUtils.setContextLoader(loader);
  +
  +            // if the component is an execution component create a context and
  +            // initialise the component with it.
  +            if (execComponent != null) {
  +                ExecutionContext context
  +                     = new ExecutionContext(frame, execComponent, location);
  +                context.setClassLoader(loader);
  +                execComponent.init(context, componentName);
  +            }
  +
  +            // if we have a model, use it to configure the component. Otherwise
  +            // the caller is expected to configure thre object
  +            if (model != null) {
  +                configureElement(factory, component, model);
  +                // if the component is an execution component and we have a
  +                // model, validate it
  +                if (execComponent != null) {
  +                    execComponent.validateComponent();
  +                }
  +            }
  +
  +            // reset the loader
  +            LoaderUtils.setContextLoader(currentLoader);
  +
  +            // if we have an execution component, potentially a wrapper,
  +            // return it otherwise the component directly
  +            if (execComponent != null) {
  +                return execComponent;
  +            } else {
  +                return component;
  +            }
  +        } catch (InstantiationException e) {
  +            throw new ExecutionException("Unable to instantiate component "
  +                 + "class " + componentClass.getName() + " for component <"
  +                 + componentName + ">", e, location);
  +        } catch (IllegalAccessException e) {
  +            throw new ExecutionException("Unable to access task class "
  +                 + componentClass.getName() + " for component <"
  +                 + componentName + ">", e, location);
  +        } catch (ExecutionException e) {
  +            e.setLocation(location, false);
  +            throw e;
  +        } catch (RuntimeException e) {
  +            throw new ExecutionException(e.getClass().getName() + ": "
  +                 + e.getMessage(), e, location);
  +        }
       }
   
       /**
  
  
  
  1.3       +1 -1      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.2
  retrieving revision 1.3
  diff -u -w -u -r1.2 -r1.3
  --- CoreExecService.java	20 Feb 2002 13:43:14 -0000	1.2
  +++ CoreExecService.java	4 Mar 2002 15:17:31 -0000	1.3
  @@ -154,7 +154,7 @@
           Throwable failureCause = null;
           try {
               ClassLoader currentLoader 
  -                = LoaderUtils.setContextLoader(execContext.getLoader());
  +                = LoaderUtils.setContextLoader(execContext.getClassLoader());
               task.execute();
               LoaderUtils.setContextLoader(currentLoader);
           } catch (Throwable e) {
  
  
  
  1.9       +3 -3      jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionContext.java
  
  Index: ExecutionContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antcore/org/apache/ant/antcore/execution/ExecutionContext.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- ExecutionContext.java	20 Feb 2002 13:43:14 -0000	1.8
  +++ ExecutionContext.java	4 Mar 2002 15:17:31 -0000	1.9
  @@ -160,11 +160,11 @@
       }
   
       /**
  -     * Gets the loader for this task
  +     * Gets the loader for this context
        *
  -     * @return the task's loader
  +     * @return the context's loader
        */
  -    protected ClassLoader getLoader() {
  +    public ClassLoader getClassLoader() {
           return loader;
       }
   
  
  
  
  1.5       +2 -5      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.4
  retrieving revision 1.5
  diff -u -w -u -r1.4 -r1.5
  --- antlib.xml	18 Feb 2002 12:36:04 -0000	1.4
  +++ antlib.xml	4 Mar 2002 15:17:31 -0000	1.5
  @@ -1,14 +1,13 @@
   <antlib libid="ant.ant1compat" 
           home="http://jakarta.apache.org/ant"
  -        reqxml="true" reqtools="true">
  +        reqxml="true" reqtools="true"
  +        extends="ant.system">
   
     <factory classname="org.apache.tools.ant.Ant1Factory"/>
             
     <converter classname="org.apache.tools.ant.Ant1Converter"/>          
   
     <!-- typedefs -->  
  -  <taskdef name="ant" classname="org.apache.tools.ant.taskdefs.Ant"/>
  -  <taskdef name="antcall" classname="org.apache.tools.ant.taskdefs.CallTarget"/>
     <taskdef name="antlr" classname="org.apache.tools.ant.taskdefs.optional.ANTLR"/>
     <taskdef name="antstructure" classname="org.apache.tools.ant.taskdefs.AntStructure"/>
     <taskdef name="apply" classname="org.apache.tools.ant.taskdefs.Transform"/>
  @@ -89,7 +88,6 @@
     <taskdef name="p4label" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Label"/>
     <taskdef name="p4submit" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Submit"/>
     <taskdef name="p4sync" classname="org.apache.tools.ant.taskdefs.optional.perforce.P4Sync"/>
  -  <taskdef name="parallel" classname="org.apache.tools.ant.taskdefs.Parallel"/>
     <taskdef name="patch" classname="org.apache.tools.ant.taskdefs.Patch"/>
     <taskdef name="pathconvert" classname="org.apache.tools.ant.taskdefs.PathConvert"/>
     <taskdef name="property" classname="org.apache.tools.ant.taskdefs.Property"/>
  @@ -102,7 +100,6 @@
     <taskdef name="rmic" classname="org.apache.tools.ant.taskdefs.Rmic"/>
     <taskdef name="rpm" classname="org.apache.tools.ant.taskdefs.optional.Rpm"/>
     <taskdef name="script" classname="org.apache.tools.ant.taskdefs.optional.Script"/>
  -  <taskdef name="sequential" classname="org.apache.tools.ant.taskdefs.Sequential"/>
     <taskdef name="signjar" classname="org.apache.tools.ant.taskdefs.SignJar"/>
     <taskdef name="sleep" classname="org.apache.tools.ant.taskdefs.Sleep"/>
     <taskdef name="soscheckin" classname="org.apache.tools.ant.taskdefs.optional.sos.SOSCheckin"/>
  
  
  
  1.10      +41 -6     jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Project.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -w -u -r1.9 -r1.10
  --- Project.java	20 Feb 2002 13:43:15 -0000	1.9
  +++ Project.java	4 Mar 2002 15:17:31 -0000	1.10
  @@ -870,24 +870,59 @@
        * @return the created task instance
        */
       public Task createTask(String taskType) {
  -        // we piggy back the task onto the current context
           Task task = null;
  -        Class c = (Class)taskClassDefinitions.get(taskType);
  +        Class taskClass = (Class)taskClassDefinitions.get(taskType);
   
  -        if (c == null) {
  +        if (taskClass == null) {
               return null;
           }
   
           try {
  -            task = (Task)c.newInstance();
  -            task.setProject(this);
  -            task.init(context, taskType);
  +            Object taskObject = componentService.createComponent(factory, 
  +                context.getClassLoader(), taskClass, false, taskType);
  +            if (taskObject instanceof Task) {
  +                task = (Task)taskObject;
  +            } else {
  +                TaskAdapter adapter = new TaskAdapter();
  +                adapter.setProxy(taskObject);
  +                task = adapter;
  +            }
  +            task.setTaskType(taskType);
  +            task.setTaskName(taskType);
               return task;
           } catch (Throwable e) {
               throw new BuildException(e);
           }
       }
   
  +    /**
  +     * Creates a new instance of a data type.
  +     * 
  +     * @param typeName The name of the data type to create an instance of.
  +     *                 Must not be <code>null</code>.
  +     * 
  +     * @return an instance of the specified data type, or <code>null</code>
if
  +     *         the data type name is not recognised.
  +     * 
  +     * @exception BuildException if the data type name is recognised but 
  +     *                           instance creation fails.
  +     */
  +    public Object createDataType(String typeName) throws BuildException {
  +        Class typeClass = (Class)dataClassDefinitions.get(typeName);
  +
  +        if (typeClass == null) {
  +            return null;
  +        }
  +
  +        try {
  +            Object dataInstance = componentService.createComponent(factory, 
  +                context.getClassLoader(), typeClass, false, typeName);
  +            return dataInstance;
  +        } catch (Throwable e) {
  +            throw new BuildException(e);
  +        }
  +    }
  +    
       /** send build started event to the listeners */
       protected void fireBuildStarted() {
           BuildEvent event = new BuildEvent(this);
  
  
  
  1.9       +5 -1      jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Task.java
  
  Index: Task.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/Task.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- Task.java	2 Mar 2002 14:14:49 -0000	1.8
  +++ Task.java	4 Mar 2002 15:17:31 -0000	1.9
  @@ -172,6 +172,10 @@
           taskName = componentType;
       }
   
  +
  +    /** Initialise this task */
  +    public void init() {
  +    }
   
       /** Validate this component */
       public void validateComponent() {
  
  
  
  1.1                  jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/taskdefs/Ant.java
  
  Index: Ant.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.tools.ant;
  
  /**
   * Ant facade over system version of Ant
   *
   * @author <a href="mailto:conor@apache.org">Conor MacNeill</a>
   * @created 31 January 2002
   */
  public class Ant extends org.apache.ant.antlib.system.Ant {
  }
  
  
  
  
  1.1                  jakarta-ant/proposal/mutant/src/java/antlibs/ant1compat/org/apache/tools/ant/taskdefs/CallTarget.java
  
  Index: CallTarget.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.tools.ant;
  
  import org.apache.ant.antlib.system.AntCall;
  
  /**
   * CallTarget facade over AntCall
   *
   * @author <a href="mailto:conor@apache.org">Conor MacNeill</a>
   * @created 31 January 2002
   */
  public class CallTarget extends AntCall {
  }
  
  
  
  
  1.2       +5 -3      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.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- Ant1CompatBuilder.java	18 Feb 2002 12:36:05 -0000	1.1
  +++ Ant1CompatBuilder.java	4 Mar 2002 15:17:32 -0000	1.2
  @@ -1,5 +1,4 @@
   package org.apache.ant.builder;
  -
   public class Ant1CompatBuilder {
       protected void _init(BuildHelper helper) {
           helper.setProperty("src.dir", "src");
  @@ -16,10 +15,13 @@
           helper.setProperty("util.package", "${ant.package}/util");
           helper.setProperty("regexp.package", "${util.package}/regexp");
           helper.createPath("classpath");
  -        helper.addFileSetToPath("classpath", "${lib.dir}/parser", "*.jar");
  -        helper.addFileSetToPath("classpath", "${lib.dir}/ant1compat", "*.jar");
  +        helper.addFileSetToPath("classpath", 
  +                        "${lib.dir}/parser", "*.jar");
  +        helper.addFileSetToPath("classpath", 
  +                        "${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.tsk");
       }
       protected void check_for_optional_packages(BuildHelper helper) {
       }
  
  
  
  1.2       +4 -4      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.1
  retrieving revision 1.2
  diff -u -w -u -r1.1 -r1.2
  --- MutantBuilder.java	18 Feb 2002 12:36:05 -0000	1.1
  +++ MutantBuilder.java	4 Mar 2002 15:17:32 -0000	1.2
  @@ -10,7 +10,8 @@
           helper.setProperty("distlib.dir", "${dist.dir}/lib");
           helper.setProperty("debug", "true");
           helper.createPath("classpath.parser");
  -        helper.addFileSetToPath("classpath.parser", "${lib.dir}/parser", "*.jar");
  +        helper.addFileSetToPath("classpath.parser", 
  +                        "${lib.dir}/parser", "*.jar");
           helper.createPath("classpath.common");
           helper.addPathElementToPath("classpath.common", "${distlib.dir}/init.jar");
           helper.createPath("classpath.antcore");
  @@ -60,6 +61,8 @@
           helper.javac("${java.dir}/start", "${bin.dir}/start", "classpath.start");
           helper.jar("${bin.dir}/start", "${distlib.dir}/start.jar",
                      null, null);
  +        helper.jar("${bin.dir}/start", "${distlib.dir}/ant.jar",
  +                   null, null);
       }
       protected void ant1compat(BuildHelper helper) {
       }
  @@ -86,9 +89,6 @@
       protected void main(BuildHelper helper) {
       }
       protected void checkstyle(BuildHelper helper) {
  -        helper.setProperty("checkstyle.bin", "../checkstyle");
  -        helper.createPath("checkstyle.path");
  -        helper.addFileSetToPath("checkstyle.path", "${checkstyle.bin}", null);
           helper.mkdir("${bin.dir}/check");
       }
       protected void javadocs(BuildHelper helper) {
  
  
  
  1.4       +7 -0      jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/antlib/AntContext.java
  
  Index: AntContext.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/antlib/AntContext.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -w -u -r1.3 -r1.4
  --- AntContext.java	20 Feb 2002 13:43:15 -0000	1.3
  +++ AntContext.java	4 Mar 2002 15:17:32 -0000	1.4
  @@ -99,5 +99,12 @@
        * @return the location
        */
       Location getLocation();
  +    
  +    /**
  +     * Get the classloader associated with this context
  +     *
  +     * @return a classloader instance.
  +     */
  +    ClassLoader getClassLoader();
   }
   
  
  
  
  1.9       +18 -0     jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/service/ComponentService.java
  
  Index: ComponentService.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/mutant/src/java/common/org/apache/ant/common/service/ComponentService.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -w -u -r1.8 -r1.9
  --- ComponentService.java	20 Feb 2002 13:43:16 -0000	1.8
  +++ ComponentService.java	4 Mar 2002 15:17:32 -0000	1.9
  @@ -171,5 +171,23 @@
        */
       Object createComponent(String componentName) throws ExecutionException;
   
  +    /**
  +     * Create a component given its class. The component will have a context
  +     * but will not be configured. It should be configured using the
  +     * appropriate set methods and then validated before being used.
  +     *
  +     * @param componentClass the component's class
  +     * @param factory the factory to create the component
  +     * @param loader the classloader associated with the component
  +     * @param addTaskAdapter whenther the returned component should be a
  +     *      task, potentially being wrapped in an adapter
  +     * @param componentName the name of the component type
  +     * @return the created component. The return type of this method depends
  +     *      on the component type.
  +     * @exception ExecutionException if the component cannot be created
  +     */
  +    Object createComponent(AntLibFactory factory, ClassLoader loader,
  +                           Class componentClass, boolean addTaskAdapter,
  +                           String componentName) throws ExecutionException;
   }
   
  
  
  

--
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