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/proposal/myrmidon/src/todo/org/apache/tools/todo/types Commandline.java PathUtil.java
Date Sun, 07 Apr 2002 09:51:11 GMT
adammurdoch    02/04/07 01:51:10

  Modified:    proposal/myrmidon/src/java/org/apache/antlib/core
                        AbstractAvailableCondition.java
               proposal/myrmidon/src/java/org/apache/antlib/java
                        JavacAdaptor.java JikesAdaptor.java
               proposal/myrmidon/src/java/org/apache/antlib/xml
                        XMLValidateTask.java
               proposal/myrmidon/src/java/org/apache/myrmidon/components/classloader
                        DefaultClassLoaderManager.java
               proposal/myrmidon/src/java/org/apache/myrmidon/framework/file
                        FileListToStringConverter.java
               proposal/myrmidon/src/java/org/apache/myrmidon/framework/java
                        ExecuteJava.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs
                        IContract.java Javah.java Property.java
                        SQLExec.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac
                        DefaultCompilerAdapter.java Gcj.java
                        JavacExternal.java Jikes.java Jvc.java Kjc.java
                        Sj.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc
                        JJTree.java JavaCC.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc
                        Javadoc.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp
                        WLJspc.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/compilers
                        DefaultCompilerAdapter.java JasperC.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit
                        JUnitTask.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata
                        MAudit.java MMetrics.java MParse.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/perforce
                        P4Base.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/pvcs
                        Pvcs.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic
                        DefaultRmicAdapter.java Rmic.java WLRmic.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka
                        Coverage.java
               proposal/myrmidon/src/todo/org/apache/tools/todo/types
                        Commandline.java
  Added:       proposal/myrmidon/src/java/org/apache/aut/nativelib
                        PathUtil.java
               proposal/myrmidon/src/java/org/apache/myrmidon/framework/file
                        FileListUtil.java
  Removed:     proposal/myrmidon/src/todo/org/apache/tools/todo/types
                        PathUtil.java
  Log:
  * Split up todo.types.PathUtil.
    - Moved generic formatting to aut.nativelib.PathUtil.
    - Moved FileList util methods to framework.file.FileListUtil.
    - Moved addExtDirs() to DefaultCompilerAdaptor.
    - myrmidon.components.* no longer depend on todo.*
  
  * Removed all usages of Commandline.toString(), size() and getCommandline(),
    excluding Execute.
  
  Revision  Changes    Path
  1.6       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/AbstractAvailableCondition.java
  
  Index: AbstractAvailableCondition.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/AbstractAvailableCondition.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- AbstractAvailableCondition.java	27 Mar 2002 07:04:16 -0000	1.5
  +++ AbstractAvailableCondition.java	7 Apr 2002 09:51:08 -0000	1.6
  @@ -11,14 +11,14 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.conditions.Condition;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * An abstract condition which checks for the availability of a particular
    * resource in a classpath.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.5 $ $Date: 2002/03/27 07:04:16 $
  + * @version $Revision: 1.6 $ $Date: 2002/04/07 09:51:08 $
    */
   public abstract class AbstractAvailableCondition
       implements Condition
  @@ -46,6 +46,6 @@
        */
       protected ClassLoader buildClassLoader( final TaskContext context ) throws TaskException
       {
  -        return PathUtil.createClassLoader( m_classpath, context );
  +        return FileListUtil.createClassLoader( m_classpath, context );
       }
   }
  
  
  
  1.2       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/java/JavacAdaptor.java
  
  Index: JavacAdaptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/java/JavacAdaptor.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavacAdaptor.java	26 Mar 2002 02:19:53 -0000	1.1
  +++ JavacAdaptor.java	7 Apr 2002 09:51:09 -0000	1.2
  @@ -9,8 +9,8 @@
   
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.file.Path;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.tools.todo.types.Commandline;
  -import org.apache.tools.todo.types.PathUtil;
   import java.io.File;
   import java.lang.reflect.Method;
   
  @@ -18,7 +18,7 @@
    * An adaptor for the in-process Javac compiler.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.1 $ $Date: 2002/03/26 02:19:53 $
  + * @version $Revision: 1.2 $ $Date: 2002/04/07 09:51:09 $
    *
    * @ant.type type="java-compiler" name="javac"
    */
  @@ -84,7 +84,7 @@
           classpath.add( getClassPath() );
   
           cmd.addArgument( "-classpath" );
  -        cmd.addArgument( PathUtil.formatPath( classpath, getContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( classpath, getContext() ) );
   
           if( isDeprecation() )
           {
  
  
  
  1.3       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/java/JikesAdaptor.java
  
  Index: JikesAdaptor.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/java/JikesAdaptor.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JikesAdaptor.java	28 Mar 2002 06:29:31 -0000	1.2
  +++ JikesAdaptor.java	7 Apr 2002 09:51:09 -0000	1.3
  @@ -12,8 +12,8 @@
   import org.apache.myrmidon.framework.Execute;
   import org.apache.myrmidon.framework.java.JavaRuntimeClassPath;
   import org.apache.myrmidon.framework.file.Path;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.tools.todo.types.Commandline;
  -import org.apache.tools.todo.types.PathUtil;
   
   /**
    * An adaptor for the jikes compiler.
  @@ -25,7 +25,7 @@
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
    * @author skanthak@muehlheim.de
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.2 $ $Date: 2002/03/28 06:29:31 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/07 09:51:09 $
    *
    * @ant.type type="java-compiler" name="jikes"
    */
  @@ -74,7 +74,7 @@
           cmd.addArgument( getDestDir() );
   
           cmd.addArgument( "-classpath" );
  -        cmd.addArgument( PathUtil.formatPath( classpath, getContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( classpath, getContext() ) );
   
           // TODO - make this configurable
           cmd.addArgument( "+E" );
  
  
  
  1.27      +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java
  
  Index: XMLValidateTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- XMLValidateTask.java	27 Mar 2002 07:04:16 -0000	1.26
  +++ XMLValidateTask.java	7 Apr 2002 09:51:09 -0000	1.27
  @@ -16,9 +16,9 @@
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.file.Path;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.tools.todo.types.DirectoryScanner;
   import org.apache.tools.todo.types.FileSet;
  -import org.apache.tools.todo.types.PathUtil;
   import org.apache.tools.todo.types.ScannerUtil;
   import org.xml.sax.EntityResolver;
   import org.xml.sax.InputSource;
  @@ -311,7 +311,7 @@
           {
               // load the parser class
               // with JAXP, we would use a SAXParser factory
  -            final ClassLoader classLoader = PathUtil.createClassLoader( m_classpath, getContext() );
  +            final ClassLoader classLoader = FileListUtil.createClassLoader( m_classpath, getContext() );
               final Class readerClass = classLoader.loadClass( m_readerClassName );
   
               // then check it implements XMLReader
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/aut/nativelib/PathUtil.java
  
  Index: PathUtil.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.aut.nativelib;
  
  import java.io.File;
  
  /**
   * Utility methods for dealing with native paths.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/04/07 09:51:09 $
   */
  public class PathUtil
  {
      /**
       * Formats a path into its native representation.
       */
      public static String formatPath( final String[] path )
      {
          // empty path return empty string
          if( path == null || path.length == 0 )
          {
              return "";
          }
  
          // path containing one or more elements
          final StringBuffer result = new StringBuffer( path[ 0 ].toString() );
          for( int i = 1; i < path.length; i++ )
          {
              result.append( File.pathSeparatorChar );
              result.append( path[ i ] );
          }
  
          return result.toString();
      }
  
      /**
       * Formats a path into its native representation.
       */
      public static String formatPath( final File[] path )
      {
          // empty path return empty string
          if( path == null || path.length == 0 )
          {
              return "";
          }
  
          // path containing one or more elements
          final StringBuffer result = new StringBuffer( path[ 0 ].toString() );
          for( int i = 1; i < path.length; i++ )
          {
              result.append( File.pathSeparatorChar );
              result.append( path[ i ].getAbsolutePath() );
          }
  
          return result.toString();
      }
  }
  
  
  
  1.6       +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/classloader/DefaultClassLoaderManager.java
  
  Index: DefaultClassLoaderManager.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/components/classloader/DefaultClassLoaderManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- DefaultClassLoaderManager.java	3 Apr 2002 10:58:19 -0000	1.5
  +++ DefaultClassLoaderManager.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -30,13 +30,13 @@
   import org.apache.myrmidon.interfaces.classloader.ClassLoaderManager;
   import org.apache.myrmidon.interfaces.deployer.DeploymentException;
   import org.apache.myrmidon.interfaces.extensions.ExtensionManager;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.aut.nativelib.PathUtil;
   
   /**
    * A default implementation of a ClassLoader manager.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.5 $ $Date: 2002/04/03 10:58:19 $
  + * @version $Revision: 1.6 $ $Date: 2002/04/07 09:51:09 $
    */
   public class DefaultClassLoaderManager
       extends AbstractLogEnabled
  
  
  
  1.3       +2 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/file/FileListToStringConverter.java
  
  Index: FileListToStringConverter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/file/FileListToStringConverter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- FileListToStringConverter.java	23 Mar 2002 04:01:26 -0000	1.2
  +++ FileListToStringConverter.java	7 Apr 2002 09:51:09 -0000	1.3
  @@ -9,16 +9,16 @@
   
   import org.apache.aut.converter.AbstractConverter;
   import org.apache.aut.converter.ConverterException;
  +import org.apache.aut.nativelib.PathUtil;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.file.FileList;
  -import org.apache.tools.todo.types.PathUtil;
   
   /**
    * Converters from FileList to String.
    *
    * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
  - * @version $Revision: 1.2 $ $Date: 2002/03/23 04:01:26 $
  + * @version $Revision: 1.3 $ $Date: 2002/04/07 09:51:09 $
    *
    * @ant.converter source="org.apache.myrmidon.framework.file.FileList" destination="java.lang.String"
    */
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/file/FileListUtil.java
  
  Index: FileListUtil.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.framework.file;
  
  import org.apache.myrmidon.api.TaskContext;
  import org.apache.myrmidon.api.TaskException;
  import org.apache.myrmidon.interfaces.classloader.ClassLoaderManager;
  import org.apache.myrmidon.interfaces.classloader.ClassLoaderException;
  import org.apache.aut.nativelib.PathUtil;
  import java.io.File;
  import java.io.IOException;
  import java.net.URL;
  
  /**
   * Utility methods for dealing with {@link FileList} objects.
   *
   * @author <a href="mailto:peter@apache.org">Peter Donald</a>
   * @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
   * @version $Revision: 1.1 $ $Date: 2002/04/07 09:51:09 $
   */
  public final class FileListUtil
  {
      private FileListUtil()
      {
      }
  
      /**
       * Formats a path into its native representation.
       */
      public static String formatPath( final FileList path, final TaskContext context )
          throws TaskException
      {
          final String[] list = path.listFiles( context );
          return PathUtil.formatPath( list );
      }
  
      /**
       * Converts a path into an array of Files.
       */
      public static File[] toFiles( final FileList path, final TaskContext context )
          throws TaskException
      {
          final String[] list = path.listFiles( context );
          final File[] result = new File[ list.length ];
          for( int i = 0; i < list.length; i++ )
          {
              result[ i ] = new File( list[ i ] );
          }
          return result;
      }
  
      /**
       * Converts a path into an array of URLs - useful for building a ClassLoader.
       */
      public static URL[] toURLs( final FileList path, final TaskContext context )
          throws TaskException
      {
          try
          {
              final String[] list = path.listFiles( context );
  
              final URL[] result = new URL[ list.length ];
  
              // path containing one or more elements
              for( int i = 0; i < list.length; i++ )
              {
                  result[ i ] = new File( list[ i ] ).toURL();
              }
  
              return result;
          }
          catch( final IOException ioe )
          {
              throw new TaskException( "Malformed path entry.", ioe );
          }
      }
  
      /**
       * Creates a ClassLoader from a class-path.
       */
      public static ClassLoader createClassLoader( final FileList classpath,
                                                   final TaskContext context )
          throws TaskException
      {
          final File[] files = toFiles( classpath, context );
          final ClassLoaderManager manager = (ClassLoaderManager)context.getService( ClassLoaderManager.class );
          try
          {
              return manager.createClassLoader( files );
          }
          catch( final ClassLoaderException e )
          {
              throw new TaskException( e.getMessage(), e );
          }
      }
  
  }
  
  
  
  1.6       +4 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/java/ExecuteJava.java
  
  Index: ExecuteJava.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/java/ExecuteJava.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ExecuteJava.java	4 Apr 2002 11:35:46 -0000	1.5
  +++ ExecuteJava.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -11,15 +11,16 @@
   import java.lang.reflect.InvocationTargetException;
   import java.lang.reflect.Method;
   import org.apache.aut.nativelib.Os;
  +import org.apache.aut.nativelib.PathUtil;
   import org.apache.avalon.excalibur.i18n.ResourceManager;
   import org.apache.avalon.excalibur.i18n.Resources;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.myrmidon.framework.file.Path;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.tools.todo.types.Commandline;
   import org.apache.tools.todo.types.EnvironmentData;
  -import org.apache.tools.todo.types.PathUtil;
   import org.apache.tools.todo.types.SysProperties;
   import org.apache.tools.todo.util.FileUtils;
   
  @@ -197,7 +198,7 @@
               final String message = REZ.getString( "executejava.jar-no-fork.error" );
               throw new TaskException( message );
           }
  -        if( m_vmArgs.size() > 0 )
  +        if( m_vmArgs.getArguments().length > 0 )
           {
               final String message = REZ.getString( "executejava.ignore-jvm-args.notice" );
               context.warn( message );
  @@ -234,7 +235,7 @@
           Class target;
           try
           {
  -            final ClassLoader classLoader = PathUtil.createClassLoader( m_classPath, context );
  +            final ClassLoader classLoader = FileListUtil.createClassLoader( m_classPath, context );
               target = classLoader.loadClass( m_className );
           }
           catch( final Exception e )
  
  
  
  1.8       +2 -2      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java
  
  Index: IContract.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- IContract.java	22 Mar 2002 04:12:36 -0000	1.7
  +++ IContract.java	7 Apr 2002 09:51:09 -0000	1.8
  @@ -21,7 +21,7 @@
   import org.apache.tools.todo.taskdefs.javac.Javac;
   import org.apache.tools.todo.types.DirectoryScanner;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.antlib.java.JavaTask;
   
   /**
  @@ -774,7 +774,7 @@
                   }
                   iControlProps.setProperty( "sourceRoot", srcDir.getAbsolutePath() );
                   iControlProps.setProperty( "classRoot", classDir.getAbsolutePath() );
  -                final String classpath = PathUtil.formatPath( afterInstrumentationClasspath, getContext() );
  +                final String classpath = FileListUtil.formatPath( afterInstrumentationClasspath, getContext() );
                   iControlProps.setProperty( "classpath", classpath );
                   iControlProps.setProperty( "controlFile", controlFile.getAbsolutePath() );
                   iControlProps.setProperty( "targetsFile", targets.getAbsolutePath() );
  
  
  
  1.6       +8 -5      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Javah.java
  
  Index: Javah.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Javah.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Javah.java	22 Mar 2002 04:12:36 -0000	1.5
  +++ Javah.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -15,8 +15,9 @@
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.todo.types.Commandline;
  +import org.apache.tools.todo.util.FileUtils;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * Task to generate JNI header files using javah. This task can take the
  @@ -207,10 +208,12 @@
        * &qout;niceSourceList&quot;
        */
       private void logAndAddFilesToCompile( final Commandline cmd )
  +        throws TaskException
       {
  -        int n = 0;
  -        getContext().debug( "Compilation args: " + cmd.toString() );
  +        final String[] args = cmd.getArguments();
  +        getContext().debug( "Compilation args: " + FileUtils.formatCommandLine( args ) );
   
  +        int n = 0;
           StringBuffer niceClassList = new StringBuffer();
           if( m_cls != null )
           {
  @@ -268,7 +271,7 @@
           if( m_classpath != null )
           {
               cmd.addArgument( "-classpath" );
  -            cmd.addArgument( PathUtil.formatPath( m_classpath, getContext() ) );
  +            cmd.addArgument( FileListUtil.formatPath( m_classpath, getContext() ) );
           }
   
           if( m_verbose )
  @@ -296,7 +299,7 @@
           if( m_bootclasspath != null )
           {
               cmd.addArgument( "-bootclasspath" );
  -            cmd.addArgument( PathUtil.formatPath( m_bootclasspath, getContext() ) );
  +            cmd.addArgument( FileListUtil.formatPath( m_bootclasspath, getContext() ) );
           }
   
           logAndAddFilesToCompile( cmd );
  
  
  
  1.6       +2 -2      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Property.java
  
  Index: Property.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Property.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Property.java	27 Mar 2002 07:04:17 -0000	1.5
  +++ Property.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -15,7 +15,7 @@
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * Will set a Project property. Used to be a hack in ProjectHelper Will not
  @@ -120,7 +120,7 @@
           getContext().debug( "Resource Loading " + name );
           try
           {
  -            final ClassLoader classLoader = PathUtil.createClassLoader( m_classpath, getContext() );
  +            final ClassLoader classLoader = FileListUtil.createClassLoader( m_classpath, getContext() );
               final InputStream is = classLoader.getResourceAsStream( name );
   
               if( is != null )
  
  
  
  1.6       +2 -2      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/SQLExec.java
  
  Index: SQLExec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/SQLExec.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- SQLExec.java	27 Mar 2002 07:04:17 -0000	1.5
  +++ SQLExec.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -33,10 +33,10 @@
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.file.Path;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.tools.todo.types.DirectoryScanner;
   import org.apache.tools.todo.types.EnumeratedAttribute;
   import org.apache.tools.todo.types.FileSet;
  -import org.apache.tools.todo.types.PathUtil;
   import org.apache.tools.todo.types.ScannerUtil;
   
   /**
  @@ -417,7 +417,7 @@
           // Load the driver using the
           try
           {
  -            final ClassLoader classLoader = PathUtil.createClassLoader( classpath, getContext() );
  +            final ClassLoader classLoader = FileListUtil.createClassLoader( classpath, getContext() );
               final Class dc = classLoader.loadClass( driver );
               driverInstance = (Driver)dc.newInstance();
           }
  
  
  
  1.8       +71 -36    jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DefaultCompilerAdapter.java	22 Mar 2002 04:12:36 -0000	1.7
  +++ DefaultCompilerAdapter.java	7 Apr 2002 09:51:09 -0000	1.8
  @@ -18,7 +18,10 @@
   import org.apache.myrmidon.framework.Execute;
   import org.apache.tools.todo.types.Commandline;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
  +import org.apache.tools.todo.types.FileSet;
  +import org.apache.tools.todo.util.FileUtils;
  +import org.apache.aut.nativelib.PathUtil;
   
   /**
    * This is the default implementation for the CompilerAdapter interface.
  @@ -114,7 +117,8 @@
       {
           Commandline cmd = new Commandline();
           setupJavacCommandlineSwitches( cmd, debugLevelCheck );
  -        logAndAddFilesToCompile( cmd );
  +        logFilesToCompile( cmd );
  +        addFilesToCompile( cmd );
           return cmd;
       }
   
  @@ -176,10 +180,10 @@
           }
   
           cmd.addArgument( "-classpath" );
  -        cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( classpath, getTaskContext() ) );
   
           cmd.addArgument( "-sourcepath" );
  -        cmd.addArgument( PathUtil.formatPath( src, getTaskContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( src, getTaskContext() ) );
   
           if( target != null )
           {
  @@ -197,7 +201,7 @@
           if( m_extdirs != null )
           {
               cmd.addArgument( "-extdirs" );
  -            cmd.addArgument( PathUtil.formatPath( m_extdirs, getTaskContext() ) );
  +            cmd.addArgument( FileListUtil.formatPath( m_extdirs, getTaskContext() ) );
           }
   
           if( m_encoding != null )
  @@ -255,7 +259,8 @@
           Commandline cmd = new Commandline();
           setupModernJavacCommandlineSwitches( cmd );
   
  -        logAndAddFilesToCompile( cmd );
  +        logFilesToCompile( cmd );
  +        addFilesToCompile( cmd );
           return cmd;
       }
   
  @@ -312,14 +317,14 @@
       /**
        * Do the compile with the specified arguments.
        *
  -     * @param args - arguments to pass to process on command line
  -     * @param firstFileName - index of the first source file in args
  -     * @return Description of the Returned Value
  +     * @param cmd - the command line, to which the names of the files to
  +     *        compile are added.
        */
  -    protected int executeExternalCompile( String[] args, int firstFileName )
  +    protected boolean executeExternalCompile( final Commandline cmd )
           throws TaskException
       {
  -        String[] commandArray = null;
  +        logFilesToCompile( cmd );
  +
           File tmpFile = null;
   
           try
  @@ -329,43 +334,38 @@
                * long command lines - no, not only Windows ;-).
                *
                * POSIX seems to define a lower limit of 4k, so use a temporary
  -             * file if the total length of the command line exceeds this limit.
  +             * file.
                */
  -            if( StringUtil.join( args, " " ).length() > 4096 )
  +            try
               {
  -                PrintWriter out = null;
  +                tmpFile = File.createTempFile( "javac", "", new File( "." ) );
  +                final FileWriter fout = new FileWriter( tmpFile );
                   try
                   {
  -                    tmpFile = File.createTempFile( "jikes", "", new File( "." ) );
  -                    out = new PrintWriter( new FileWriter( tmpFile ) );
  -                    for( int i = firstFileName; i < args.length; i++ )
  +                    final PrintWriter out = new PrintWriter( fout );
  +                    for( int i = 0; i < m_compileList.length; i++ )
                       {
  -                        out.println( args[ i ] );
  +                        File file = m_compileList[i ];
  +                        out.println( file.getAbsolutePath() );
                       }
  -                    out.flush();
  -                    commandArray = new String[ firstFileName + 1 ];
  -                    System.arraycopy( args, 0, commandArray, 0, firstFileName );
  -                    commandArray[ firstFileName ] = "@" + tmpFile.getAbsolutePath();
  -                }
  -                catch( final IOException ioe )
  -                {
  -                    throw new TaskException( "Error creating temporary file", ioe );
  +                    out.close();
                   }
                   finally
                   {
  -                    IOUtil.shutdownWriter( out );
  +                    IOUtil.shutdownWriter( fout );
                   }
               }
  -            else
  +            catch( final IOException ioe )
               {
  -                commandArray = args;
  +                throw new TaskException( "Error creating temporary file", ioe );
               }
   
  +            cmd.addArgument( "@" + tmpFile.getAbsolutePath() );
  +
               final Execute exe = new Execute();
               exe.setIgnoreReturnCode( true );
  -            final String[] commandline = commandArray;
  -            exe.setCommandline( new Commandline( commandline ) );
  -            return exe.execute( getTaskContext() );
  +            exe.setCommandline( cmd );
  +            return exe.execute( getTaskContext() ) == 0;
           }
           finally
           {
  @@ -382,9 +382,11 @@
        *
        * @param cmd Description of Parameter
        */
  -    protected void logAndAddFilesToCompile( Commandline cmd )
  +    protected void logFilesToCompile( final Commandline cmd )
  +        throws TaskException
       {
  -        getTaskContext().debug( "Compilation args: " + cmd.toString() );
  +        final String[] cmdline = cmd.getArguments();
  +        getTaskContext().debug( "Compilation args: " + FileUtils.formatCommandLine( cmdline ) );
   
           StringBuffer niceSourceList = new StringBuffer( "File" );
           if( m_compileList.length != 1 )
  @@ -398,7 +400,6 @@
           for( int i = 0; i < m_compileList.length; i++ )
           {
               String arg = m_compileList[ i ].getAbsolutePath();
  -            cmd.addArgument( arg );
               niceSourceList.append( "    " + arg + StringUtil.LINE_SEPARATOR );
           }
   
  @@ -406,6 +407,18 @@
       }
   
       /**
  +     * Adds the files to compile to a command-line
  +     */
  +    protected void addFilesToCompile( final Commandline cmd )
  +    {
  +        for( int i = 0; i < m_compileList.length; i++ )
  +        {
  +            File file = m_compileList[i ];
  +            cmd.addArgument( file );
  +        }
  +    }
  +
  +    /**
        * Emulation of extdirs feature in java >= 1.2. This method adds all files
        * in the given directories (but not in sub-directories!) to the classpath,
        * so that you don't have to specify them all one by one.
  @@ -426,7 +439,29 @@
               }
           }
   
  -        PathUtil.addExtdirs( path, m_extdirs, getTaskContext() );
  +        addExtdirs( path, m_extdirs, getTaskContext() );
  +    }
  +
  +    /**
  +     * Adds the contents of a set of directories to a path.
  +     */
  +    public static void addExtdirs( final Path toPath,
  +                                   final Path extDirs,
  +                                   final TaskContext context )
  +        throws TaskException
  +    {
  +        final String[] dirs = extDirs.listFiles( context );
  +        for( int i = 0; i < dirs.length; i++ )
  +        {
  +            final File dir = new File( dirs[ i ] );
  +            if( dir.exists() && dir.isDirectory() )
  +            {
  +                final FileSet fileSet = new FileSet();
  +                fileSet.setDir( dir );
  +                fileSet.setIncludes( "*" );
  +                toPath.addFileset( fileSet );
  +            }
  +        }
       }
   }
   
  
  
  
  1.6       +3 -6      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Gcj.java
  
  Index: Gcj.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Gcj.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Gcj.java	22 Mar 2002 04:12:36 -0000	1.5
  +++ Gcj.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -10,7 +10,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.todo.types.Commandline;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * The implementation of the gcj compiler. This is primarily a cut-and-paste
  @@ -35,10 +35,7 @@
           getTaskContext().debug( "Using gcj compiler" );
           cmd = setupGCJCommand();
   
  -        int firstFileName = cmd.size();
  -        logAndAddFilesToCompile( cmd );
  -
  -        return executeExternalCompile( cmd.getCommandline(), firstFileName ) == 0;
  +        return executeExternalCompile( cmd );
       }
   
       protected Commandline setupGCJCommand()
  @@ -83,7 +80,7 @@
           }
   
           cmd.addArgument( "-classpath" );
  -        cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( classpath, getTaskContext() ) );
   
           if( m_encoding != null )
           {
  
  
  
  1.2       +1 -3      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/JavacExternal.java
  
  Index: JavacExternal.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/JavacExternal.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- JavacExternal.java	17 Mar 2002 09:42:22 -0000	1.1
  +++ JavacExternal.java	7 Apr 2002 09:51:09 -0000	1.2
  @@ -34,10 +34,8 @@
           Commandline cmd = new Commandline();
           cmd.setExecutable( getJavac().getJavacExecutable() );
           setupModernJavacCommandlineSwitches( cmd );
  -        int firstFileName = cmd.size();
  -        logAndAddFilesToCompile( cmd );
   
  -        return executeExternalCompile( cmd.getCommandline(), firstFileName ) == 0;
  +        return executeExternalCompile( cmd );
       }
   
   }
  
  
  
  1.6       +3 -6      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jikes.java
  
  Index: Jikes.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jikes.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Jikes.java	22 Mar 2002 04:12:36 -0000	1.5
  +++ Jikes.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -10,7 +10,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.todo.types.Commandline;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * The implementation of the jikes compiler. This is primarily a cut-and-paste
  @@ -91,7 +91,7 @@
           }
   
           cmd.addArgument( "-classpath" );
  -        cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( classpath, getTaskContext() ) );
   
           if( m_encoding != null )
           {
  @@ -128,10 +128,7 @@
   
           addCurrentCompilerArgs( cmd );
   
  -        int firstFileName = cmd.size();
  -        logAndAddFilesToCompile( cmd );
  -
  -        return executeExternalCompile( cmd.getCommandline(), firstFileName ) == 0;
  +        return executeExternalCompile( cmd );
       }
   
   }
  
  
  
  1.6       +3 -6      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jvc.java
  
  Index: Jvc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jvc.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Jvc.java	22 Mar 2002 04:12:36 -0000	1.5
  +++ Jvc.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -10,7 +10,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.todo.types.Commandline;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * The implementation of the jvc compiler from microsoft. This is primarily a
  @@ -68,7 +68,7 @@
   
           // Add the Classpath before the "internal" one.
           cmd.addArgument( "/cp:p" );
  -        cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( classpath, getTaskContext() ) );
   
           // Enable MS-Extensions and ...
           cmd.addArgument( "/x-" );
  @@ -92,9 +92,6 @@
   
           addCurrentCompilerArgs( cmd );
   
  -        int firstFileName = cmd.size();
  -        logAndAddFilesToCompile( cmd );
  -
  -        return executeExternalCompile( cmd.getCommandline(), firstFileName ) == 0;
  +        return executeExternalCompile( cmd );
       }
   }
  
  
  
  1.6       +4 -3      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Kjc.java
  
  Index: Kjc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Kjc.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Kjc.java	22 Mar 2002 04:12:36 -0000	1.5
  +++ Kjc.java	7 Apr 2002 09:51:09 -0000	1.6
  @@ -11,7 +11,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.todo.types.Commandline;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * The implementation of the Java compiler for KJC. This is primarily a
  @@ -99,7 +99,7 @@
           cp.add( classpath );
           cp.add( src );
   
  -        cmd.addArgument( PathUtil.formatPath( cp, getTaskContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( cp, getTaskContext() ) );
   
           // kjc-1.5A doesn't support -encoding option now.
           // but it will be supported near the feature.
  @@ -126,7 +126,8 @@
   
           addCurrentCompilerArgs( cmd );
   
  -        logAndAddFilesToCompile( cmd );
  +        logFilesToCompile( cmd );
  +        addFilesToCompile( cmd );
           return cmd;
       }
   }
  
  
  
  1.2       +3 -4      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Sj.java
  
  Index: Sj.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Sj.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Sj.java	17 Mar 2002 09:42:22 -0000	1.1
  +++ Sj.java	7 Apr 2002 09:51:09 -0000	1.2
  @@ -33,12 +33,11 @@
       {
           getTaskContext().debug( "Using symantec java compiler" );
   
  -        Commandline cmd = setupJavacCommand();
  +        Commandline cmd = new Commandline();
  +        setupJavacCommandlineSwitches( cmd, false );
           cmd.setExecutable( "sj" );
   
  -        int firstFileName = cmd.size() - m_compileList.length;
  -
  -        return executeExternalCompile( cmd.getCommandline(), firstFileName ) == 0;
  +        return executeExternalCompile( cmd );
       }
   
   }
  
  
  
  1.8       +0 -1      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JJTree.java
  
  Index: JJTree.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JJTree.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- JJTree.java	28 Mar 2002 06:29:31 -0000	1.7
  +++ JJTree.java	7 Apr 2002 09:51:10 -0000	1.8
  @@ -14,7 +14,6 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.java.ExecuteJava;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
   
   /**
    * Taskdef for the JJTree compiler compiler.
  
  
  
  1.7       +0 -1      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JavaCC.java
  
  Index: JavaCC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JavaCC.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JavaCC.java	28 Mar 2002 06:29:31 -0000	1.6
  +++ JavaCC.java	7 Apr 2002 09:51:10 -0000	1.7
  @@ -14,7 +14,6 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.java.ExecuteJava;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
   
   /**
    * Taskdef for the JavaCC compiler compiler.
  
  
  
  1.9       +5 -5      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Javadoc.java	22 Mar 2002 07:18:07 -0000	1.8
  +++ Javadoc.java	7 Apr 2002 09:51:10 -0000	1.9
  @@ -25,7 +25,7 @@
   import org.apache.tools.todo.types.DirectoryScanner;
   import org.apache.tools.todo.types.FileSet;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.tools.todo.types.ScannerUtil;
   
   /**
  @@ -570,7 +570,7 @@
               classpath.add( m_classpath );
           }
           cmd.addArgument( "-classpath" );
  -        cmd.addArgument( PathUtil.formatPath( classpath, getContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( classpath, getContext() ) );
   
           if( m_version && m_doclet == null )
           {
  @@ -607,7 +607,7 @@
                   if( m_doclet.getPath() != null )
                   {
                       cmd.addArgument( "-docletpath" );
  -                    cmd.addArgument( PathUtil.formatPath( m_doclet.getPath(), getContext() ) );
  +                    cmd.addArgument( FileListUtil.formatPath( m_doclet.getPath(), getContext() ) );
                   }
                   for( Iterator e = m_doclet.getParams(); e.hasNext(); )
                   {
  @@ -628,7 +628,7 @@
               if( m_bootclasspath != null )
               {
                   cmd.addArgument( "-bootclasspath" );
  -                cmd.addArgument( PathUtil.formatPath( m_bootclasspath, getContext() ) );
  +                cmd.addArgument( FileListUtil.formatPath( m_bootclasspath, getContext() ) );
               }
   
               // add the links arguments
  @@ -886,7 +886,7 @@
                                      ArrayList packages, ArrayList excludePackages )
           throws TaskException
       {
  -        getContext().debug( "Source path = " + PathUtil.formatPath( sourcePath, getContext() ) );
  +        getContext().debug( "Source path = " + FileListUtil.formatPath( sourcePath, getContext() ) );
           StringBuffer msg = new StringBuffer( "Packages = " );
           for( int i = 0; i < packages.size(); i++ )
           {
  
  
  
  1.9       +2 -2      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java
  
  Index: WLJspc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- WLJspc.java	22 Mar 2002 04:12:36 -0000	1.8
  +++ WLJspc.java	7 Apr 2002 09:51:10 -0000	1.9
  @@ -16,7 +16,7 @@
   import org.apache.tools.todo.taskdefs.MatchingTask;
   import org.apache.tools.todo.types.DirectoryScanner;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * Class to precompile JSP's using weblogic's jsp compiler (weblogic.jspc)
  @@ -190,7 +190,7 @@
           // Does not take the classpath from the env....
           // Am i missing something about the Java task??
           args[ j++ ] = "-classpath";
  -        args[ j++ ] = PathUtil.formatPath( compileClasspath, getContext() );
  +        args[ j++ ] = FileListUtil.formatPath( compileClasspath, getContext() );
   
           this.scanDir( files );
           getContext().info( "Compiling " + filesToDo.size() + " JSP files" );
  
  
  
  1.2       +5 -1      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/compilers/DefaultCompilerAdapter.java
  
  Index: DefaultCompilerAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/compilers/DefaultCompilerAdapter.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultCompilerAdapter.java	17 Mar 2002 09:56:54 -0000	1.1
  +++ DefaultCompilerAdapter.java	7 Apr 2002 09:51:10 -0000	1.2
  @@ -11,8 +11,10 @@
   import java.util.Iterator;
   import org.apache.avalon.excalibur.util.StringUtil;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.todo.taskdefs.jsp.JspC;
   import org.apache.tools.todo.types.Commandline;
  +import org.apache.tools.todo.util.FileUtils;
   
   /**
    * This is the default implementation for the CompilerAdapter interface. This is
  @@ -60,8 +62,10 @@
       protected void logAndAddFilesToCompile( JspC jspc,
                                               ArrayList compileList,
                                               Commandline cmd )
  +        throws TaskException
       {
  -        getTaskContext().debug( "Compilation args: " + cmd.toString() );
  +        final String[] args = cmd.getArguments();
  +        getTaskContext().debug( "Compilation args: " + FileUtils.formatCommandLine( args ) );
   
           StringBuffer niceSourceList = new StringBuffer( "File" );
           if( compileList.size() != 1 )
  
  
  
  1.3       +14 -36    jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/compilers/JasperC.java
  
  Index: JasperC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/compilers/JasperC.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- JasperC.java	21 Mar 2002 08:03:56 -0000	1.2
  +++ JasperC.java	7 Apr 2002 09:51:10 -0000	1.3
  @@ -9,6 +9,7 @@
   
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.framework.java.ExecuteJava;
   import org.apache.antlib.java.JavaTask;
   import org.apache.tools.todo.taskdefs.jsp.JspC;
   import org.apache.tools.todo.types.Argument;
  @@ -30,47 +31,28 @@
           throws TaskException
       {
           getTaskContext().debug( "Using jasper compiler" );
  -        Commandline cmd = setupJasperCommand();
   
  -        try
  +        final ExecuteJava exe = new ExecuteJava();
  +        exe.setClassName( "org.apache.jasper.JspC" );
  +        if( getJspc().getClasspath() != null )
           {
  -            // Create an instance of the compiler, redirecting output to
  -            // the project log
  -            //FIXME
  -            JavaTask java = null;//(Java)( getJspc().getProject() ).createTask( "java" );
  -            if( getJspc().getClasspath() != null )
  -            {
  -                java.addClasspath( getJspc().getClasspath() );
  -            }
  -            java.setClassname( "org.apache.jasper.JspC" );
  -            String args[] = cmd.getArguments();
  -            for( int i = 0; i < args.length; i++ )
  -            {
  -                java.addArg( new Argument( args[ i ] ) );
  -            }
  -            java.execute();
  -            return true;
  -        }
  -        catch( Exception ex )
  -        {
  -            if( ex instanceof TaskException )
  -            {
  -                throw (TaskException)ex;
  -            }
  -            else
  -            {
  -                throw new TaskException( "Error running jsp compiler: ",
  -                                         ex );
  -            }
  +            exe.getClassPath().add( getJspc().getClasspath() );
           }
  +
  +        setupJasperCommand( exe.getArguments() );
  +
  +        // Create an instance of the compiler, redirecting output to
  +        // the project log
  +        exe.execute( getTaskContext() );
  +        return true;
       }
   
       /*
        * ------------------------------------------------------------
        */
  -    private Commandline setupJasperCommand()
  +    private void setupJasperCommand( final Commandline cmd )
  +        throws TaskException
       {
  -        Commandline cmd = new Commandline();
           JspC jspc = getJspc();
           if( jspc.getDestdir() != null )
           {
  @@ -106,9 +88,5 @@
               cmd.addArgument( jspc.getUribase().toString() );
           }
           logAndAddFilesToCompile( getJspc(), getJspc().getCompileList(), cmd );
  -        return cmd;
       }
  -    /*
  -     * ------------------------------------------------------------
  -     */
   }
  
  
  
  1.10      +2 -2      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- JUnitTask.java	4 Apr 2002 11:37:43 -0000	1.9
  +++ JUnitTask.java	7 Apr 2002 09:51:10 -0000	1.10
  @@ -19,13 +19,13 @@
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.file.Path;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.myrmidon.framework.java.ExecuteJava;
   import org.apache.tools.todo.types.Argument;
   import org.apache.tools.todo.types.Commandline;
   import org.apache.tools.todo.types.EnumeratedAttribute;
   import org.apache.tools.todo.types.EnvironmentData;
   import org.apache.tools.todo.types.EnvironmentVariable;
  -import org.apache.tools.todo.types.PathUtil;
   import org.apache.tools.todo.types.SysProperties;
   
   /**
  @@ -640,7 +640,7 @@
           try
           {
               getContext().debug( "Using System properties " + System.getProperties() );
  -            final ClassLoader classLoader = PathUtil.createClassLoader( classPath, getContext() );
  +            final ClassLoader classLoader = FileListUtil.createClassLoader( classPath, getContext() );
   
               runner = new JUnitTestRunner( test,
                                             test.getHaltonerror(),
  
  
  
  1.7       +3 -3      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MAudit.java
  
  Index: MAudit.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MAudit.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MAudit.java	22 Mar 2002 04:12:37 -0000	1.6
  +++ MAudit.java	7 Apr 2002 09:51:10 -0000	1.7
  @@ -11,7 +11,7 @@
   import java.util.ArrayList;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * Metamata Audit evaluates Java code for programming errors, weaknesses, and
  @@ -129,7 +129,7 @@
           // don't forget to modify the pattern if you change the options reporting
           classpath.add( getClassPath() );
   
  -        final String formattedClasspath = PathUtil.formatPath( classpath, getContext() );
  +        final String formattedClasspath = FileListUtil.formatPath( classpath, getContext() );
           if( formattedClasspath.length() > 0 )
           {
               options.add( "-classpath" );
  @@ -162,7 +162,7 @@
           if( m_unused )
           {
               options.add( "-unused" );
  -            options.add( PathUtil.formatPath( m_searchPath, getContext() ) );
  +            options.add( FileListUtil.formatPath( m_searchPath, getContext() ) );
           }
           addAllArrayList( options, getIncludedFiles().keySet().iterator() );
           return options;
  
  
  
  1.7       +2 -2      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MMetrics.java
  
  Index: MMetrics.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MMetrics.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- MMetrics.java	22 Mar 2002 04:12:37 -0000	1.6
  +++ MMetrics.java	7 Apr 2002 09:51:10 -0000	1.7
  @@ -15,7 +15,7 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.todo.taskdefs.exec.ExecuteStreamHandler;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * Calculates global complexity and quality metrics on Java source code. You
  @@ -132,7 +132,7 @@
           // don't forget to modify the pattern if you change the options reporting
           classpath.add( getClassPath() );
   
  -        final String formattedClasspath = PathUtil.formatPath( classpath, getContext() );
  +        final String formattedClasspath = FileListUtil.formatPath( classpath, getContext() );
           if( formattedClasspath.length() > 0 )
           {
               options.add( "-classpath" );
  
  
  
  1.10      +1 -1      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java
  
  Index: MParse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MParse.java	22 Mar 2002 07:18:08 -0000	1.9
  +++ MParse.java	7 Apr 2002 09:51:10 -0000	1.10
  @@ -19,7 +19,7 @@
   import org.apache.myrmidon.framework.java.ExecuteJava;
   import org.apache.tools.todo.types.Argument;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.aut.nativelib.PathUtil;
   
   /**
    * Simple Metamata MParse task based on the original written by <a
  
  
  
  1.3       +0 -8      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/perforce/P4Base.java
  
  Index: P4Base.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/perforce/P4Base.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- P4Base.java	18 Mar 2002 08:53:31 -0000	1.2
  +++ P4Base.java	7 Apr 2002 09:51:10 -0000	1.3
  @@ -152,14 +152,6 @@
               }
               cmd.addLine( command );
   
  -            String[] cmdline = cmd.getCommandline();
  -            String cmdl = "";
  -            for( int i = 0; i < cmdline.length; i++ )
  -            {
  -                cmdl += cmdline[ i ] + " ";
  -            }
  -
  -            getContext().debug( "Execing " + cmdl );
               if( handler == null )
               {
                   handler = this;
  
  
  
  1.4       +2 -11     jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/pvcs/Pvcs.java
  
  Index: Pvcs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/pvcs/Pvcs.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Pvcs.java	18 Mar 2002 11:49:47 -0000	1.3
  +++ Pvcs.java	7 Apr 2002 09:51:10 -0000	1.4
  @@ -241,7 +241,6 @@
           // Capture output
           // build the command line from what we got the format is
           final Commandline cmd = buildPCLICommand();
  -        getContext().debug( "Executing " + cmd.toString() );
   
           File tmp = null;
   
  @@ -272,17 +271,9 @@
               massagePCLI( tmp, fileList );
               return fileList;
           }
  -        catch( final ParseException pe )
  +        catch( final Exception e )
           {
  -            final String message = "Failed executing: " +
  -                cmd.toString() + ". Exception: " + pe.getMessage();
  -            throw new TaskException( message );
  -        }
  -        catch( final IOException ioe )
  -        {
  -            final String message = "Failed executing: " +
  -                cmd.toString() + ". Exception: " + ioe.getMessage();
  -            throw new TaskException( message );
  +            throw new TaskException( "Failed execution.", e );
           }
           finally
           {
  
  
  
  1.7       +9 -9      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/DefaultRmicAdapter.java
  
  Index: DefaultRmicAdapter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/DefaultRmicAdapter.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- DefaultRmicAdapter.java	22 Mar 2002 07:18:08 -0000	1.6
  +++ DefaultRmicAdapter.java	7 Apr 2002 09:51:10 -0000	1.7
  @@ -14,8 +14,9 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.FileNameMapper;
   import org.apache.tools.todo.types.Commandline;
  +import org.apache.tools.todo.util.FileUtils;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   
   /**
    * This is the default implementation for the RmicAdapter interface. Currently,
  @@ -106,10 +107,7 @@
   
           if( options != null )
           {
  -            for( int i = 0; i < options.length; i++ )
  -            {
  -                cmd.addArgument( options[ i ] );
  -            }
  +            cmd.addArguments( options );
           }
   
           Path classpath = getCompileClasspath();
  @@ -120,11 +118,11 @@
           if( attributes.getExtdirs() != null )
           {
               cmd.addArgument( "-extdirs" );
  -            cmd.addArgument( PathUtil.formatPath( attributes.getExtdirs(), getTaskContext() ) );
  +            cmd.addArgument( FileListUtil.formatPath( attributes.getExtdirs(), getTaskContext() ) );
           }
   
           cmd.addArgument( "-classpath" );
  -        cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() ) );
  +        cmd.addArgument( FileListUtil.formatPath( classpath, getTaskContext() ) );
   
           String stubVersion = attributes.getStubVersion();
           if( null != stubVersion )
  @@ -222,11 +220,13 @@
        *
        * @param cmd Description of Parameter
        */
  -    protected void logAndAddFilesToCompile( Commandline cmd )
  +    protected void logAndAddFilesToCompile( final Commandline cmd )
  +        throws TaskException
       {
           ArrayList compileList = attributes.getCompileList();
   
  -        getTaskContext().debug( "Compilation args: " + cmd.toString() );
  +        final String[] args = cmd.getArguments();
  +        getTaskContext().debug( "Compilation args: " + FileUtils.formatCommandLine( args ) );
   
           StringBuffer niceSourceList = new StringBuffer( "File" );
           if( compileList.size() != 1 )
  
  
  
  1.7       +2 -2      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/Rmic.java
  
  Index: Rmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/Rmic.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Rmic.java	27 Mar 2002 07:04:17 -0000	1.6
  +++ Rmic.java	7 Apr 2002 09:51:10 -0000	1.7
  @@ -15,9 +15,9 @@
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.FileNameMapper;
   import org.apache.myrmidon.framework.file.Path;
  +import org.apache.myrmidon.framework.file.FileListUtil;
   import org.apache.tools.todo.taskdefs.MatchingTask;
   import org.apache.tools.todo.types.DirectoryScanner;
  -import org.apache.tools.todo.types.PathUtil;
   import org.apache.tools.todo.types.SourceFileScanner;
   
   /**
  @@ -483,7 +483,7 @@
           adapter.setRmic( this );
   
           Path classpath = adapter.getClasspath();
  -        loader = PathUtil.createClassLoader( classpath, getContext() );
  +        loader = FileListUtil.createClassLoader( classpath, getContext() );
   
           // scan base dirs to build up compile lists only if a
           // specific classname is not given
  
  
  
  1.2       +8 -27     jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/WLRmic.java
  
  Index: WLRmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/WLRmic.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- WLRmic.java	17 Mar 2002 09:42:23 -0000	1.1
  +++ WLRmic.java	7 Apr 2002 09:51:10 -0000	1.2
  @@ -10,6 +10,7 @@
   import java.lang.reflect.Method;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.api.TaskContext;
  +import org.apache.myrmidon.framework.java.ExecuteJava;
   import org.apache.tools.todo.types.Commandline;
   import org.apache.tools.todo.taskdefs.rmic.DefaultRmicAdapter;
   
  @@ -45,33 +46,13 @@
           throws TaskException
       {
           getTaskContext().debug( "Using WebLogic rmic" );
  -        Commandline cmd = setupRmicCommand( new String[]{"-noexit"} );
   
  -        try
  -        {
  -            // Create an instance of the rmic
  -            Class c = Class.forName( "weblogic.rmic" );
  -            Method doRmic = c.getMethod( "main",
  -                                         new Class[]{String[].class} );
  -            doRmic.invoke( null, new Object[]{cmd.getArguments()} );
  -            return true;
  -        }
  -        catch( ClassNotFoundException ex )
  -        {
  -            throw new TaskException( "Cannot use WebLogic rmic, as it is not available" +
  -                                     " A common solution is to set the environment variable" +
  -                                     " CLASSPATH." );
  -        }
  -        catch( Exception ex )
  -        {
  -            if( ex instanceof TaskException )
  -            {
  -                throw (TaskException)ex;
  -            }
  -            else
  -            {
  -                throw new TaskException( "Error starting WebLogic rmic: ", ex );
  -            }
  -        }
  +        final ExecuteJava exe = new ExecuteJava();
  +        exe.setClassName( "weblogic.rmic" );
  +        final Commandline cmd = setupRmicCommand( new String[]{"-noexit"} );
  +        exe.getArguments().addArguments( cmd );
  +
  +        exe.execute( getTaskContext() );
  +        return true;
       }
   }
  
  
  
  1.9       +2 -2      jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java
  
  Index: Coverage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Coverage.java	22 Mar 2002 04:12:37 -0000	1.8
  +++ Coverage.java	7 Apr 2002 09:51:10 -0000	1.9
  @@ -20,7 +20,7 @@
   import org.apache.tools.todo.types.Commandline;
   import org.apache.tools.todo.types.FileSet;
   import org.apache.myrmidon.framework.file.Path;
  -import org.apache.tools.todo.types.PathUtil;
  +import org.apache.aut.nativelib.PathUtil;
   
   /**
    * Convenient task to run Sitraka JProbe Coverage from Ant. Options are pretty
  @@ -304,7 +304,7 @@
           params.addArguments( m_vmArgs );
   
           // classpath
  -        final String[] classpath = m_classpath.listFiles();
  +        final String[] classpath = m_classpath.listFiles( getContext() );
           if( classpath.length > 0 )
           {
               params.addArgument( "-classpath" );
  
  
  
  1.3       +0 -10     jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/Commandline.java
  
  Index: Commandline.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/Commandline.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- Commandline.java	20 Mar 2002 08:19:43 -0000	1.2
  +++ Commandline.java	7 Apr 2002 09:51:10 -0000	1.3
  @@ -152,14 +152,4 @@
               addArgument( parts[ i ] );
           }
       }
  -
  -    public int size()
  -    {
  -        return getCommandline().length;
  -    }
  -
  -    public String toString()
  -    {
  -        return StringUtil.join( getCommandline(), " " );
  -    }
   }
  
  
  

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