ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@locus.apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/manifest taskdefs.xml
Date Tue, 12 Dec 2000 11:51:12 GMT
donaldp     00/12/12 03:51:12

  Modified:    proposal/myrmidon/src/java/org/apache/ant/tasklet/engine
                        DefaultTskDeployer.java
               proposal/myrmidon/src/make sample.xmk
               proposal/myrmidon/src/manifest taskdefs.xml
  Added:       proposal/myrmidon/src/java/org/apache/ant/tasks/core
                        RegisterDataType.java
  Log:
  Added register-datatype task
  
  Revision  Changes    Path
  1.4       +21 -0     jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/DefaultTskDeployer.java
  
  Index: DefaultTskDeployer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/DefaultTskDeployer.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- DefaultTskDeployer.java	2000/12/12 11:43:36	1.3
  +++ DefaultTskDeployer.java	2000/12/12 11:51:10	1.4
  @@ -151,6 +151,27 @@
       public void deployDataType( final String name, final String location, final URL url
)
           throws DeploymentException
       {
  +        checkDeployment( location, url );
  +        final ZipFile zipFile = getZipFileFor( url );
  +        final Configuration datatypedefs = loadConfiguration( zipFile, TSKDEF_FILE );
  +        
  +        try
  +        {
  +            final Iterator datatypes = datatypedefs.getChildren( "datatype" );
  +            while( datatypes.hasNext() )
  +            {
  +                final Configuration datatype = (Configuration)datatypes.next();
  +                if( datatype.getAttribute( "name" ).equals( name ) )
  +                {
  +                    handleDataType( datatype, url );
  +                    break;
  +                }
  +            }
  +        }
  +        catch( final ConfigurationException ce )
  +        {
  +            throw new DeploymentException( "Malformed taskdefs.xml", ce );
  +        }
       }
       
       public void deployTasklet( final String name, final String location, final URL url
)
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/RegisterDataType.java
  
  Index: RegisterDataType.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.ant.tasks.core;
  
  import java.net.URL;
  import org.apache.ant.AntException;
  import org.apache.avalon.camelot.DefaultLocator;
  import org.apache.avalon.camelot.DeploymentException;
  import org.apache.avalon.camelot.RegistryException;
  
  /**
   * Method to register a single datatype.
   *
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  public class RegisterDataType
      extends AbstractResourceRegisterer
  {
      protected void registerResource( final String name, 
                                       final String classname, 
                                       final URL url )
          throws AntException, RegistryException 
      {
          if( null == classname )
          {
              try { m_engine.getTskDeployer().deployDataType( name, url.toString(), url );
}
              catch( final DeploymentException de )
              {
                  throw new AntException( "Failed deploying " + name + " from " + url, de
);
              }
          }
          else
          {
              final DefaultLocator locator = new DefaultLocator( classname, url );
              m_engine.getDataTypeEngine().getRegistry().register( name, locator ); 
          }
      }
  }
  
  
  
  1.5       +10 -0     jakarta-ant/proposal/myrmidon/src/make/sample.xmk
  
  Index: sample.xmk
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/make/sample.xmk,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- sample.xmk	2000/12/12 11:43:44	1.4
  +++ sample.xmk	2000/12/12 11:51:11	1.5
  @@ -84,6 +84,16 @@
   
       <echo message="foo=${foo}" />
   
  +    <register-datatype lib="../../dist/lib/core.tsk" 
  +                       name="pattern2"
  +                       classname="org.apache.ant.datatypes.Pattern" />
  +
  +    <property name="foo2">
  +      <pattern name="*.java"/>
  +    </property>
  +
  +    <echo message="foo2=${foo2}" />
  +
     </target>
   
     <target name="property-test2">
  
  
  
  1.3       +1 -0      jakarta-ant/proposal/myrmidon/src/manifest/taskdefs.xml
  
  Index: taskdefs.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/manifest/taskdefs.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- taskdefs.xml	2000/12/12 11:43:45	1.2
  +++ taskdefs.xml	2000/12/12 11:51:11	1.3
  @@ -8,6 +8,7 @@
     <task name="register-tasklet" classname="org.apache.ant.tasks.core.RegisterTasklet"
/>
     <task name="register-converter" classname="org.apache.ant.tasks.core.RegisterConverter"
/>
     <task name="ant-call" classname="org.apache.ant.tasks.core.AntCall" />
  +  <task name="register-datatype" classname="org.apache.ant.tasks.core.RegisterDataType"
/>
   
     <datatype name="pattern" classname="org.apache.ant.datatypes.Pattern" />
   
  
  
  

Mime
View raw message