ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant-myrmidon/tools/xsl build.xsl
Date Fri, 10 May 2002 06:27:32 GMT
adammurdoch    02/05/09 23:27:32

  Modified:    ant1compat project.xml
               antlib   project.xml
               api      project.xml
               aut      project.xml
               container project.xml
               container/src/java/org/apache/myrmidon/components/builder
                        ConvertingProjectBuilder.java
               container/src/java/org/apache/myrmidon/components/embeddor
                        DefaultEmbeddor.java
               container/src/java/org/apache/myrmidon/components/extensions
                        DefaultExtensionManager.java
               container/src/java/org/apache/myrmidon/components/library
                        DefaultLibraryManager.java
                        DefaultTypeLibraryManager.java Resources.properties
               container/src/java/org/apache/myrmidon/frontends
                        CLIMain.java Resources.properties
               container/src/java/org/apache/myrmidon/interfaces
                        EmbeddedAnt.java
               container/src/java/org/apache/myrmidon/interfaces/extensions
                        ExtensionManager.java
               container/src/test/org/apache/myrmidon/components
                        AbstractComponentTest.java
               framework project.xml
               myrmidon project.xml
               site/src/xdocs project-descriptor.xml
               tools/xsl build.xsl
  Added:       container/src/java/org/apache/myrmidon/components/extensions
                        ExtensionRepository.java
  Log:
  Unify antlibs and extensions:
  
  * Antlib file names now end with '.jar' rather than '.atl'.
  
  * Moved the core antlibs in the distribution from lib/ to lib/core.
  
  * The 'extension-name' manifest attribute is now used as the antlib name, instead
    of the antlib file name.
  
  * The core antlibs are now visible to <typelib>, and can be explicitly imported.
  
  * Antlibs can now extend other antlibs, by declaring them as a dependency.
    Currently, all antlibs are non-final.
  
  * Removed the --antlib-path command-line option.
  
  * Moved responsibility for finding the core antlibs to ExtensionManager.
  
  * Removed the <antlib> element from project descriptors.  It is replaced by <jar>.
  
  * The build adds extension info to generated manifests, if none is provided in
    the project descriptor.
  
  * Renamed some of the antlibs.
  
  Revision  Changes    Path
  1.7       +3 -4      jakarta-ant-myrmidon/ant1compat/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/ant1compat/project.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.xml	9 May 2002 07:50:05 -0000	1.6
  +++ project.xml	10 May 2002 06:27:31 -0000	1.7
  @@ -26,7 +26,7 @@
               <unjar src="lib/optional.jar" dest="${build.ant1classes}" overwrite="false"/>
           </prepare>
   
  -        <antlib>
  +        <jar>
               <id>myrmidon-ant1-compat</id>
               <includeDescriptors>false</includeDescriptors>
               <metainf dir="src/conf" includes="*.xml"/>
  @@ -40,13 +40,12 @@
                   <exclude name="**/ant/types/Path.class"/>
               </fileset>
   
  -            <extension extension-name="myrmidon.ant1.compat"
  -                       specification-version="1.0"/>
  +            <extension extension-name="ant1" specification-version="1.0"/>
               <depends>
                   <extension extension-name="com.sun.tools"
                              specification-version="1.0"/>
               </depends>
  -        </antlib>
  +        </jar>
       </build>
   
       <unitTest>
  
  
  
  1.7       +33 -33    jakarta-ant-myrmidon/antlib/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/antlib/project.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.xml	9 May 2002 07:50:05 -0000	1.6
  +++ project.xml	10 May 2002 06:27:31 -0000	1.7
  @@ -19,89 +19,89 @@
               <fileset dir="../container/build/lib" includes="*api*.jar"/>
           </classpath>
   
  -        <antlib>
  +        <jar>
               <id>archive</id>
               <patternset includes="org/apache/antlib/archive/**"/>
               <depends>
                   <extension extension-name="excalibur-bzip2"/>
               </depends>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>build</id>
               <patternset includes="org/apache/antlib/build/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>core</id>
               <patternset includes="org/apache/antlib/core/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>cvslib</id>
               <patternset includes="org/apache/antlib/cvslib/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>dotnet</id>
               <patternset includes="org/apache/antlib/dotnet/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>extensions</id>
               <patternset includes="org/apache/antlib/extensions/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>file</id>
               <patternset includes="org/apache/antlib/file/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>java</id>
               <patternset includes="org/apache/antlib/java/**"/>
               <depends>
                   <extension extension-name="com.sun.tools"
                              specification-version="1.0"/>
               </depends>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>nativelib</id>
               <patternset includes="org/apache/antlib/nativelib/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>project</id>
               <patternset includes="org/apache/antlib/project/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>runtime</id>
               <patternset includes="org/apache/antlib/runtime/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>security</id>
               <patternset includes="org/apache/antlib/security/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>selftest</id>
               <patternset includes="org/apache/antlib/selftest/**"/>
               <depends>
  -                <extension extension-name="myrmidon.test.extension"
  +                <extension extension-name="selftest.extension"
                              specification-version="1.0"
                              implementation-version="1.0.2"
                              implementation-vendor-id="org.apache.avalon"/>
                   <extension extension-name="com.sun.tools"
                              implementation-version="1.0"/>
               </depends>
  -        </antlib>
  +        </jar>
           <jar>
  -            <id>selftest-extension1</id>
  -            <extension extension-name="myrmidon.test.extension"
  +            <id>selftest-extension</id>
  +            <extension extension-name="selftest.extension"
                          specification-version="1.0"
                          implementation-version="1.0.2"
                          implementation-vendor-id="org.apache.avalon"/>
               <patternset includes="org/apache/antlib/security/**"/>
           </jar>
  -        <antlib>
  +        <jar>
               <id>vfile</id>
               <patternset includes="org/apache/antlib/vfile/**"/>
  -        </antlib>
  -        <antlib>
  +        </jar>
  +        <jar>
               <id>xml</id>
               <patternset includes="org/apache/antlib/xml/**"/>
  -        </antlib>
  +        </jar>
       </build>
   
       <unitTest>
  
  
  
  1.7       +0 -3      jakarta-ant-myrmidon/api/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/api/project.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.xml	9 May 2002 07:50:05 -0000	1.6
  +++ project.xml	10 May 2002 06:27:31 -0000	1.7
  @@ -23,9 +23,6 @@
           <!-- The jar to build -->
           <jar>
               <id>myrmidon-api</id>
  -            <extension extension-name="myrmidon.api"
  -                       specification-version="1.0"
  -                       implementation-version="1.0"/>
           </jar>
       </build>
   
  
  
  
  1.8       +0 -4      jakarta-ant-myrmidon/aut/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/aut/project.xml,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- project.xml	9 May 2002 07:50:05 -0000	1.7
  +++ project.xml	10 May 2002 06:27:31 -0000	1.8
  @@ -31,10 +31,6 @@
           <!-- The jar to build -->
           <jar>
               <id>myrmidon-aut</id>
  -            <extension
  -                extension-name="myrmidon.aut"
  -                specification-version="1.0"
  -                implementation-version="1.0"/>
           </jar>
   
           <!-- prepare tasks -->
  
  
  
  1.9       +0 -6      jakarta-ant-myrmidon/container/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/project.xml,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- project.xml	9 May 2002 07:50:05 -0000	1.8
  +++ project.xml	10 May 2002 06:27:31 -0000	1.9
  @@ -17,9 +17,6 @@
   
           <jar>
               <id>myrmidon-container</id>
  -            <extension extension-name="myrmidon.container"
  -                       specification-version="1.0"
  -                       implementation-version="1.0"/>
               <patternset>
                   <exclude name="org/apache/myrmidon/launcher/**" />
                   <exclude name="org/apache/myrmidon/interfaces/**" />
  @@ -27,9 +24,6 @@
           </jar>
           <jar>
               <id>myrmidon-container-api</id>
  -            <extension extension-name="myrmidon.container.api"
  -                       specification-version="1.0"
  -                       implementation-version="1.0"/>
               <patternset>
                   <include name="org/apache/myrmidon/interfaces/**" />
               </patternset>
  
  
  
  1.6       +3 -5      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/ConvertingProjectBuilder.java
  
  Index: ConvertingProjectBuilder.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/builder/ConvertingProjectBuilder.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ConvertingProjectBuilder.java	8 May 2002 13:40:21 -0000	1.5
  +++ ConvertingProjectBuilder.java	10 May 2002 06:27:31 -0000	1.6
  @@ -18,7 +18,7 @@
    * configuration into a Myrmidon one.
    *
    * @author <a href="mailto:darrell@apache.org">Darrell DeBoer</a>
  - * @version $Revision: 1.5 $ $Date: 2002/05/08 13:40:21 $
  + * @version $Revision: 1.6 $ $Date: 2002/05/10 06:27:31 $
    *
    * @ant.type type="project-builder" name="xml"
    * @ant.type type="project-builder" name="ant"
  @@ -48,8 +48,7 @@
               return originalConfig;
           }
   
  -        // Convert the config by prepending "ant1." on tasks,
  -        // and using <if> tasks instead of target 'if=' and 'unless='
  +        // Convert the config by using <if> tasks instead of target 'if=' and 'unless='
           final DefaultConfiguration newConfig = copyConfiguration( originalConfig );
   
           // Put a new version attribute.
  @@ -63,8 +62,7 @@
           // Add a "typelib" task for the ant1compat stuff
           DefaultConfiguration typelibDeclaration =
               new DefaultConfiguration( "typelib", originalConfig.getLocation() );
  -        typelibDeclaration.setAttribute( "library", "myrmidon-ant1-compat" );
  -        typelibDeclaration.setAttribute( "namespace", "ant1" );
  +        typelibDeclaration.setAttribute( "library", "ant1" );
           newConfig.addChild( typelibDeclaration );
   
           // Now copy/convert the children
  
  
  
  1.62      +1 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java
  
  Index: DefaultEmbeddor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/embeddor/DefaultEmbeddor.java,v
  retrieving revision 1.61
  retrieving revision 1.62
  diff -u -r1.61 -r1.62
  --- DefaultEmbeddor.java	9 May 2002 07:54:31 -0000	1.61
  +++ DefaultEmbeddor.java	10 May 2002 06:27:31 -0000	1.62
  @@ -64,7 +64,7 @@
    * Instantiate this to embed inside other applications.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.61 $ $Date: 2002/05/09 07:54:31 $
  + * @version $Revision: 1.62 $ $Date: 2002/05/10 06:27:31 $
    */
   public class DefaultEmbeddor
       extends AbstractLogEnabled
  @@ -427,7 +427,6 @@
   
           //Add runtime info
           store.setProperty( TaskContext.CONTAINER_DESCRIPTION, Constants.BUILD_DESCRIPTION );
  -        store.setProperty( "myrmidon.antlib.path", m_context.get( "myrmidon.antlib.path" ) );
   
           return store;
       }
  
  
  
  1.10      +103 -35   jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/extensions/DefaultExtensionManager.java
  
  Index: DefaultExtensionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/extensions/DefaultExtensionManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- DefaultExtensionManager.java	9 Apr 2002 07:21:12 -0000	1.9
  +++ DefaultExtensionManager.java	10 May 2002 06:27:31 -0000	1.10
  @@ -8,29 +8,35 @@
   package org.apache.myrmidon.components.extensions;
   
   import java.io.File;
  -import org.apache.avalon.excalibur.extension.DefaultPackageRepository;
  +import java.util.ArrayList;
  +import java.util.jar.JarFile;
  +import java.util.jar.Manifest;
   import org.apache.avalon.excalibur.extension.Extension;
   import org.apache.avalon.excalibur.extension.OptionalPackage;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.framework.activity.Disposable;
  +import org.apache.avalon.excalibur.io.ExtensionFileFilter;
   import org.apache.avalon.framework.activity.Initializable;
   import org.apache.avalon.framework.context.Context;
   import org.apache.avalon.framework.context.ContextException;
   import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.logger.LogEnabled;
  -import org.apache.avalon.framework.logger.Logger;
  +import org.apache.avalon.framework.logger.AbstractLogEnabled;
   import org.apache.myrmidon.interfaces.extensions.ExtensionManager;
   
   /**
  - * PhoenixPackageRepository
  + * The standard myrmidon extension manager.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.9 $ $Date: 2002/04/09 07:21:12 $
  + * @version $Revision: 1.10 $ $Date: 2002/05/10 06:27:31 $
  + *
  + * @todo Add a persistent cache for the parsed extension info.
  + * @todo Allow search directories and individual extensions to be added at
  + *       runtime (ie after initialize() has been called).
  + * @todo Add more standard search locations e.g $HOME/.antrc/ext, etc
    */
   public class DefaultExtensionManager
  -    extends DefaultPackageRepository
  -    implements LogEnabled, Contextualizable, Initializable, Disposable, ExtensionManager
  +    extends AbstractLogEnabled
  +    implements Contextualizable, Initializable, ExtensionManager
   {
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultExtensionManager.class );
  @@ -48,34 +54,35 @@
           File.separator + ".." + File.separator + "j2sdk1.3" +
           File.separator + "lib" + File.separator + "tools.jar";
   
  -    private Logger m_logger;
  -    private File[] m_path;
  -
  -    public DefaultExtensionManager()
  -    {
  -        super( new File[ 0 ] );
  -    }
  -
  -    public DefaultExtensionManager( final File[] path )
  -    {
  -        super( path );
  -    }
  -
  -    public void enableLogging( final Logger logger )
  -    {
  -        m_logger = logger;
  -    }
  +    private File[] m_extPath;
  +    private File[] m_coreExtPath;
  +    private OptionalPackage[] m_corePackages;
  +    private final ExtensionRepository m_extensions = new ExtensionRepository();
   
       public void contextualize( final Context context ) throws ContextException
       {
  -        m_path = (File[])context.get( "myrmidon.ext.path" );
  +        m_coreExtPath = (File[])context.get( "myrmidon.corelib.path" );
  +        m_extPath = (File[])context.get( "myrmidon.ext.path" );
       }
   
       public void initialize()
           throws Exception
       {
  -        setPath( m_path );
  -        scanPath();
  +        // Locate the core packages
  +        m_corePackages = scanPath( m_coreExtPath );
  +        for( int i = 0; i < m_corePackages.length; i++ )
  +        {
  +            final OptionalPackage lib = m_corePackages[ i ];
  +            m_extensions.addOptionalPackage( lib );
  +        }
  +
  +        // Locate the optional packages
  +        final OptionalPackage[] optionalLibs = scanPath( m_extPath );
  +        for( int i = 0; i < optionalLibs.length; i++ )
  +        {
  +            final OptionalPackage lib = optionalLibs[ i ];
  +            m_extensions.addOptionalPackage( lib );
  +        }
   
           // Add the JVM's tools.jar as an extension
           final Extension extension = createToolsExtension();
  @@ -83,12 +90,63 @@
           final Extension[] available = new Extension[]{extension};
           final Extension[] required = new Extension[ 0 ];
           final OptionalPackage toolsPackage = new OptionalPackage( jar, available, required );
  -        cacheOptionalPackage( toolsPackage );
  +        m_extensions.addOptionalPackage( toolsPackage );
       }
   
  -    public void dispose()
  +    /**
  +     * Locates the optional packages in a set of directories.
  +     */
  +    private OptionalPackage[] scanPath( final File[] directories )
  +        throws Exception
       {
  -        clearCache();
  +        final ExtensionFileFilter filter = new ExtensionFileFilter( ".jar" );
  +
  +        final ArrayList packages = new ArrayList();
  +        for( int i = 0; i < directories.length; i++ )
  +        {
  +            final File directory = directories[ i ].getCanonicalFile();
  +            final File[] files = directory.listFiles( filter );
  +            if( null != files )
  +            {
  +                scanFiles( files, packages );
  +            }
  +        }
  +
  +        return (OptionalPackage[])packages.toArray( new OptionalPackage[ packages.size() ] );
  +    }
  +
  +    /**
  +     * Locates the optional packages in a set of files.
  +     */
  +    private void scanFiles( final File[] files, final ArrayList packages )
  +        throws Exception
  +    {
  +        for( int i = 0; i < files.length; i++ )
  +        {
  +            final File file = files[ i ];
  +            final JarFile jarFile = new JarFile( file );
  +            try
  +            {
  +                // Skip the file if it has not manifest, or if it does not
  +                // provide any extensions
  +                final Manifest manifest = jarFile.getManifest();
  +                if( null == manifest )
  +                {
  +                    continue;
  +                }
  +                final Extension[] available = Extension.getAvailable( manifest );
  +                if( available == null || available.length == 0 )
  +                {
  +                    continue;
  +                }
  +                final Extension[] required = Extension.getRequired( manifest );
  +                packages.add( new OptionalPackage( file, available, required ) );
  +            }
  +            finally
  +            {
  +                jarFile.close();
  +            }
  +        }
       }
   
       /**
  @@ -99,20 +157,30 @@
        */
       public OptionalPackage getOptionalPackage( final Extension extension )
       {
  -        final OptionalPackage[] packages = getOptionalPackages( extension );
  +        final OptionalPackage[] packages = m_extensions.getOptionalPackages( extension );
   
  -        if( null == packages || 0 == packages.length ) return null;
  +        if( null == packages || 0 == packages.length )
  +        {
  +            return null;
  +        }
   
           //TODO: Use heurisitic to find which is best package
  +        //TODO: return all matches
   
           return packages[ 0 ];
       }
   
  -    protected void debug( final String message )
  +    /**
  +     * Locates the core optional packages.
  +     */
  +    public OptionalPackage[] getCorePackages()
       {
  -        m_logger.debug( message );
  +        return m_corePackages;
       }
   
  +    /**
  +     * Locates the tools Jar for the current JVM.
  +     */
       private File getToolsJar()
           throws Exception
       {
  
  
  
  1.1                  jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/extensions/ExtensionRepository.java
  
  Index: ExtensionRepository.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.txt file.
   */
  package org.apache.myrmidon.components.extensions;
  
  import org.apache.avalon.excalibur.extension.OptionalPackage;
  import org.apache.avalon.excalibur.extension.DefaultPackageRepository;
  import java.io.File;
  
  /**
   * A collection of extensions.  This class is a bit of a hack, to make
   * DefaultPackageRepository.cacheOptionalPackage() public.
   *
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/05/10 06:27:31 $
   */
  class ExtensionRepository
      extends DefaultPackageRepository
  {
      /**
       * Construct a package repository with path.
       */
      public ExtensionRepository()
      {
          super( new File[ 0 ] );
      }
  
      /**
       * Adds an optional package to the repository.
       * @param pkg
       */
      public void addOptionalPackage( final OptionalPackage pkg )
      {
          cacheOptionalPackage( pkg );
      }
  }
  
  
  
  1.3       +7 -7      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java
  
  Index: DefaultLibraryManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultLibraryManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultLibraryManager.java	9 May 2002 07:54:32 -0000	1.2
  +++ DefaultLibraryManager.java	10 May 2002 06:27:31 -0000	1.3
  @@ -38,7 +38,7 @@
    * The default library manager implementation.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.2 $ $Date: 2002/05/09 07:54:32 $
  + * @version $Revision: 1.3 $ $Date: 2002/05/10 06:27:31 $
    */
   public class DefaultLibraryManager
       implements Serviceable, Contextualizable, LibraryManager
  @@ -51,9 +51,9 @@
       private ClassLoader m_rootClassLoader;
   
       /**
  -     * Map from File/ArrayList to the ClassLoader for that file/files.
  +     * Map from Jar file to the Library for that file.
        */
  -    private final Map m_classLoaders = new HashMap();
  +    private final Map m_classloaderMap = new HashMap();
   
       public void contextualize( final Context context ) throws ContextException
       {
  @@ -144,7 +144,7 @@
               final OptionalPackage optionalPackage = packages[ i ];
   
               // Locate the dependencies for this jar file
  -            final OptionalPackage[] requiredPackages = getOptionalPackagesFor( optionalPackage );
  +            final OptionalPackage[] requiredPackages = getRequiredPackagesFor( optionalPackage );
   
               // Build the classloader for the package
               for( int j = 0; j < requiredPackages.length; j++ )
  @@ -171,7 +171,7 @@
           final File jarFile = pkg.getFile();
   
           // Check for cached classloader
  -        ClassLoader classLoader = (ClassLoader)m_classLoaders.get( jarFile );
  +        ClassLoader classLoader = (ClassLoader)m_classloaderMap.get( jarFile );
           if( classLoader != null )
           {
               return classLoader;
  @@ -193,7 +193,7 @@
           // Create and cache the classloader
           final URL[] urls = {jarFile.toURL()};
           classLoader = new MultiParentURLClassLoader( urls, parentClassLoaders );
  -        m_classLoaders.put( jarFile, classLoader );
  +        m_classloaderMap.put( jarFile, classLoader );
           pending.remove( jarFile );
           return classLoader;
       }
  @@ -201,7 +201,7 @@
       /**
        * Locates the optional packages required by an optional package.
        */
  -    private OptionalPackage[] getOptionalPackagesFor( final OptionalPackage pkg )
  +    private OptionalPackage[] getRequiredPackagesFor( final OptionalPackage pkg )
           throws Exception
       {
           // Locate the optional packages that provide the required extesions
  
  
  
  1.3       +24 -71    jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultTypeLibraryManager.java
  
  Index: DefaultTypeLibraryManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/DefaultTypeLibraryManager.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- DefaultTypeLibraryManager.java	9 May 2002 07:54:32 -0000	1.2
  +++ DefaultTypeLibraryManager.java	10 May 2002 06:27:31 -0000	1.3
  @@ -9,47 +9,39 @@
   
   import java.io.File;
   import java.util.ArrayList;
  -import java.util.List;
  -import org.apache.aut.nativelib.PathUtil;
  +import org.apache.avalon.excalibur.extension.Extension;
  +import org.apache.avalon.excalibur.extension.OptionalPackage;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
  -import org.apache.avalon.excalibur.io.ExtensionFileFilter;
  -import org.apache.avalon.framework.context.Context;
  -import org.apache.avalon.framework.context.ContextException;
  -import org.apache.avalon.framework.context.Contextualizable;
  -import org.apache.avalon.framework.service.Serviceable;
  -import org.apache.avalon.framework.service.ServiceManager;
   import org.apache.avalon.framework.service.ServiceException;
  +import org.apache.avalon.framework.service.ServiceManager;
  +import org.apache.avalon.framework.service.Serviceable;
  +import org.apache.myrmidon.interfaces.ComponentException;
  +import org.apache.myrmidon.interfaces.extensions.ExtensionManager;
   import org.apache.myrmidon.interfaces.library.Library;
  -import org.apache.myrmidon.interfaces.library.TypeLibraryManager;
   import org.apache.myrmidon.interfaces.library.LibraryManager;
  -import org.apache.myrmidon.interfaces.ComponentException;
  +import org.apache.myrmidon.interfaces.library.TypeLibraryManager;
   
   /**
    * The default type library manager implementation.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.2 $ $Date: 2002/05/09 07:54:32 $
  + * @version $Revision: 1.3 $ $Date: 2002/05/10 06:27:31 $
    */
   public class DefaultTypeLibraryManager
  -    implements TypeLibraryManager, Contextualizable, Serviceable
  +    implements TypeLibraryManager, Serviceable
   {
       private static final Resources REZ =
           ResourceManager.getPackageResources( DefaultTypeLibraryManager.class );
   
  -    private Context m_context;
       private LibraryManager m_libManager;
  -
  -    public void contextualize( final Context context )
  -        throws ContextException
  -    {
  -        m_context = context;
  -    }
  +    private ExtensionManager m_extensionManager;
   
       public void service( final ServiceManager serviceManager )
           throws ServiceException
       {
           m_libManager = (LibraryManager)serviceManager.lookup( LibraryManager.ROLE );
  +        m_extensionManager = (ExtensionManager)serviceManager.lookup( ExtensionManager.ROLE );
       }
   
       /**
  @@ -58,26 +50,13 @@
       public Library getTypeLibrary( final String libraryName )
           throws Exception
       {
  -        final File[] extPath;
  -
           try
           {
  -            //TODO: In future this will be expanded to allow
  -            //users to specify search path or automagically
  -            //add entries to lib path (like user specific or
  -            //workspace specific)
  -            final String name = libraryName.replace( '/', File.separatorChar ) + ".atl";
  -
  -            extPath = (File[])m_context.get( "myrmidon.antlib.path" );
  -            for( int i = 0; i < extPath.length; i++ )
  +            final Extension extension = new Extension( libraryName, null, null, null, null, null, null );
  +            final OptionalPackage pkg = m_extensionManager.getOptionalPackage( extension );
  +            if( pkg != null )
               {
  -                final File extDir = extPath[ i ];
  -                final File library = new File( extDir, name );
  -
  -                if( library.exists() )
  -                {
  -                    return buildLibrary( library );
  -                }
  +                return buildLibrary( pkg );
               }
           }
           catch( final Exception e )
  @@ -86,8 +65,8 @@
               throw new ComponentException( message, e );
           }
   
  -        final String formattedPath = PathUtil.formatPath( extPath );
  -        final String message = REZ.getString( "no-library.error", libraryName, formattedPath );
  +        // Could not find the library
  +        final String message = REZ.getString( "no-library.error", libraryName );
           throw new Exception( message );
       }
   
  @@ -96,50 +75,24 @@
        */
       public Library[] getCoreTypeLibraries() throws Exception
       {
  -        final ExtensionFileFilter filter = new ExtensionFileFilter( ".atl" );
  -        final File[] directories = (File[])m_context.get( "myrmidon.lib.path" );
  -
           final ArrayList libs = new ArrayList();
  -        for( int i = 0; i < directories.length; i++ )
  +        final OptionalPackage[] corePackages = m_extensionManager.getCorePackages();
  +        for( int i = 0; i < corePackages.length; i++ )
           {
  -            final File directory = directories[ i ];
  -            final File[] files = directory.listFiles( filter );
  -            if( null != files )
  -            {
  -                buildLibraries( files, libs );
  -            }
  +            final OptionalPackage pkg = corePackages[ i ];
  +            libs.add( buildLibrary( pkg ) );
           }
  -
           return (Library[])libs.toArray( new Library[ libs.size() ] );
       }
   
       /**
  -     * Builds library wrappers for a set of files.
  -     */
  -    private void buildLibraries( final File[] files, final List libs )
  -        throws Exception
  -    {
  -        for( int i = 0; i < files.length; i++ )
  -        {
  -            final File file = files[ i ];
  -            libs.add( buildLibrary( file ) );
  -        }
  -    }
  -
  -    /**
        * Builds a library wrapper for a file.
        */
  -    private Library buildLibrary( final File library )
  +    private Library buildLibrary( final OptionalPackage pkg )
           throws Exception
       {
  -        if( !library.canRead() )
  -        {
  -            final String message = REZ.getString( "no-read.error", library );
  -            throw new Exception( message );
  -        }
  -        final String baseName = library.getName();
  -        final String libName = baseName.substring( 0, baseName.length() - 4 );
  -        return m_libManager.createLibrary( libName, new File[] { library } );
  +        final String libName = pkg.getAvailableExtensions()[0].getExtensionName();
  +        return m_libManager.createLibrary( libName, new File[] { pkg.getFile() } );
       }
   
   }
  
  
  
  1.2       +1 -2      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/components/library/Resources.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Resources.properties	3 May 2002 06:56:11 -0000	1.1
  +++ Resources.properties	10 May 2002 06:27:31 -0000	1.2
  @@ -1,7 +1,6 @@
  -no-read.error=Could not read library "{0}".
   no-file.error=Could not find library "{0}".
   file-is-dir.error=Library "{0}" is a directory.
  -no-library.error=Could not locate Type Library "{0}" in {1}
  +no-library.error=Could not find Type Library "{0}".
   load-library.error=Could not load Type Library "{0}".
   get-classpath-for-loader.error=Could not determine the class-path for a ClassLoader.
   create-classloader-for-files.error=Could not create a ClassLoader for {0}.
  
  
  
  1.42      +2 -10     jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/CLIMain.java
  
  Index: CLIMain.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/CLIMain.java,v
  retrieving revision 1.41
  retrieving revision 1.42
  diff -u -r1.41 -r1.42
  --- CLIMain.java	19 Apr 2002 12:09:55 -0000	1.41
  +++ CLIMain.java	10 May 2002 06:27:32 -0000	1.42
  @@ -34,7 +34,7 @@
    * to run project.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.41 $ $Date: 2002/04/19 12:09:55 $
  + * @version $Revision: 1.42 $ $Date: 2002/05/10 06:27:32 $
    */
   public class CLIMain
   {
  @@ -52,7 +52,6 @@
       private static final int NO_PREFIX_OPT = 'p';
       private static final int VERSION_OPT = 1;
       private static final int LISTENER_OPT = 2;
  -    private static final int TASKLIB_DIR_OPT = 5;
       private static final int EXTLIB_DIR_OPT = 6;
       private static final int INCREMENTAL_OPT = 7;
       private static final int HOME_DIR_OPT = 8;
  @@ -65,7 +64,7 @@
       {
           HELP_OPT, QUIET_OPT, VERBOSE_OPT, FILE_OPT,
           LOG_LEVEL_OPT, BUILDER_PARAM_OPT, NO_PREFIX_OPT,
  -        VERSION_OPT, LISTENER_OPT, TASKLIB_DIR_OPT, EXTLIB_DIR_OPT,
  +        VERSION_OPT, LISTENER_OPT, EXTLIB_DIR_OPT,
           INCREMENTAL_OPT, HOME_DIR_OPT, DRY_RUN_OPT, TYPE_OPT
       };
   
  @@ -194,10 +193,6 @@
                                       VERSION_OPT,
                                       REZ.getString( "version.opt" ),
                                       INFO_OPT_INCOMPAT ),
  -            new CLOptionDescriptor( "antlib-path",
  -                                    CLOptionDescriptor.ARGUMENT_REQUIRED,
  -                                    TASKLIB_DIR_OPT,
  -                                    REZ.getString( "tasklib.opt" ) ),
               new CLOptionDescriptor( "ext-path",
                                       CLOptionDescriptor.ARGUMENT_REQUIRED,
                                       EXTLIB_DIR_OPT,
  @@ -262,9 +257,6 @@
   
                   case HOME_DIR_OPT:
                       m_embedded.setEmbeddorProperty( "myrmidon.home", option.getArgument() );
  -                    break;
  -                case TASKLIB_DIR_OPT:
  -                    m_embedded.setEmbeddorProperty( "myrmidon.antlib.path", option.getArgument() );
                       break;
                   case EXTLIB_DIR_OPT:
                       m_embedded.setEmbeddorProperty( "myrmidon.ext.path", option.getArgument() );
  
  
  
  1.11      +0 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/Resources.properties
  
  Index: Resources.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/frontends/Resources.properties,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- Resources.properties	9 Apr 2002 07:21:12 -0000	1.10
  +++ Resources.properties	10 May 2002 06:27:32 -0000	1.11
  @@ -9,7 +9,6 @@
   listener.opt=Specify the listener for log events.
   noprefix.opt=Do not prefix output with the task name.  Equivalent to --listener noprefix.
   version.opt=Display version.
  -tasklib.opt=Specify the path to use to search for antlib libraries.
   extlib.opt=Specify the path to use to search for optional packages.
   incremental.opt=Run in incremental mode.
   home.opt=Specify Ant home directory.
  
  
  
  1.5       +4 -9      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java
  
  Index: EmbeddedAnt.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/EmbeddedAnt.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- EmbeddedAnt.java	28 Apr 2002 05:04:49 -0000	1.4
  +++ EmbeddedAnt.java	10 May 2002 06:27:32 -0000	1.5
  @@ -40,7 +40,7 @@
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.4 $ $Date: 2002/04/28 05:04:49 $
  + * @version $Revision: 1.5 $ $Date: 2002/05/10 06:27:32 $
    */
   public class EmbeddedAnt
       extends AbstractLogEnabled
  @@ -265,14 +265,9 @@
           }
   
           // Build the lib path
  -        String path = (String)parameters.get( "myrmidon.lib.path" );
  -        File[] dirs = buildPath( m_homeDir, path, "lib", "lib-dir.name" );
  -        parameters.put( "myrmidon.lib.path", dirs );
  -
  -        // Build the antlib search path
  -        path = (String)parameters.get( "myrmidon.antlib.path" );
  -        dirs = buildPath( m_homeDir, path, "ext", "task-lib-dir.name" );
  -        parameters.put( "myrmidon.antlib.path", dirs );
  +        String path = (String)parameters.get( "myrmidon.corelib.path" );
  +        File[] dirs = buildPath( m_homeDir, path, "lib/core", "lib-dir.name" );
  +        parameters.put( "myrmidon.corelib.path", dirs );
   
           // Build the extension search path
           path = (String)parameters.get( "myrmidon.ext.path" );
  
  
  
  1.9       +6 -1      jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/extensions/ExtensionManager.java
  
  Index: ExtensionManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/java/org/apache/myrmidon/interfaces/extensions/ExtensionManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ExtensionManager.java	4 Apr 2002 11:35:21 -0000	1.8
  +++ ExtensionManager.java	10 May 2002 06:27:32 -0000	1.9
  @@ -14,7 +14,7 @@
    * Maintains a set of optional packages.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.8 $ $Date: 2002/04/04 11:35:21 $
  + * @version $Revision: 1.9 $ $Date: 2002/05/10 06:27:32 $
    */
   public interface ExtensionManager
   {
  @@ -28,4 +28,9 @@
        * @return the optional package, or null if not found.
        */
       OptionalPackage getOptionalPackage( Extension extension );
  +
  +    /**
  +     * Locates the core optional packages.
  +     */
  +    OptionalPackage[] getCorePackages();
   }
  
  
  
  1.33      +3 -3      jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/AbstractComponentTest.java
  
  Index: AbstractComponentTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/container/src/test/org/apache/myrmidon/components/AbstractComponentTest.java,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- AbstractComponentTest.java	9 May 2002 07:54:32 -0000	1.32
  +++ AbstractComponentTest.java	10 May 2002 06:27:32 -0000	1.33
  @@ -60,7 +60,7 @@
    * A base class for tests for the default components.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.32 $ $Date: 2002/05/09 07:54:32 $
  + * @version $Revision: 1.33 $ $Date: 2002/05/10 06:27:32 $
    */
   public abstract class AbstractComponentTest
       extends AbstractContainerTestCase
  @@ -196,8 +196,8 @@
           final Map parameters = new HashMap();
           final File homeDir = getTestDirectory( "home" );
           parameters.put( "myrmidon.home", homeDir );
  -        final File extDir = getTestDirectory( "home/ext" );
  -        parameters.put( "myrmidon.ext.path", new File[] { extDir } );
  +        parameters.put( "myrmidon.ext.path", new File[ 0 ] );
  +        parameters.put( "myrmidon.corelib.path", new File[ 0 ] );
           parameters.put( "myrmidon.shared.classloader", getClass().getClassLoader() );
           return parameters;
       }
  
  
  
  1.7       +0 -3      jakarta-ant-myrmidon/framework/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/framework/project.xml,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- project.xml	9 May 2002 07:50:05 -0000	1.6
  +++ project.xml	10 May 2002 06:27:32 -0000	1.7
  @@ -86,9 +86,6 @@
   
           <jar>
               <id>myrmidon-framework</id>
  -            <extension extension-name="myrmidon.framework"
  -                       specification-version="1.0"
  -                       implementation-version="1.0"/>
               <patternset includes="org/apache/myrmidon/framework/**"/>
           </jar>
   
  
  
  
  1.5       +10 -5     jakarta-ant-myrmidon/myrmidon/project.xml
  
  Index: project.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/myrmidon/project.xml,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- project.xml	9 May 2002 07:50:05 -0000	1.4
  +++ project.xml	10 May 2002 06:27:32 -0000	1.5
  @@ -8,15 +8,20 @@
           <!-- lib/ dir -->
           <mkdir dir="${dist.dir}/lib"/>
           <copy todir="${dist.dir}/lib">
  -            <fileset dir="../aut/build/lib" includes="*.jar, *.atl"/>
  -            <fileset dir="../api/build/lib" includes="*.jar, *.atl"/>
  +            <fileset dir="../aut/build/lib" includes="*.jar"/>
  +            <fileset dir="../api/build/lib" includes="*.jar"/>
               <fileset dir="../container/build/lib" includes="myrmidon-container-api-*.jar"/>
  -            <fileset dir="../framework/build/lib" includes="*.jar, *.atl"/>
  -            <fileset dir="../antlib/build/lib" includes="*.jar, *.atl" excludes="selftest*"/>
  +            <fileset dir="../framework/build/lib" includes="*.jar"/>
               <fileset dir="../lib" includes="*.jar"/>
               <fileset dir="../tools/xalan" includes="*.jar"/>
           </copy>
   
  +        <!-- lib/core/ dir -->
  +        <mkdir dir="${dist.dir}/lib/core"/>
  +        <copy todir="${dist.dir}/lib/core">
  +            <fileset dir="../antlib/build/lib" includes="*.jar" excludes="selftest*"/>
  +        </copy>
  +
           <!-- bin/ dir -->
           <property name="dist.bin" value="${dist.dir}/bin"/>
           <mkdir dir="${dist.bin}"/>
  @@ -41,7 +46,7 @@
           <copy todir="${dist.dir}/ext">
               <fileset dir="../antlib/build/lib" includes="selftest*"/>
               <fileset dir="../lib/ext" includes="*.jar"/>
  -            <fileset dir="../ant1compat/build/lib" includes="*.jar, *.atl"/>
  +            <fileset dir="../ant1compat/build/lib" includes="*.jar"/>
           </copy>
   
           <!-- Samples and docs -->
  
  
  
  1.3       +11 -20    jakarta-ant-myrmidon/site/src/xdocs/project-descriptor.xml
  
  Index: project-descriptor.xml
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/site/src/xdocs/project-descriptor.xml,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- project-descriptor.xml	9 May 2002 07:39:23 -0000	1.2
  +++ project-descriptor.xml	10 May 2002 06:27:32 -0000	1.3
  @@ -105,12 +105,6 @@
                   <tr><th>Element</th><th>Description</th><th>Multivalued</th></tr>
   
                   <tr>
  -                    <td><a href="#jar">antlib</a></td>
  -                    <td>Defines an antlib output file.</td>
  -                    <td>yes</td>
  -                </tr>
  -
  -                <tr>
                       <td>classpath</td>
                       <td>The classpath to use for compiling the project source.
                       This is appended to the project classpath.  This is
  @@ -206,12 +200,9 @@
           </subsection>
   
           <subsection name="Jar Definition" anchor="jar">
  -            <p>The <code>&lt;antlib&gt;</code> and <code>&lt;jar&gt;</code> elements
  -            define antlib and jar output files, respectively.  There is no
  -            difference between these elements, except the output file name.
  -            A manifest and antlib descriptors are generated for the output file.
  -            The <code>&lt;antlib&gt;</code> and <code>&lt;jar&gt;</code> elements
  -            may take the following nested elements:</p>
  +            <p>A <code>&lt;jar&gt;</code> element defines a jar file produced by
  +            the build.  A manifest and antlib descriptors are generated for the Jar.
  +            A <code>&lt;jar&gt;</code> element may take the following nested elements:</p>
   
               <table>
                   <tr><th>Element</th><th>Description</th><th>Multivalued</th></tr>
  @@ -238,40 +229,40 @@
   
                   <tr>
                       <td>fileset</td>
  -                    <td>Additional files to include in the output file.  This
  +                    <td>Additional files to include in the Jar.  This
                       is an Ant <code>&lt;fileset&gt;</code> datatype.</td>
                       <td>yes</td>
                   </tr>
   
                   <tr>
                       <td>id</td>
  -                    <td>A unique short name for the output file.  This is used
  -                    in the output file name, and the names of generated files.</td>
  +                    <td>A unique short name for the Jar.  This is used
  +                    in the file name, and the names of generated files.</td>
                       <td>no</td>
                   </tr>
   
                   <tr>
                       <td>includeDescriptors</td>
                       <td>Controls whether antlib descriptors are generated for
  -                    the output file.  Descriptors are generated by default.</td>
  +                    the Jar.  Descriptors are generated by default.</td>
                       <td>no</td>
                   </tr>
   
                   <tr>
                       <td>metainf</td>
  -                    <td>See the <code>&lt;jar&gt;</code> Ant task.</td>
  +                    <td>See the Ant <code>&lt;jar&gt;</code> task.</td>
                       <td>yes</td>
                   </tr>
   
                   <tr>
                       <td>name</td>
  -                    <td>Specifies the name of the output file.  By default, the
  -                    name is generated from the id and current version.</td>
  +                    <td>Specifies the name of the Jar.  By default, the
  +                    name is generated from the Jar Id and current project version.</td>
                       <td>no</td>
                   </tr>
                   <tr>
                       <td>patternset</td>
  -                    <td>Specifies which classes to include in the output file.
  +                    <td>Specifies which classes to include in the Jar.
                       This is an Ant <code>&lt;patternset&gt;</code>.</td>
                       <td>no</td>
                   </tr>
  
  
  
  1.13      +28 -16    jakarta-ant-myrmidon/tools/xsl/build.xsl
  
  Index: build.xsl
  ===================================================================
  RCS file: /home/cvs/jakarta-ant-myrmidon/tools/xsl/build.xsl,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- build.xsl	9 May 2002 07:46:13 -0000	1.12
  +++ build.xsl	10 May 2002 06:27:32 -0000	1.13
  @@ -91,7 +91,7 @@
               <target name="clean" description="Cleans up the project">
                   <delete file="checkstyle.cache"/>
                   <xsl:choose>
  -                    <xsl:when test="build/jar|build/antlib">
  +                    <xsl:when test="build/jar">
                           <delete includeEmptyDirs="true">
                               <fileset dir="${{build.dir}}" excludes="conf/*/manifest.mf" />
                           </delete>
  @@ -134,7 +134,7 @@
                   </condition>
   
                   <!-- taskdef the antlib descriptor task, necessary -->
  -                <xsl:if test="build/jar[not(includeDescriptors = 'false')]|build/antlib[not(includeDescriptors = 'false')]|unitTest[not(includeDescriptors='false')]" >
  +                <xsl:if test="build/jar[not(includeDescriptors = 'false')]|unitTest[not(includeDescriptors='false')]" >
                       <taskdef name="antlib-descriptor"
                           classname="org.apache.myrmidon.build.AntlibDescriptorTask">
                           <classpath>
  @@ -249,7 +249,7 @@
   
                               <classpath>
                                   <path location="${{test.classes}}"/>
  -                                <fileset dir="${{build.lib}}" includes="*.jar, *.atl"/>
  +                                <fileset dir="${{build.lib}}" includes="*.jar"/>
                                   <path refid="test.class.path"/>
                                   <fileset dir="../tools/xalan" includes="*.jar"/>
                               </classpath>
  @@ -292,7 +292,7 @@
               <!-- Generate the depends list for "jars".
                    This is a list of dependent targets, one for each antlib -->
               <xsl:variable name="jars-depends">
  -                <xsl:for-each select="build/jar|build/antlib">
  +                <xsl:for-each select="build/jar">
                       <xsl:text>, jar-</xsl:text>
                       <xsl:value-of select="id"/>
                   </xsl:for-each>
  @@ -301,7 +301,7 @@
               <target name="jars" depends="jars-prepare{$jars-depends}" description="Builds the project jar files"/>
   
               <!-- Generate the dependent targets for "jars", one for each antlib -->
  -            <xsl:apply-templates select="build/jar|build/antlib"/>
  +            <xsl:apply-templates select="build/jar"/>
   
               <target name="javadocs" description="Generates the javadocs">
                   <xsl:if test="build/sourceDirectory">
  @@ -335,7 +335,7 @@
                   <mkdir dir="${{dist.dir}}"/>
   
                   <copy todir="${{dist.dir}}">
  -                    <fileset dir="${{build.lib}}" includes="*.jar, *.atl"/>
  +                    <fileset dir="${{build.lib}}" includes="*.jar"/>
                       <fileset dir=".." includes="LICENSE.txt, KEYS, WARNING.txt"/>
                       <fileset dir="." includes="README.txt"/>
                   </copy>
  @@ -384,21 +384,39 @@
           </project>
       </xsl:template>
   
  -    <xsl:template match="jar|antlib">
  +    <xsl:template match="jar">
           <!-- Generate the manifest -->
           <redirect:write file="build/conf/{id}/manifest.mf">
               <xsl:text>Manifest-Version: 1.0
   Created-By: Apache Ant Project
   </xsl:text>
  -            <xsl:apply-templates select="extension">
  -                <xsl:with-param name="prefix"></xsl:with-param>
  -            </xsl:apply-templates>
  +            <xsl:choose>
  +                <xsl:when test="extension">
  +                    <!-- Use supplied extension info -->
  +                    <xsl:apply-templates select="extension">
  +                        <xsl:with-param name="prefix"></xsl:with-param>
  +                    </xsl:apply-templates>
  +                </xsl:when>
  +                <xsl:otherwise>
  +                    <!-- Add some basic extension info -->
  +                    <xsl:text>Extension-Name: </xsl:text><xsl:value-of select="id"/><xsl:text>
  +</xsl:text>
  +                    <xsl:text>Specification-Version: </xsl:text><xsl:value-of select="/project/currentVersion"/><xsl:text>
  +</xsl:text>
  +                    <xsl:text>Implementation-Version: </xsl:text><xsl:value-of select="/project/currentVersion"/><xsl:text>
  +</xsl:text>
  +                </xsl:otherwise>
  +            </xsl:choose>
  +
  +            <!-- Add dependencies -->
               <xsl:for-each select="depends/extension[1]">Extension-List:</xsl:for-each>
               <xsl:for-each select="depends/extension"> ext<xsl:value-of select="position()"/></xsl:for-each>
               <xsl:for-each select="depends/extension[last()]"><xsl:text>
   </xsl:text>
               </xsl:for-each>
               <xsl:apply-templates select="depends/extension" />
  +
  +            <!-- Add attributes -->
               <xsl:for-each select="attribute"><xsl:value-of select="@name"/>: <xsl:value-of select="@value"/></xsl:for-each>
           </redirect:write>
   
  @@ -437,12 +455,6 @@
                   <xsl:choose>
                       <xsl:when test="name">
                           <xsl:value-of select="name"/>
  -                    </xsl:when>
  -                    <xsl:when test="self::antlib">
  -                        <!-- Don't include version info in antlib name, since
  -                             name is currently used to locate the antlib when
  -                             importing. -->
  -                        <xsl:value-of select="concat(id, '.atl')"/>
                       </xsl:when>
                       <xsl:otherwise>
                           <xsl:value-of select="concat(id, '-', '${version}', '.jar')"/>
  
  
  

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