ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@locus.apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/script ant ant.bat
Date Tue, 05 Dec 2000 09:22:06 GMT
donaldp     00/12/05 01:22:06

  Modified:    proposal/myrmidon/src/java/org/apache/ant Main.java
               proposal/myrmidon/src/java/org/apache/ant/convert
                        DefaultConverterLoader.java
               proposal/myrmidon/src/java/org/apache/ant/project
                        DefaultProjectEngine.java
                        DefaultProjectListener.java Project.java
                        ProjectEngine.java ProjectListener.java Target.java
               proposal/myrmidon/src/java/org/apache/ant/tasklet/engine
                        DefaultTaskletEngine.java TaskletEngine.java
                        TskDeployer.java
               proposal/myrmidon/src/java/org/apache/ant/tasks/core
                        ConfigurationTest.java ContentTest.java Echo.java
                        PrimitiveTypesTest.java taskdefs.properties
               proposal/myrmidon/src/make sample.xmk
               proposal/myrmidon/src/script ant ant.bat
  Added:       proposal/myrmidon/src/java/org/apache/ant/launcher
                        AntLoader.java
               proposal/myrmidon/src/java/org/apache/ant/project
                        ProjectListenerSupport.java
                        ProjectToListenerAdapter.java
               proposal/myrmidon/src/java/org/apache/ant/tasks/core
                        AntCall.java RegisterTasklet.java
               proposal/myrmidon/src/manifest ant-manifest.mf
                        myrmidon-manifest.mf
  Log:
  Continued developing myrmidon
  * simplified logging interface to be independent of org.apache.log
  * made it so that you no longer need to build a classpath and hand it to ant!!!
  * added ant-call task
  
  Revision  Changes    Path
  1.2       +38 -31    jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/Main.java
  
  Index: Main.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/Main.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Main.java	2000/12/04 13:37:27	1.1
  +++ Main.java	2000/12/05 09:21:42	1.2
  @@ -18,13 +18,15 @@
   import java.net.URLClassLoader;
   import java.util.ArrayList;
   import java.util.HashMap;
  -import java.util.List;
   import java.util.Iterator;
  +import java.util.List;
  +import org.apache.ant.launcher.AntLoader;
   import org.apache.ant.project.DefaultProjectEngine;
   import org.apache.ant.project.Project;
   import org.apache.ant.project.ProjectBuilder;
   import org.apache.ant.project.ProjectEngine;
   import org.apache.ant.project.ProjectListener;
  +import org.apache.ant.project.ProjectToListenerAdapter;
   import org.apache.ant.tasklet.JavaVersion;
   import org.apache.ant.tasklet.TaskletContext;
   import org.apache.avalon.Disposable;
  @@ -57,10 +59,14 @@
       public final static String     VERSION                   = 
           "Ant " + BUILD_VERSION + " compiled on " + BUILD_DATE;
   
  -    protected final static String  DEFAULT_LOGLEVEL          = "INFO";
  -    protected final static String  DEFAULT_LIB_DIRECTORY     = ".." + File.separator + "lib";
  +    protected final static String  DEFAULT_LOGLEVEL          = "WARN";
  +    protected final static String  DEFAULT_LIB_DIRECTORY     = "lib";
       protected final static String  DEFAULT_TASKLIB_DIRECTORY = DEFAULT_LIB_DIRECTORY;
       protected final static String  DEFAULT_FILENAME          = "build.xmk";
  +
  +    protected final static String  DEFAULT_ENGINE            = 
  +        "org.apache.ant.project.DefaultProjectEngine";
  +
       protected final static String  DEFAULT_LISTENER          = 
           "org.apache.ant.project.DefaultProjectListener";
   
  @@ -82,7 +88,7 @@
       private static final int       HOME_DIR_OPT              = 7;
       
       //incompatable options for info options
  -    private static final int       INFO_OPT_INCOMPAT[]       = new int[] 
  +    private static final int[]     INFO_OPT_INCOMPAT         = new int[] 
       { 
           HELP_OPT, QUIET_OPT, VERBOSE_OPT, FILE_OPT, 
           LOG_LEVEL_OPT, VERSION_OPT, LISTENER_OPT,
  @@ -91,13 +97,14 @@
       };
       
       //incompatable options for other logging options
  -    private static final int       LOG_OPT_INCOMPAT[]        = new int[] 
  +    private static final int[]     LOG_OPT_INCOMPAT          = new int[] 
       {
           QUIET_OPT, VERBOSE_OPT, LOG_LEVEL_OPT
       };
   
       protected Logger               m_logger;
   
  +    protected ProjectListener      m_listener;
       protected File                 m_binDir;
       protected File                 m_homeDir;
       protected File                 m_libDir;
  @@ -105,7 +112,7 @@
       protected File                 m_buildFile;
       protected File                 m_userDir;
   
  -    public static void main( final String args[] )
  +    public static void main( final String[] args )
       {
           final Main main = new Main();
   
  @@ -128,7 +135,7 @@
       protected CLOptionDescriptor[] createCLOptions()
       {
           //TODO: localise
  -        final CLOptionDescriptor options[] = new CLOptionDescriptor[ 13 ];
  +        final CLOptionDescriptor[] options = new CLOptionDescriptor[ 13 ];
   
           options[0] =
               new CLOptionDescriptor( "help",
  @@ -291,9 +298,9 @@
           m_taskLibDir = getTaskLibDir( m_homeDir, taskLibDir );
           m_buildFile = getFile( filename );
   
  -        m_logger.info( "Ant Base Directory: " + m_homeDir );
  +        m_logger.warn( "Ant Build File: " + m_buildFile );
  +        m_logger.info( "Ant Home Directory: " + m_homeDir );
           m_logger.info( "Ant Bin Directory: " + m_binDir );
  -        m_logger.info( "Ant Build File: " + m_buildFile );
           m_logger.debug( "Ant Lib Directory: " + m_libDir );
           m_logger.debug( "Ant Task Lib Directory: " + m_taskLibDir );
   
  @@ -310,6 +317,8 @@
               ((Initializable)engine).init();
           }
   
  +        engine.addProjectListener( m_listener );
  +
           deployDefaultTaskLibs( engine, m_taskLibDir );
   
           BufferedReader reader = null;
  @@ -343,10 +352,9 @@
                                             final File taskLibDirectory )
       
       {
  -        final ExtensionFileFilter filter = 
  -            new ExtensionFileFilter( new String[] { ".tsk" } );
  +        final ExtensionFileFilter filter = new ExtensionFileFilter( ".tsk" );
   
  -        final File files[] = taskLibDirectory.listFiles( filter );
  +        final File[] files = taskLibDirectory.listFiles( filter );
           final Deployer deployer = engine.getDeployer();
   
           for( int i = 0; i < files.length; i++ )
  @@ -401,36 +409,35 @@
   
       protected void setupListener( final String listenerName )
       {
  -        final ProjectListener listener = createListener( listenerName );
  -        m_logger.addLogTarget( listener );
  +        m_listener = createListener( listenerName );
  +        m_logger.addLogTarget( new ProjectToListenerAdapter( m_listener ) );
       }
   
       protected void setupContextClassLoader( final File libDir )
       {
  -        final ClassLoader classLoader = createClassLoader( libDir );
  -        Thread.currentThread().setContextClassLoader( classLoader );
  +        setupClassLoader( libDir );
  +        Thread.currentThread().setContextClassLoader( AntLoader.getLoader() );
       }
   
  -    protected ClassLoader createClassLoader( final File libDir )
  +    protected void setupClassLoader( final File libDir )
       {
           final ExtensionFileFilter filter = 
               new ExtensionFileFilter( new String[] { ".jar", ".zip" } );
   
  -        final ArrayList urlList = new ArrayList();
  -        toURLS( urlList, libDir.listFiles( filter ) );
  -        
  -        final URL urls[] = (URL[])urlList.toArray( new URL[0] );
  +        final File[] files = libDir.listFiles( filter );
   
  -        return new URLClassLoader( urls, ClassLoader.getSystemClassLoader() );
  -    }
  +        final AntLoader classLoader = AntLoader.getLoader();
   
  -    protected void toURLS( final ArrayList urls, final File files[] )
  -    {
           for( int i = 0; i < files.length; i++ )
           {
  -            try { urls.add( files[ i ].toURL() ); }
  -            catch( final MalformedURLException mue ) {}
  -        }
  +            if( !files[ i ].getName().equals( "ant.jar" ) &&
  +                !files[ i ].getName().equals( "myrmidon.jar" ) &&
  +                !files[ i ].getName().equals( "avalonapi.jar" ) )
  +            {                
  +                try { classLoader.addURL( files[ i ].toURL() ); }
  +                catch( final MalformedURLException mue ) {}
  +            }
  +        }        
       }
   
       protected Project getProject( final String builderName, final File file )
  @@ -497,7 +504,7 @@
   
       protected ProjectEngine createProjectEngine()
       {
  -        return new DefaultProjectEngine();
  +        return (ProjectEngine)createObject( DEFAULT_ENGINE, "project-engine" );
       }
   
       protected File getHomeDir( final String homeDir )
  @@ -760,11 +767,11 @@
       {
           try
           {
  -            final Class clazz = Class.forName( objectName );
  +            final Class clazz = Class.forName( objectName ); 
               return clazz.newInstance();
           }
           catch( final IllegalAccessException iae )
  -        {
  +        { 
               throw new AntException( "Non-public constructor for " + type + " " + objectName, 
                                       iae );
           }
  
  
  
  1.2       +3 -2      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/convert/DefaultConverterLoader.java
  
  Index: DefaultConverterLoader.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/convert/DefaultConverterLoader.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultConverterLoader.java	2000/12/04 13:37:28	1.1
  +++ DefaultConverterLoader.java	2000/12/05 09:21:45	1.2
  @@ -22,13 +22,14 @@
   {
       public DefaultConverterLoader()
       {
  -        super( new URLClassLoader( new URL[0], 
  +        super( new URLClassLoader( new URL[0],
                                      Thread.currentThread().getContextClassLoader() ) );
       }
       
       public DefaultConverterLoader( final URL location )
       {
  -        super( new URLClassLoader( new URL[] { location } ) );
  +        super( new URLClassLoader( new URL[] { location }, 
  +                                   Thread.currentThread().getContextClassLoader() ) );
       }
       
       public Converter loadConverter( final String converter )
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/launcher/AntLoader.java
  
  Index: AntLoader.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.ant.launcher;
  
  import java.lang.reflect.Method;
  import java.net.URL;
  import java.net.URLClassLoader;
  
  /**
   * AvalonLoader is the class that bootstraps and installs the security manager.
   *
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  public final class AntLoader
      extends URLClassLoader
  {
      protected static AntLoader     c_classLoader;
  
      public static AntLoader getLoader()
      {
          if( null == c_classLoader ) 
          {
              c_classLoader = new AntLoader( new URL[ 0 ] );
          }
  
          return c_classLoader;
      }
  
      public final static void main( final String args[] ) 
          throws Exception
      { 
          final URL archive = new URL( "file:lib/myrmidon.jar" );
          c_classLoader = new AntLoader( new URL[] { archive } );
          
          try
          {
              //load class and retrieve appropriate main method.
              final Class clazz = c_classLoader.loadClass( "org.apache.ant.Main" );
              final Method method = clazz.getMethod( "main", new Class[] { args.getClass() } );
              
              //kick the tires and light the fires....
              method.invoke( null, new Object[] { args } );
          }
          catch( final Throwable throwable ) 
          {
              throwable.printStackTrace();
          }
      }
  
      public AntLoader( final URL[] urls )
      {
          super( urls );
      }
  
      public void addURL( final URL url )
      {
          super.addURL( url );
      }
  }
  
  
  
  1.2       +92 -36    jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/DefaultProjectEngine.java
  
  Index: DefaultProjectEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/DefaultProjectEngine.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultProjectEngine.java	2000/12/04 13:37:30	1.1
  +++ DefaultProjectEngine.java	2000/12/05 09:21:47	1.2
  @@ -32,39 +32,52 @@
   public class DefaultProjectEngine
       implements ProjectEngine, Initializable, Disposable
   {
  -    protected Deployer              m_deployer;
  -    protected TaskletRegistry       m_taskletRegistry;
  -    protected ConverterRegistry     m_converterRegistry;
  -    protected TaskletEngine         m_taskletEngine;
  -    protected Logger                m_logger;
  -
  +    protected Deployer                 m_deployer;
  +    protected TaskletRegistry          m_taskletRegistry;
  +    protected ConverterRegistry        m_converterRegistry;
  +    protected TaskletEngine            m_taskletEngine;
  +    protected Logger                   m_logger;
  +    protected ProjectListenerSupport   m_listenerSupport;
  +    protected DefaultComponentManager  m_componentManager;
  +    
       public void setLogger( final Logger logger )
       {
           m_logger = logger;
       }
   
  +    public void addProjectListener( final ProjectListener listener )
  +    {
  +        m_listenerSupport.addProjectListener( listener );
  +    }
  +
  +    public void removeProjectListener( final ProjectListener listener )
  +    {
  +        m_listenerSupport.removeProjectListener( listener );
  +    }
  +
       public void init()
           throws Exception
       {
  +        m_listenerSupport = new ProjectListenerSupport();
  +
           m_taskletEngine = createTaskletEngine();
  +        m_taskletEngine.setLogger( m_logger );
   
           m_taskletRegistry = createTaskletRegistry();
           m_converterRegistry = createConverterRegistry();
           m_deployer = createDeployer();
  -
  -        //final DefaultTaskletContext context = new DefaultTaskletContext();
  -        //m_taskletEngine.contextualize( context );
   
  -        final DefaultComponentManager componentManager = new DefaultComponentManager();
  -        componentManager.put( "org.apache.ant.tasklet.engine.TaskletRegistry", 
  -                              m_taskletRegistry );
  +        m_componentManager = new DefaultComponentManager();
  +        m_componentManager.put( "org.apache.ant.project.ProjectEngine", this );
  +        m_componentManager.put( "org.apache.ant.tasklet.engine.TaskletRegistry", 
  +                                m_taskletRegistry );
   
  -        componentManager.put( "org.apache.ant.convert.ConverterRegistry", 
  -                              m_converterRegistry );
  +        m_componentManager.put( "org.apache.ant.convert.ConverterRegistry", 
  +                                m_converterRegistry );
   
  -        componentManager.put( "org.apache.avalon.camelot.Deployer", m_deployer );
  +        m_componentManager.put( "org.apache.avalon.camelot.Deployer", m_deployer );
          
  -        m_taskletEngine.compose( componentManager );
  +        m_taskletEngine.compose( m_componentManager );
           
           if( m_taskletEngine instanceof Initializable )
           {
  @@ -112,15 +125,36 @@
       public void execute( final Project project, final String target )
           throws AntException
       {
  -        m_taskletEngine.contextualize( project.getContext() );
  -        executeTarget( "<init>", project.getImplicitTarget() );
  +        m_componentManager.put( "org.apache.ant.project.Project", project );
  +
  +        final TaskletContext context = project.getContext();
  +
  +        final String projectName = (String)context.getProperty( Project.PROJECT );
  +
  +        m_listenerSupport.projectStarted( projectName );
  +
  +        executeTargetWork( "<init>", project.getImplicitTarget(), context );
  +
  +        //context = new DefaultTaskletContext( context );
  +        
  +        //placing logger lower (at targetlevel or at task level)
  +        //is possible if you want more fine grained control
  +        context.setProperty( TaskletContext.LOGGER, m_logger );
   
  -        final ArrayList done = new ArrayList();
  -        execute( project, target, done );
  +        execute( project, target, context );
  +
  +        m_listenerSupport.projectFinished();
  +    }
  +
  +    public void execute( Project project, String target, TaskletContext context )
  +        throws AntException
  +    {
  +        execute( project, target, context, new ArrayList() );
       }
   
       protected void execute( final Project project, 
                               final String targetName, 
  +                            final TaskletContext context,
                               final ArrayList done )
           throws AntException
       {
  @@ -139,45 +173,67 @@
               final String dependency = (String)dependencies.next();
               if( !done.contains( dependency ) )
               {
  -                execute( project, dependency, done );
  +                execute( project, dependency, context, done );
               }
           }
   
  -        final TaskletContext context = getContextFor( project, targetName );
  -        m_taskletEngine.contextualize( context );
  -        executeTarget( targetName, target );
  +        executeTarget( targetName, target, context );
       }
   
  -    protected TaskletContext getContextFor( final Project project, final String targetName )
  +    protected void executeTarget( final String targetName, 
  +                                  final Target target, 
  +                                  final TaskletContext context )
  +        throws AntException
       {
  -        final DefaultTaskletContext context = 
  -            new DefaultTaskletContext( project.getContext() );
  +        m_componentManager.put( "org.apache.ant.project.Target", target );
   
  -        context.setProperty( Project.TARGET, targetName );
  -        context.put( TaskletContext.LOGGER, m_logger );
  +        final TaskletContext targetContext = new DefaultTaskletContext( context );
  +        targetContext.setProperty( Project.TARGET, targetName );
  +        
  +        m_listenerSupport.targetStarted( targetName );
   
  -        return context;
  +        executeTargetWork( targetName, target, targetContext );
  +        
  +        m_listenerSupport.targetFinished();
       }
   
  -    protected void executeTarget( final String targetName, final Target target )
  -        throws AntException
  +    protected void executeTargetWork( final String name, 
  +                                      final Target target, 
  +                                      final TaskletContext context )
       {
  -        m_logger.debug( "Executing target " + targetName );
  -        
  +        m_logger.debug( "Executing target " + name );
  +
           final Iterator tasks = target.getTasks();
           while( tasks.hasNext() )
           {
               final Configuration task = (Configuration)tasks.next();
  -            executeTask( task );
  +            executeTask( task, context );
           }
       }
   
  -    protected void executeTask( final Configuration configuration )
  +    protected void executeTask( final Configuration configuration, 
  +                                final TaskletContext context )
           throws AntException
       {
           final String name = configuration.getName();
           m_logger.debug( "Executing task " + name );
   
  +        //Set up context for task...
  +        final TaskletContext taskletContext = context;
  +
  +        //is Only necessary if we are multi-threaded
  +        //final TaskletContext targetContext = new DefaultTaskletContext( context );
  +        taskletContext.setProperty( TaskletContext.NAME, name );
  +
  +        m_taskletEngine.contextualize( taskletContext );
  +
  +        //notify listeners
  +        m_listenerSupport.taskletStarted( name );
  +
  +        //run task
           m_taskletEngine.execute( configuration );
  +
  +        //notify listeners task has ended
  +        m_listenerSupport.taskletFinished();
       }
   }
  
  
  
  1.2       +13 -15    jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/DefaultProjectListener.java
  
  Index: DefaultProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/DefaultProjectListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultProjectListener.java	2000/12/04 13:37:30	1.1
  +++ DefaultProjectListener.java	2000/12/05 09:21:48	1.2
  @@ -7,25 +7,13 @@
    */
   package org.apache.ant.project;
   
  -import org.apache.log.format.PatternFormatter;
  -import org.apache.log.output.DefaultOutputLogTarget;
  +import org.apache.avalon.util.StringUtil;
   
   public class DefaultProjectListener
  -    extends DefaultOutputLogTarget
       implements ProjectListener
   {
       protected String        m_prefix;
   
  -    /**
  -     * Initialize the default pattern.
  -     */
  -    protected void initPattern()
  -    {
  -        final PatternFormatter formatrer = new PatternFormatter();
  -        formatrer.setFormat( "%{message}\\n%{throwable}" );
  -        m_formatter = formatrer;
  -    }
  -
       public void projectStarted( final String projectName )
       {
           output( "Starting project " + projectName + "\n" );
  @@ -54,9 +42,19 @@
           m_prefix = null;
       }
   
  +    public void log( String message )
  +    {
  +        output( message );
  +    }
  +
  +    public void log( String message, Throwable throwable )
  +    {
  +        output( message + "\n" + StringUtil.printStackTrace( throwable, 5, true ) );
  +    }
  +
       protected void output( final String data )
       {
  -        if( null != m_prefix ) super.output( "[" + m_prefix + "] " + data );
  -        else super.output( data );
  +        if( null != m_prefix ) System.out.println( "\t[" + m_prefix + "] " + data );
  +        else System.out.println( data );
       }
   }
  
  
  
  1.2       +2 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/Project.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Project.java	2000/12/04 13:37:30	1.1
  +++ Project.java	2000/12/05 09:21:48	1.2
  @@ -10,8 +10,10 @@
   import java.util.Iterator;
   import org.apache.ant.AntException;
   import org.apache.ant.tasklet.TaskletContext;
  +import org.apache.avalon.Component;
   
   public interface Project
  +    extends Component
   {
       // the name of currently executing project
       String PROJECT          = "ant.project.name"; 
  
  
  
  1.2       +7 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectEngine.java
  
  Index: ProjectEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectEngine.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProjectEngine.java	2000/12/04 13:37:30	1.1
  +++ ProjectEngine.java	2000/12/05 09:21:49	1.2
  @@ -8,14 +8,21 @@
   package org.apache.ant.project;
   
   import org.apache.ant.AntException;
  +import org.apache.ant.tasklet.TaskletContext;
  +import org.apache.avalon.Component;
   import org.apache.avalon.camelot.Deployer;
   import org.apache.avalon.camelot.Registry;
   import org.apache.log.Logger;
   
   public interface ProjectEngine
  +    extends Component
   {
       Deployer getDeployer();
  +    void addProjectListener( ProjectListener listener );
  +    void removeProjectListener( ProjectListener listener );
       void setLogger( Logger logger );
       void execute( Project project, String target )
  +        throws AntException;
  +    void execute( Project project, String target, TaskletContext context )
           throws AntException;
   }
  
  
  
  1.2       +3 -3      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectListener.java
  
  Index: ProjectListener.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectListener.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ProjectListener.java	2000/12/04 13:37:30	1.1
  +++ ProjectListener.java	2000/12/05 09:21:49	1.2
  @@ -7,10 +7,7 @@
    */
   package org.apache.ant.project;
   
  -import org.apache.log.LogTarget;
  -
   public interface ProjectListener
  -    extends LogTarget
   {
       void projectStarted( String projectName );
       void projectFinished();
  @@ -20,4 +17,7 @@
   
       void taskletStarted( String taskletName );
       void taskletFinished();
  +
  +    void log( String message );
  +    void log( String message, Throwable throwable );
   }
  
  
  
  1.2       +2 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/Target.java
  
  Index: Target.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/Target.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Target.java	2000/12/04 13:37:30	1.1
  +++ Target.java	2000/12/05 09:21:49	1.2
  @@ -8,8 +8,10 @@
   package org.apache.ant.project;
   
   import java.util.Iterator;
  +import org.apache.avalon.Component;
   
   public interface Target
  +    extends Component
   {
       Iterator getDependencies();
       Iterator getTasks();
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectListenerSupport.java
  
  Index: ProjectListenerSupport.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.ant.project;
  
  public class ProjectListenerSupport
      implements ProjectListener
  {
      protected ProjectListener[]   m_listeners = new ProjectListener[ 0 ];
  
      public void addProjectListener( final ProjectListener listener )
      {
          final ProjectListener[] listeners = new ProjectListener[ m_listeners.length + 1 ];
          System.arraycopy( m_listeners, 0, listeners, 0, m_listeners.length );
          listeners[ m_listeners.length ] = listener;
          m_listeners = listeners;
      }
  
      public void removeProjectListener( final ProjectListener listener )
      {
          int found = -1;
  
          for( int i = 0; i < m_listeners.length; i++ )
          {
              if( listener == m_listeners[ i ] )
              {
                  found = i;
                  break;
              }
          }
  
          if( -1 == found ) return;
          
          final ProjectListener[] listeners = new ProjectListener[ m_listeners.length - 1 ];
          System.arraycopy( m_listeners, 0, listeners, 0, found );
  
          final int count = m_listeners.length - found - 1;
          System.arraycopy( m_listeners, found, listeners, found + 1, count );
  
          m_listeners = listeners;
      }
  
      public void projectStarted( final String projectName )
      {
          for( int i = 0; i < m_listeners.length; i++ )
          {
              m_listeners[ i ].projectStarted( projectName );
          }
      }
  
      public void projectFinished()
      {
          for( int i = 0; i < m_listeners.length; i++ )
          {
              m_listeners[ i ].projectFinished();
          }
      }
  
      public void targetStarted( String targetName )
      {
          for( int i = 0; i < m_listeners.length; i++ )
          {
              m_listeners[ i ].targetStarted( targetName );
          }
      }
  
      public void targetFinished()
      {
          for( int i = 0; i < m_listeners.length; i++ )
          {
              m_listeners[ i ].targetFinished();
          }
      }
  
      public void taskletStarted( String taskletName )
      {
          for( int i = 0; i < m_listeners.length; i++ )
          {
              m_listeners[ i ].taskletStarted( taskletName );
          }
      }
  
      public void taskletFinished()
      {
          for( int i = 0; i < m_listeners.length; i++ )
          {
              m_listeners[ i ].taskletFinished();
          }
      }
  
      public void log( String message )
      {
          for( int i = 0; i < m_listeners.length; i++ )
          {
              m_listeners[ i ].log( message );
          }
      }
  
      public void log( String message, Throwable throwable )
      {
          for( int i = 0; i < m_listeners.length; i++ )
          {
              m_listeners[ i ].log( message, throwable );
          }
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/project/ProjectToListenerAdapter.java
  
  Index: ProjectToListenerAdapter.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.ant.project;
  
  import org.apache.log.LogEntry;
  import org.apache.log.LogTarget;
  
  public class ProjectToListenerAdapter
      implements LogTarget
  {
  
      protected final ProjectListener    m_listener;
  
      public ProjectToListenerAdapter( final ProjectListener listener )
      {
          m_listener = listener;
      }
  
      /**
       * Process a log entry.
       *
       * @param entry the entry
       */
      public void processEntry( final LogEntry entry )
      {
          if( null == entry.getThrowable() )
          {
              m_listener.log( entry.getMessage() );
          }
          else
          {
              m_listener.log( entry.getMessage(), entry.getThrowable() );
          }
      }
  }
  
  
  
  1.2       +5 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/DefaultTaskletEngine.java
  
  Index: DefaultTaskletEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/DefaultTaskletEngine.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- DefaultTaskletEngine.java	2000/12/04 13:37:31	1.1
  +++ DefaultTaskletEngine.java	2000/12/05 09:21:53	1.2
  @@ -40,10 +40,14 @@
       protected TaskletConfigurer    m_configurer;
       protected Logger               m_logger;
   
  +    public void setLogger( final Logger logger )
  +    {
  +        m_logger = logger;
  +    }
  +
       public void contextualize( final Context context )
       {
           m_context = (TaskletContext)context;
  -        m_logger = m_context.getLogger();
       }
   
       public void compose( final ComponentManager componentManager )
  
  
  
  1.2       +2 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/TaskletEngine.java
  
  Index: TaskletEngine.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/TaskletEngine.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TaskletEngine.java	2000/12/04 13:37:31	1.1
  +++ TaskletEngine.java	2000/12/05 09:21:54	1.2
  @@ -11,10 +11,12 @@
   import org.apache.ant.configuration.Configuration;
   import org.apache.avalon.Composer;
   import org.apache.avalon.Contextualizable;
  +import org.apache.log.Logger;
    
   public interface TaskletEngine
       extends Contextualizable, Composer
   {
  +    void setLogger( Logger logger );
       void execute( final Configuration task )
           throws AntException;
   }
  
  
  
  1.2       +5 -0      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/TskDeployer.java
  
  Index: TskDeployer.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasklet/engine/TskDeployer.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- TskDeployer.java	2000/12/04 13:37:31	1.1
  +++ TskDeployer.java	2000/12/05 09:21:54	1.2
  @@ -138,6 +138,9 @@
                                                  key + " due to " + re,
                                                  re );
               }
  +
  +            m_logger.debug( "Registered converter " + key + " that converts from " + 
  +                            source + " to " + destination );
           }
       }   
        
  @@ -158,6 +161,8 @@
                   throw new DeploymentException( "Error registering " + key + " due to " + re,
                                                  re );
               }
  +            
  +            m_logger.debug( "Registered tasklet " + key + " as " + value );
           }
       }
   
  
  
  
  1.2       +1 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/ConfigurationTest.java
  
  Index: ConfigurationTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/ConfigurationTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ConfigurationTest.java	2000/12/04 13:37:32	1.1
  +++ ConfigurationTest.java	2000/12/05 09:21:56	1.2
  @@ -42,6 +42,6 @@
       public void run()
           throws AntException
       {
  -        getLogger().info( m_message );
  +        getLogger().warn( m_message );
       }
   }
  
  
  
  1.2       +1 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/ContentTest.java
  
  Index: ContentTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/ContentTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ContentTest.java	2000/12/04 13:37:32	1.1
  +++ ContentTest.java	2000/12/05 09:21:57	1.2
  @@ -20,7 +20,7 @@
   {
       public void addContent( final Integer value )
       {
  -        getLogger().info( "Integer content: " + value );
  +        getLogger().warn( "Integer content: " + value );
       }
   
       /*
  
  
  
  1.2       +1 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/Echo.java
  
  Index: Echo.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/Echo.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- Echo.java	2000/12/04 13:37:32	1.1
  +++ Echo.java	2000/12/05 09:21:57	1.2
  @@ -28,6 +28,6 @@
       public void run()
           throws AntException
       {
  -        getLogger().info( m_message );
  +        getLogger().warn( m_message );
       }
   }
  
  
  
  1.2       +13 -13    jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/PrimitiveTypesTest.java
  
  Index: PrimitiveTypesTest.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/PrimitiveTypesTest.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- PrimitiveTypesTest.java	2000/12/04 13:37:32	1.1
  +++ PrimitiveTypesTest.java	2000/12/05 09:21:57	1.2
  @@ -20,67 +20,67 @@
   {
       public void setInteger( final Integer value )
       {
  -        getLogger().info( "setInteger( " + value + " );" );
  +        getLogger().warn( "setInteger( " + value + " );" );
       }
       
       public void setInteger2( final int value )
       {
  -        getLogger().info( "setInteger2( " + value + " );" );
  +        getLogger().warn( "setInteger2( " + value + " );" );
       }
   
       public void setShort( final Short value )
       {
  -        getLogger().info( "setShort( " + value + " );" );
  +        getLogger().warn( "setShort( " + value + " );" );
       }
       
       public void setShort2( final short value )
       {
  -        getLogger().info( "setShort2( " + value + " );" );
  +        getLogger().warn( "setShort2( " + value + " );" );
       }
   
       public void setByte( final Byte value )
       {
  -        getLogger().info( "setByte( " + value + " );" );
  +        getLogger().warn( "setByte( " + value + " );" );
       }
       
       public void setByte2( final byte value )
       {
  -        getLogger().info( "setByte2( " + value + " );" );
  +        getLogger().warn( "setByte2( " + value + " );" );
       }
   
       public void setLong( final Long value )
       {
  -        getLogger().info( "setLong( " + value + " );" );
  +        getLogger().warn( "setLong( " + value + " );" );
       }
       
       public void setLong2( final long value )
       {
  -        getLogger().info( "setLong2( " + value + " );" );
  +        getLogger().warn( "setLong2( " + value + " );" );
       }
       
       public void setFloat( final Float value )
       {
  -        getLogger().info( "setFloat( " + value + " );" );
  +        getLogger().warn( "setFloat( " + value + " );" );
       }
       
       public void setFloat2( final float value )
       {
  -        getLogger().info( "setFloat2( " + value + " );" );
  +        getLogger().warn( "setFloat2( " + value + " );" );
       }
       
       public void setDouble( final Double value )
       {
  -        getLogger().info( "setDouble( " + value + " );" );
  +        getLogger().warn( "setDouble( " + value + " );" );
       }
       
       public void setDouble2( final double value )
       {
  -        getLogger().info( "setDouble2( " + value + " );" );
  +        getLogger().warn( "setDouble2( " + value + " );" );
       }
   
       public void setString( final String value )
       {
  -        getLogger().info( "setString( " + value + " );" );
  +        getLogger().warn( "setString( " + value + " );" );
       }
   
       public void run()
  
  
  
  1.2       +3 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/taskdefs.properties
  
  Index: taskdefs.properties
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/taskdefs.properties,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- taskdefs.properties	2000/12/04 13:37:32	1.1
  +++ taskdefs.properties	2000/12/05 09:21:58	1.2
  @@ -4,4 +4,6 @@
   sub-elements-test=org.apache.ant.tasks.core.SubElementTest
   conf-test=org.apache.ant.tasks.core.ConfigurationTest
   content-test=org.apache.ant.tasks.core.ContentTest
  -property=org.apache.ant.tasks.core.Property
  \ No newline at end of file
  +property=org.apache.ant.tasks.core.Property
  +register-tasklet=org.apache.ant.tasks.core.RegisterTasklet
  +ant-call=org.apache.ant.tasks.core.AntCall
  \ No newline at end of file
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/AntCall.java
  
  Index: AntCall.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.ant.tasks.core;
  
  import java.util.ArrayList;
  import org.apache.ant.AntException;
  import org.apache.ant.project.ProjectEngine;
  import org.apache.ant.project.Project;
  import org.apache.ant.tasklet.AbstractTasklet;
  import org.apache.ant.tasklet.DefaultTaskletContext;
  import org.apache.ant.tasklet.TaskletContext;
  import org.apache.avalon.ComponentManager;
  import org.apache.avalon.ComponentNotAccessibleException;
  import org.apache.avalon.ComponentNotFoundException;
  import org.apache.avalon.Composer;
  
  /**
   * This is abstract base class for tasklets.
   *
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  public class AntCall 
      extends AbstractTasklet
      implements Composer
  {
      protected ProjectEngine         m_projectEngine;
      protected Project               m_project;
      protected String                m_target;
      protected ArrayList             m_properties     = new ArrayList();
  
      public void compose( final ComponentManager componentManager )
          throws ComponentNotFoundException, ComponentNotAccessibleException
      {
          m_projectEngine = (ProjectEngine)componentManager.
              lookup( "org.apache.ant.project.ProjectEngine" );
          m_project = (Project)componentManager.lookup( "org.apache.ant.project.Project" );
      }
  
      public void setTarget( final String target )
      {
          m_target = target;
      }
  
      public Property createParam()
      {
          final Property property = new Property();
          m_properties.add( property );
          return property;
      }
  
      public void run()
          throws AntException
      {
          if( null == m_target )
          {
              throw new AntException( "Target attribute must be specified" );
          }
  
          final TaskletContext context = new DefaultTaskletContext( getContext() );
  
          final int size = m_properties.size();
          for( int i = 0; i < size; i++ )
          {
              final Property property = (Property)m_properties.get( i );
              property.contextualize( context );
              property.run();
          }
  
          getLogger().info( "Calling target " + m_target );
          m_projectEngine.execute( m_project, m_target, context );
      }
  }
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/java/org/apache/ant/tasks/core/RegisterTasklet.java
  
  Index: RegisterTasklet.java
  ===================================================================
  /*
   * Copyright (C) The Apache Software Foundation. All rights reserved.
   *
   * This software is published under the terms of the Apache Software License
   * version 1.1, a copy of which has been included with this distribution in
   * the LICENSE file.
   */
  package org.apache.ant.tasks.core;
  
  import java.io.File;
  import java.net.MalformedURLException;
  import java.net.URL;
  import org.apache.ant.AntException;
  import org.apache.ant.tasklet.AbstractTasklet;
  import org.apache.ant.tasklet.engine.DefaultTaskletInfo;
  import org.apache.ant.tasklet.engine.TaskletRegistry;
  import org.apache.avalon.ComponentManager;
  import org.apache.avalon.ComponentNotAccessibleException;
  import org.apache.avalon.ComponentNotFoundException;
  import org.apache.avalon.Composer;
  import org.apache.avalon.camelot.RegistryException;
  
  /**
   * Method to register a single tasklet.
   *
   * @author <a href="mailto:donaldp@apache.org">Peter Donald</a>
   */
  public class RegisterTasklet 
      extends AbstractTasklet
      implements Composer
  {
      protected TaskletRegistry     m_taskletRegistry;
      protected String              m_tasklib;
      protected String              m_taskName;
      protected String              m_classname;
  
      public void compose( final ComponentManager componentManager )
          throws ComponentNotFoundException, ComponentNotAccessibleException
      {
          m_taskletRegistry = (TaskletRegistry)componentManager.
              lookup( "org.apache.ant.tasklet.engine.TaskletRegistry" );
      }
  
      public void setTaskLib( final String tasklib )
      {
          m_tasklib = tasklib;
      }
      
      public void setTaskName( final String taskName )
      {
          m_taskName = taskName;
      }
      
      public void setClassname( final String classname )
      {
          m_classname = classname;
      }
  
      public void run()
          throws AntException
      {
          if( null == m_tasklib )
          {
              throw new AntException( "Must specify tasklib parameter" );
          }
  
          if( null == m_taskName )
          {
              throw new AntException( "Must specify taskname parameter" );            
          }
  
          if( null == m_classname )
          {
              m_classname = getDefaultClassName();
          }
          
          try
          {
              final File tasklib = new File( getContext().resolveFilename( m_tasklib ) );
              final URL url = tasklib.toURL();
              
              final DefaultTaskletInfo info = new DefaultTaskletInfo( m_classname, url );
          
              m_taskletRegistry.register( m_taskName, info ); 
          }
          catch( final MalformedURLException mue )
          {
              throw new AntException( "Malformed task-lib parameter " + m_tasklib, mue );
          }
          catch( final RegistryException re )
          {
              throw new AntException( "Error registering " + m_taskName + " due to " + re, re );
          }
      }
  
      protected String getDefaultClassName()
          throws AntException
      {
          //TODO:
          throw new AntException( "Not yet capable of automagically finding classname" );
      }
  }
  
  
  
  1.2       +10 -0     jakarta-ant/proposal/myrmidon/src/make/sample.xmk
  
  Index: sample.xmk
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/make/sample.xmk,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- sample.xmk	2000/12/04 13:37:33	1.1
  +++ sample.xmk	2000/12/05 09:22:01	1.2
  @@ -58,7 +58,17 @@
       <property name="blah" value="fred" />
       <property name="${blah}" value="barney" />
   
  +    <register-tasklet task-lib="../../dist/lib/core.tsk" 
  +                      task-name="echo2" 
  +                      classname="org.apache.ant.tasks.core.Echo" />
  +
       <echo message="Doing the funky Echo with ${blah} ${fred} Year=${year}!"/>
  +    <echo2 message="Luke to Echo base. Can you hear me?"/>
  +
  +    <ant-call target="property-test2">
  +      <param name="blah" value="blah-value" />
  +    </ant-call>
  +
     </target>
   
     <target name="property-test2">
  
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/manifest/ant-manifest.mf
  
  Index: ant-manifest.mf
  ===================================================================
  Manifest-Version: 1.0
  Main-Class: org.apache.ant.launcher.AntLoader
  Created-By: Apache Ant Project
  
  
  1.1                  jakarta-ant/proposal/myrmidon/src/manifest/myrmidon-manifest.mf
  
  Index: myrmidon-manifest.mf
  ===================================================================
  Manifest-Version: 1.0
  Main-Class: org.apache.ant.Main
  Class-Path: avalonapi.jar 
  Created-By: Apache Ant Project
  
  
  1.2       +9 -22     jakarta-ant/proposal/myrmidon/src/script/ant
  
  Index: ant
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/script/ant,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ant	2000/12/04 13:37:33	1.1
  +++ ant	2000/12/05 09:22:04	1.2
  @@ -6,7 +6,6 @@
   
   # Cygwin support.
   if [ "$OSTYPE" == "cygwin32" ] || [ "$OSTYPE" = "cygwin" ]; then
  -
     if [ ! "$JAVA_HOME" = "" ]; then
       JAVA_HOME=`cygpath --path --unix $JAVA_HOME`
     fi
  @@ -27,32 +26,20 @@
   done
     
   ANT_HOME=`dirname "$PRG"`/..
  -
  -# Allow .antrc to specifiy flags to java cmd
  -if [ "$JAVACMD" = "" ] ; then 
  -  JAVACMD=java
  -fi
   
  -LOCALCLASSPATH=`echo $ANT_HOME/lib/*.jar | tr ' ' ':'`
  +if [ "$JAVA_HOME" == "" ] ; then
   
  -if [ "$CLASSPATH" != "" ] ; then
  -  LOCALCLASSPATH=$CLASSPATH:$LOCALCLASSPATH
  -fi
  -
  -if [ "$JAVA_HOME" != "" ] ; then
  -  if test -f $JAVA_HOME/lib/tools.jar ; then
  -    LOCALCLASSPATH=$LOCALCLASSPATH:$JAVA_HOME/lib/tools.jar
  -  fi
  -else
     echo "Warning: JAVA_HOME environment variable is not set."
     echo "  If build fails because sun.* classes could not be found"
     echo "  you will need to set the JAVA_HOME environment variable"
     echo "  to the installation directory of java."
  -fi
  -
  -# More Cygwin support
  -if [ "$OSTYPE" == "cygwin32" ] || [ "$OSTYPE" = "cygwin" ] ; then
  -  LOCALCLASSPATH=`cygpath --path --windows "$LOCALCLASSPATH"`
  +  if [ "$JAVACMD" = "" ] ; then 
  +    JAVACMD=java
  +  fi
  +else
  +  if [ "$JAVACMD" = "" ] ; then 
  +    JAVACMD=$JAVA_HOME/bin/java
  +  fi
   fi
   
  -$JAVACMD -classpath $LOCALCLASSPATH $ANT_OPTS org.apache.ant.Main --ant-home=${ANT_HOME} $@
  \ No newline at end of file
  +$JAVACMD $ANT_OPTS -jar ant.jar --ant-home=${ANT_HOME} $@
  \ No newline at end of file
  
  
  
  1.2       +16 -8     jakarta-ant/proposal/myrmidon/src/script/ant.bat
  
  Index: ant.bat
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/script/ant.bat,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- ant.bat	2000/12/04 13:37:33	1.1
  +++ ant.bat	2000/12/05 09:22:04	1.2
  @@ -1,8 +1,8 @@
   @echo off
   
  -:checkJava
  -if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java
  -if not "%JAVA_HOME%" == "" goto setupClasspath
  +if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"
  +
  +if not "%JAVA_HOME%" == "" goto javaCmdSetup
   
   echo.
   echo Warning: JAVA_HOME environment variable is not set.
  @@ -12,11 +12,17 @@
   echo.
   goto end
   
  -:setupClasspath
  -set LOCALCLASSPATH=lib\xerces.jar;lib\ant.jar;lib\avalonapi.jar;%JAVA_HOME%\lib\tools.jar
  +rem hope that there is java command in path
  +if "%JAVACMD%" == "" set JAVACMD=java
  +goto argSetup
   
  -set THIS_FILE=%0
  +rem if JAVA_HOME is set then make sure we use that java exe
  +:javaCmdSetup
  +if "%JAVACMD%" == "" set JAVACMD=%JAVA_HOME%\bin\java
  +
  +:argSetup
   
  +set THIS_FILE=%0
   set ANT_CMD_LINE_ARGS=
   
   rem Slurp all args...
  @@ -29,7 +35,9 @@
   :doneArgs
   rem Mmmmmm tasty - finished slurping args
   
  -%JAVACMD% -classpath "%LOCALCLASSPATH%" %ANT_OPTS% org.apache.ant.Main "--bin-dir=%THIS_FILE%" %ANT_CMD_LINE_ARGS%
  +%JAVACMD% %ANT_OPTS% -jar lib\ant.jar "--bin-dir=%THIS_FILE%" %ANT_CMD_LINE_ARGS%
   
   :end
  -set LOCALCLASSPATH=
  \ No newline at end of file
  +if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"
  +set THIS_FILE=
  +set ANT_CMD_LINE_ARGS=
  \ No newline at end of file
  
  
  

Mime
View raw message