ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dona...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api AbstractTask.java
Date Mon, 18 Feb 2002 09:02:41 GMT
donaldp     02/02/18 01:02:41

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
                        XMLResultAggregator.java JUnitTask.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        WLRun.java WebsphereDeploymentTool.java
                        WeblogicDeploymentTool.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs
                        Tstamp.java SQLExec.java Rmic.java Javac.java
                        Available.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce
                        P4Base.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
                        NetRexxC.java IContract.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss
                        MSVSSGET.java MSVSSCHECKOUT.java MSVSSCHECKIN.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata
                        MParse.java AbstractMetamataTask.java
               proposal/myrmidon/src/java/org/apache/antlib/core
                        LoadProperties.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp
                        JspC.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc
                        JJTree.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc
                        Javadoc.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition
                        IsSet.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net
                        FTP.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka
                        CovReport.java CovMerge.java Coverage.java
               proposal/myrmidon/src/java/org/apache/myrmidon/api
                        AbstractTask.java
  Log:
  Inlined a large number of methods from AbstractTask
  
  Revision  Changes    Path
  1.18      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java
  
  Index: XMLResultAggregator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/XMLResultAggregator.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- XMLResultAggregator.java	6 Feb 2002 13:38:01 -0000	1.17
  +++ XMLResultAggregator.java	18 Feb 2002 09:02:39 -0000	1.18
  @@ -19,6 +19,7 @@
   import javax.xml.parsers.DocumentBuilderFactory;
   import org.apache.avalon.framework.ExceptionUtil;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.types.FileSet;
  @@ -184,7 +185,7 @@
           }
           if( toDir == null )
           {
  -            toDir = resolveFile( DEFAULT_DIR );
  +            toDir = getContext().resolveFile( DEFAULT_DIR );
           }
           return new File( toDir, toFile );
       }
  @@ -211,7 +212,7 @@
                   if( pathname.endsWith( ".xml" ) )
                   {
                       File file = new File( scanner.getBasedir(), pathname );
  -                    file = resolveFile( file.getPath() );
  +                    file = getContext().resolveFile( file.getPath() );
                       v.add( file );
                   }
               }
  
  
  
  1.40      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
  
  Index: JUnitTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
  retrieving revision 1.39
  retrieving revision 1.40
  diff -u -r1.39 -r1.40
  --- JUnitTask.java	14 Feb 2002 11:03:59 -0000	1.39
  +++ JUnitTask.java	18 Feb 2002 09:02:39 -0000	1.40
  @@ -21,6 +21,7 @@
   import org.apache.aut.nativelib.ExecManager;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.Argument;
  @@ -430,8 +431,8 @@
           {
               String filename = test.getOutfile() + fe.getExtension();
               File destFile = new File( test.getTodir(), filename );
  -            String absFilename = destFile.getAbsolutePath();
  -            return resolveFile( absFilename );
  +            final String absFilename = destFile.getAbsolutePath();
  +            return getContext().resolveFile( absFilename );
           }
           return null;
       }
  
  
  
  1.10      +4 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLRun.java
  
  Index: WLRun.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WLRun.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- WLRun.java	15 Jan 2002 09:51:08 -0000	1.9
  +++ WLRun.java	18 Feb 2002 09:02:39 -0000	1.10
  @@ -9,6 +9,7 @@
   
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.types.Path;
  @@ -309,7 +310,7 @@
           if( !propertiesFile.exists() )
           {
               // OK, properties file may be absolute
  -            propertiesFile = resolveFile( weblogicPropertiesFile );
  +            propertiesFile = getContext().resolveFile( weblogicPropertiesFile );
               if( !propertiesFile.exists() )
               {
                   throw new TaskException( "Properties file " + weblogicPropertiesFile +
  @@ -415,7 +416,8 @@
           // absolute path.  Use the project to resolve it.
           if( this.securityPolicy != null && !securityPolicyFile.exists() )
           {
  -            securityPolicyFile = resolveFile( securityPolicy );
  +            final String filename = securityPolicy;
  +            securityPolicyFile = getContext().resolveFile( filename );
           }
           // If we still can't find it, complain
           if( !securityPolicyFile.exists() )
  
  
  
  1.18      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java
  
  Index: WebsphereDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WebsphereDeploymentTool.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- WebsphereDeploymentTool.java	6 Feb 2002 13:38:00 -0000	1.17
  +++ WebsphereDeploymentTool.java	18 Feb 2002 09:02:39 -0000	1.18
  @@ -19,6 +19,7 @@
   import java.util.jar.JarFile;
   import java.util.jar.JarOutputStream;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.types.Argument;
   import org.apache.tools.ant.types.EnumeratedAttribute;
  @@ -967,7 +968,7 @@
   
                   EnvironmentVariable var = new EnvironmentVariable();
                   var.setKey( "websphere.lib.dir" );
  -                final String webshpereHome = getTask().getProperty( "websphere.home" ).toString();
  +                final String webshpereHome = getTask().getContext().getProperty( "websphere.home"
).toString();
                   var.setValue( webshpereHome + "/lib" );
                   javaTask.addSysproperty( var );
   
  
  
  
  1.17      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java
  
  Index: WeblogicDeploymentTool.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/WeblogicDeploymentTool.java,v
  retrieving revision 1.16
  retrieving revision 1.17
  diff -u -r1.16 -r1.17
  --- WeblogicDeploymentTool.java	6 Feb 2002 13:38:00 -0000	1.16
  +++ WeblogicDeploymentTool.java	18 Feb 2002 09:02:39 -0000	1.17
  @@ -23,6 +23,7 @@
   import javax.xml.parsers.SAXParserFactory;
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.taskdefs.Java;
   import org.apache.tools.ant.types.Path;
   import org.apache.tools.ant.types.PathUtil;
  @@ -808,7 +809,7 @@
               {
                   // try to use the compiler specified by build.compiler. Right now we are
just going
                   // to allow Jikes
  -                String buildCompiler = getTask().getProperty( "build.compiler" ).toString();
  +                String buildCompiler = getTask().getContext().getProperty( "build.compiler"
).toString();
                   if( buildCompiler != null && buildCompiler.equals( "jikes" ) )
                   {
                       javaTask.createArg().setValue( "-compiler" );
  
  
  
  1.15      +7 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
  
  Index: Tstamp.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tstamp.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Tstamp.java	6 Feb 2002 13:38:21 -0000	1.14
  +++ Tstamp.java	18 Feb 2002 09:02:39 -0000	1.15
  @@ -211,7 +211,7 @@
               field = unit.getCalendarField();
           }
   
  -        public void execute( Date date )
  +        public void execute( final Date date )
               throws TaskException
           {
               if( propertyName == null )
  @@ -237,18 +237,20 @@
               {
                   sdf = new SimpleDateFormat( pattern, new Locale( language, country, variant
) );
               }
  +
  +            Date time = date;
               if( offset != 0 )
               {
  -                Calendar calendar = Calendar.getInstance();
  -                calendar.setTime( date );
  +                final Calendar calendar = Calendar.getInstance();
  +                calendar.setTime( time );
                   calendar.add( field, offset );
  -                date = calendar.getTime();
  +                time = calendar.getTime();
               }
               if( timeZone != null )
               {
                   sdf.setTimeZone( timeZone );
               }
  -            getContext().setProperty( propertyName, sdf.format( date ) );
  +            getContext().setProperty( propertyName, sdf.format( time ) );
           }
       }
   }
  
  
  
  1.25      +3 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java
  
  Index: SQLExec.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/SQLExec.java,v
  retrieving revision 1.24
  retrieving revision 1.25
  diff -u -r1.24 -r1.25
  --- SQLExec.java	6 Feb 2002 13:38:20 -0000	1.24
  +++ SQLExec.java	18 Feb 2002 09:02:39 -0000	1.25
  @@ -33,6 +33,7 @@
   import java.util.Properties;
   import java.util.StringTokenizer;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.DirectoryScanner;
   import org.apache.tools.ant.types.EnumeratedAttribute;
  @@ -734,7 +735,8 @@
               while( ( line = in.readLine() ) != null )
               {
                   line = line.trim();
  -                line = "" + resolveValue( line );
  +                final String value = line;
  +                line = "" + getContext().resolveValue( value );
                   if( line.startsWith( "//" ) )
                   {
                       continue;
  
  
  
  1.27      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java
  
  Index: Rmic.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Rmic.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Rmic.java	6 Feb 2002 13:38:20 -0000	1.26
  +++ Rmic.java	18 Feb 2002 09:02:39 -0000	1.27
  @@ -15,6 +15,7 @@
   import java.util.ArrayList;
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.taskdefs.rmic.RmicAdapter;
   import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory;
   import org.apache.tools.ant.types.DirectoryScanner;
  @@ -479,7 +480,7 @@
               getLogger().info( "Verify has been turned on." );
           }
   
  -        String compiler = getProperty( "build.rmic" ).toString();
  +        String compiler = getContext().getProperty( "build.rmic" ).toString();
           RmicAdapter adapter = RmicAdapterFactory.getRmic( compiler, this );
   
           // now we need to populate the compiler adapter
  
  
  
  1.28      +5 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java
  
  Index: Javac.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javac.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- Javac.java	6 Feb 2002 13:38:20 -0000	1.27
  +++ Javac.java	18 Feb 2002 09:02:39 -0000	1.28
  @@ -12,6 +12,7 @@
   import java.util.Iterator;
   import org.apache.aut.nativelib.Os;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.framework.JavaVersion;
   import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter;
   import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory;
  @@ -629,7 +630,7 @@
       public boolean isForkedJavac()
       {
           return !"false".equals( fork ) ||
  -            "extJavac".equals( getProperty( "build.compiler" ) );
  +            "extJavac".equals( getContext().getProperty( "build.compiler" ) );
       }
   
       /**
  @@ -675,7 +676,8 @@
           resetFileLists();
           for( int i = 0; i < list.length; i++ )
           {
  -            File srcDir = (File)resolveFile( list[ i ] );
  +            final String filename = list[ i ];
  +            File srcDir = (File)getContext().resolveFile( filename );
               if( !srcDir.exists() )
               {
                   throw new TaskException( "srcdir \"" + srcDir.getPath() + "\" does not
exist!" );
  @@ -794,7 +796,7 @@
   
       private String determineCompiler()
       {
  -        Object compiler = getProperty( "build.compiler" );
  +        Object compiler = getContext().getProperty( "build.compiler" );
   
           if( !"false".equals( fork ) )
           {
  
  
  
  1.22      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java
  
  Index: Available.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Available.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- Available.java	6 Feb 2002 13:38:20 -0000	1.21
  +++ Available.java	18 Feb 2002 09:02:39 -0000	1.22
  @@ -11,6 +11,7 @@
   import java.net.URL;
   import java.net.URLClassLoader;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.taskdefs.condition.Condition;
   import org.apache.tools.ant.types.Path;
  @@ -193,7 +194,7 @@
       {
           if( m_filepath == null )
           {
  -            return checkFile( resolveFile( m_file ), m_file );
  +            return checkFile( getContext().resolveFile( m_file ), m_file );
           }
           else
           {
  
  
  
  1.21      +4 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
  
  Index: P4Base.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- P4Base.java	10 Feb 2002 01:01:11 -0000	1.20
  +++ P4Base.java	18 Feb 2002 09:02:39 -0000	1.21
  @@ -10,6 +10,7 @@
   import org.apache.aut.nativelib.ExecManager;
   import org.apache.aut.nativelib.ExecOutputHandler;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.oro.text.perl.Perl5Util;
   import org.apache.tools.ant.types.Commandline;
  @@ -103,15 +104,15 @@
           //Get default P4 settings from environment - Mark would have done something cool
with
           //introspection here.....:-)
           Object tmpprop;
  -        if( ( tmpprop = getProperty( "p4.port" ) ) != null )
  +        if( ( tmpprop = getContext().getProperty( "p4.port" ) ) != null )
           {
               setPort( tmpprop.toString() );
           }
  -        if( ( tmpprop = getProperty( "p4.client" ) ) != null )
  +        if( ( tmpprop = getContext().getProperty( "p4.client" ) ) != null )
           {
               setClient( tmpprop.toString() );
           }
  -        if( ( tmpprop = getProperty( "p4.user" ) ) != null )
  +        if( ( tmpprop = getContext().getProperty( "p4.user" ) ) != null )
           {
               setUser( tmpprop.toString() );
           }
  
  
  
  1.15      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java
  
  Index: NetRexxC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/NetRexxC.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- NetRexxC.java	6 Feb 2002 13:37:59 -0000	1.14
  +++ NetRexxC.java	18 Feb 2002 09:02:39 -0000	1.15
  @@ -20,6 +20,7 @@
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.avalon.excalibur.util.StringUtil;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.types.DirectoryScanner;
   
  @@ -585,11 +586,11 @@
       private void addExistingToClasspath( StringBuffer target, String source )
           throws TaskException
       {
  -        StringTokenizer tok = new StringTokenizer( source,
  +        final StringTokenizer tok = new StringTokenizer( source,
                                                      System.getProperty( "path.separator"
), false );
           while( tok.hasMoreTokens() )
           {
  -            File f = resolveFile( tok.nextToken() );
  +            File f = getContext().resolveFile( tok.nextToken() );
   
               if( f.exists() )
               {
  
  
  
  1.20      +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/IContract.java
  
  Index: IContract.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/IContract.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- IContract.java	13 Feb 2002 03:02:55 -0000	1.19
  +++ IContract.java	18 Feb 2002 09:02:39 -0000	1.20
  @@ -15,6 +15,7 @@
   import java.util.Date;
   import java.util.Properties;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.listeners.AbstractProjectListener;
   import org.apache.myrmidon.listeners.LogEvent;
   import org.apache.tools.ant.taskdefs.Java;
  @@ -716,7 +717,7 @@
               Path baseClasspath = createClasspath();
   
               // Might need to add the core classes if we're not using Sun's Javac (like
Jikes)
  -            String compiler = getProperty( "build.compiler" ).toString();
  +            String compiler = getContext().getProperty( "build.compiler" ).toString();
               ClasspathHelper classpathHelper = new ClasspathHelper( compiler );
               classpathHelper.modify( baseClasspath );
   
  
  
  
  1.8       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java
  
  Index: MSVSSGET.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSGET.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MSVSSGET.java	20 Jan 2002 02:11:44 -0000	1.7
  +++ MSVSSGET.java	18 Feb 2002 09:02:40 -0000	1.8
  @@ -9,6 +9,7 @@
   
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
   
  @@ -379,7 +380,7 @@
           else
           {
               // make sure m_LocalDir exists, create it if it doesn't
  -            File dir = resolveFile( m_LocalPath );
  +            File dir = getContext().resolveFile( m_LocalPath );
               if( !dir.exists() )
               {
                   boolean done = dir.mkdirs();
  
  
  
  1.8       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java
  
  Index: MSVSSCHECKOUT.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKOUT.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MSVSSCHECKOUT.java	20 Jan 2002 02:11:44 -0000	1.7
  +++ MSVSSCHECKOUT.java	18 Feb 2002 09:02:40 -0000	1.8
  @@ -9,6 +9,7 @@
   
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
   
  @@ -171,7 +172,7 @@
           else
           {
               // make sure m_LocalDir exists, create it if it doesn't
  -            File dir = resolveFile( m_LocalPath );
  +            File dir = getContext().resolveFile( m_LocalPath );
               if( !dir.exists() )
               {
                   boolean done = dir.mkdirs();
  
  
  
  1.8       +2 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKIN.java
  
  Index: MSVSSCHECKIN.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSSCHECKIN.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MSVSSCHECKIN.java	20 Jan 2002 02:11:44 -0000	1.7
  +++ MSVSSCHECKIN.java	18 Feb 2002 09:02:40 -0000	1.8
  @@ -9,6 +9,7 @@
   
   import java.io.File;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.Path;
   
  @@ -144,7 +145,7 @@
           else
           {
               // make sure m_LocalDir exists, create it if it doesn't
  -            File dir = resolveFile( m_LocalPath );
  +            File dir = getContext().resolveFile( m_LocalPath );
               if( !dir.exists() )
               {
                   boolean done = dir.mkdirs();
  
  
  
  1.27      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java
  
  Index: MParse.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/MParse.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- MParse.java	10 Feb 2002 01:01:12 -0000	1.26
  +++ MParse.java	18 Feb 2002 09:02:40 -0000	1.27
  @@ -16,6 +16,7 @@
   import org.apache.aut.nativelib.ExecManager;
   import org.apache.avalon.excalibur.io.IOUtil;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.Argument;
  @@ -309,7 +310,7 @@
           {
               throw new TaskException( "'metamatahome' must point to Metamata home directory."
);
           }
  -        m_metahome = resolveFile( m_metahome.getPath() );
  +        m_metahome = getContext().resolveFile( m_metahome.getPath() );
   
           // check that the needed jar exists.
           File[] jars = getMetamataLibs();
  @@ -326,7 +327,7 @@
           {
               throw new TaskException( "Invalid target: " + m_target );
           }
  -        m_target = resolveFile( m_target.getPath() );
  +        m_target = getContext().resolveFile( m_target.getPath() );
       }
   
       /**
  
  
  
  1.29      +1 -1      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java
  
  Index: AbstractMetamataTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/metamata/AbstractMetamataTask.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- AbstractMetamataTask.java	10 Feb 2002 01:01:12 -0000	1.28
  +++ AbstractMetamataTask.java	18 Feb 2002 09:02:40 -0000	1.29
  @@ -249,7 +249,7 @@
           {
               throw new TaskException( "'metamatahome' must point to Metamata home directory."
);
           }
  -        m_metamataHome = resolveFile( m_metamataHome.getPath() );
  +        m_metamataHome = getContext().resolveFile( m_metamataHome.getPath() );
           File jar = getMetamataJar( m_metamataHome );
           if( !jar.exists() )
           {
  
  
  
  1.6       +1 -1      jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/LoadProperties.java
  
  Index: LoadProperties.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/LoadProperties.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- LoadProperties.java	3 Feb 2002 03:37:48 -0000	1.5
  +++ LoadProperties.java	18 Feb 2002 09:02:40 -0000	1.6
  @@ -113,7 +113,7 @@
       {
           try
           {
  -            final Object objectValue = resolveValue( value.toString() );
  +            final Object objectValue = getContext().resolveValue( value.toString() );
               final String name1 = m_prefix + name;
               getContext().setProperty( name1, objectValue );
           }
  
  
  
  1.18      +5 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java
  
  Index: JspC.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/jsp/JspC.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- JspC.java	6 Feb 2002 13:38:01 -0000	1.17
  +++ JspC.java	18 Feb 2002 09:02:40 -0000	1.18
  @@ -11,6 +11,7 @@
   import java.util.ArrayList;
   import java.util.Date;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.taskdefs.MatchingTask;
   import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapter;
   import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapterFactory;
  @@ -56,7 +57,7 @@
    *      </a>
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
    * @author <a href="mailto:jayglanville@home.com">J D Glanville</a>
  - * @version $Revision: 1.17 $ $Date: 2002/02/06 13:38:01 $
  + * @version $Revision: 1.18 $ $Date: 2002/02/18 09:02:40 $
    */
   public class JspC extends MatchingTask
   {
  @@ -355,7 +356,8 @@
           int filecount = 0;
           for( int i = 0; i < list.length; i++ )
           {
  -            File srcDir = (File)resolveFile( list[ i ] );
  +            final String filename = list[ i ];
  +            File srcDir = (File)getContext().resolveFile( filename );
               if( !srcDir.exists() )
               {
                   throw new TaskException( "srcdir \"" + srcDir.getPath() +
  @@ -371,7 +373,7 @@
   
           // compile the source files
   
  -        Object compiler = getProperty( "jsp.compiler" );
  +        Object compiler = getContext().getProperty( "jsp.compiler" );
           if( compiler == null )
           {
               compiler = "jasper";
  
  
  
  1.28      +1 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java
  
  Index: JJTree.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/javacc/JJTree.java,v
  retrieving revision 1.27
  retrieving revision 1.28
  diff -u -r1.27 -r1.28
  --- JJTree.java	10 Feb 2002 01:01:12 -0000	1.27
  +++ JJTree.java	18 Feb 2002 09:02:40 -0000	1.28
  @@ -8,13 +8,12 @@
   package org.apache.tools.ant.taskdefs.optional.javacc;
   
   import java.io.File;
  -import java.io.IOException;
   import java.util.Enumeration;
   import java.util.Hashtable;
   import org.apache.aut.nativelib.ExecManager;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.Task;
   import org.apache.myrmidon.framework.Execute;
  +import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.Commandline;
   import org.apache.tools.ant.types.CommandlineJava;
   import org.apache.tools.ant.types.Path;
  @@ -29,7 +28,6 @@
    */
   public class JJTree extends Task
   {
  -
       // keys to optional attributes
       private final static String BUILD_NODE_FILES = "BUILD_NODE_FILES";
       private final static String MULTI = "MULTI";
  
  
  
  1.27      +7 -5      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java
  
  Index: Javadoc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/javadoc/Javadoc.java,v
  retrieving revision 1.26
  retrieving revision 1.27
  diff -u -r1.26 -r1.27
  --- Javadoc.java	10 Feb 2002 01:01:12 -0000	1.26
  +++ Javadoc.java	18 Feb 2002 09:02:40 -0000	1.27
  @@ -19,6 +19,7 @@
   import org.apache.aut.nativelib.ExecOutputHandler;
   import org.apache.aut.nativelib.Os;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.myrmidon.framework.Pattern;
   import org.apache.tools.ant.Task;
  @@ -260,14 +261,14 @@
           {
               throw new TaskException( linkOfflineError );
           }
  -        StringTokenizer tok = new StringTokenizer( src, " ", false );
  +        final StringTokenizer tok = new StringTokenizer( src, " ", false );
           le.setHref( tok.nextToken() );
   
           if( !tok.hasMoreTokens() )
           {
               throw new TaskException( linkOfflineError );
           }
  -        le.setPackagelistLoc( resolveFile( tok.nextToken() ) );
  +        le.setPackagelistLoc( getContext().resolveFile( tok.nextToken() ) );
       }
   
       public void setLocale( String src )
  @@ -370,9 +371,9 @@
           StringTokenizer tok = new StringTokenizer( src, "," );
           while( tok.hasMoreTokens() )
           {
  -            String f = tok.nextToken();
  +            final String f = tok.nextToken();
               SourceFile sf = new SourceFile();
  -            sf.setFile( resolveFile( f ) );
  +            sf.setFile( getContext().resolveFile( f ) );
               addSource( sf );
           }
       }
  @@ -978,7 +979,8 @@
   
               for( int j = 0; j < list.length; j++ )
               {
  -                final File source = resolveFile( list[ j ] );
  +                final String filename = list[ j ];
  +                final File source = getContext().resolveFile( filename );
                   fs.setDir( source );
   
                   final DirectoryScanner ds = ScannerUtil.getDirectoryScanner( fs );
  
  
  
  1.5       +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/IsSet.java
  
  Index: IsSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/condition/IsSet.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- IsSet.java	6 Jan 2002 01:54:51 -0000	1.4
  +++ IsSet.java	18 Feb 2002 09:02:40 -0000	1.5
  @@ -8,13 +8,14 @@
   package org.apache.tools.ant.taskdefs.condition;
   
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.ProjectComponent;
   
   /**
    * Condition that tests whether a given property has been set.
    *
    * @author <a href="mailto:stefan.bodewig@epost.de">Stefan Bodewig</a>
  - * @version $Revision: 1.4 $
  + * @version $Revision: 1.5 $
    */
   public class IsSet extends ProjectComponent implements Condition
   {
  @@ -33,7 +34,7 @@
               throw new TaskException( "No property specified for isset condition" );
           }
   
  -        return getProperty( property ) != null;
  +        return getContext().getProperty( property ) != null;
       }
   
   }
  
  
  
  1.16      +7 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java
  
  Index: FTP.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/net/FTP.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- FTP.java	6 Feb 2002 13:38:02 -0000	1.15
  +++ FTP.java	18 Feb 2002 09:02:40 -0000	1.16
  @@ -24,6 +24,7 @@
   import org.apache.avalon.excalibur.io.FileUtil;
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.types.FileScanner;
   import org.apache.tools.ant.types.FileSet;
  @@ -399,7 +400,10 @@
           OutputStream outstream = null;
           try
           {
  -            final File file = FileUtil.resolveFile( resolveFile( dir ), filename );
  +            final String filename1 = dir;
  +            File result;
  +            result = getContext().resolveFile( filename1 );
  +            final File file = FileUtil.resolveFile( result, filename );
   
               if( m_newerOnly && isUpToDate( ftp, file, remoteResolveFile( filename
) ) )
               {
  @@ -697,13 +701,13 @@
        * @exception IOException Description of Exception
        * @exception TaskException Description of Exception
        */
  -    protected void sendFile( FTPClient ftp, String dir, String filename )
  +    protected void sendFile( FTPClient ftp, final String dir, final String filename )
           throws IOException, TaskException
       {
           InputStream instream = null;
           try
           {
  -            File file = resolveFile( new File( dir, filename ).getPath() );
  +            File file = getContext().resolveFile( new File( dir, filename ).getPath() );
   
               if( m_newerOnly && isUpToDate( ftp, file, remoteResolveFile( filename
) ) )
               {
  
  
  
  1.23      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java
  
  Index: CovReport.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovReport.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- CovReport.java	10 Feb 2002 00:46:51 -0000	1.22
  +++ CovReport.java	18 Feb 2002 09:02:40 -0000	1.23
  @@ -19,6 +19,7 @@
   import javax.xml.transform.stream.StreamResult;
   import org.apache.aut.nativelib.ExecManager;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.Task;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.tools.ant.types.Commandline;
  @@ -290,8 +291,8 @@
           {
               v.add( "-filters=" + filters );
           }
  -        v.add( "-output=" + resolveFile( tofile.getPath() ) );
  -        v.add( "-snapshot=" + resolveFile( snapshot.getPath() ) );
  +        v.add( "-output=" + getContext().resolveFile( tofile.getPath() ) );
  +        v.add( "-snapshot=" + getContext().resolveFile( snapshot.getPath() ) );
           // as a default -sourcepath use . in JProbe, so use project .
           if( sourcePath == null )
           {
  
  
  
  1.22      +4 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java
  
  Index: CovMerge.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/CovMerge.java,v
  retrieving revision 1.21
  retrieving revision 1.22
  diff -u -r1.21 -r1.22
  --- CovMerge.java	10 Feb 2002 00:46:51 -0000	1.21
  +++ CovMerge.java	18 Feb 2002 09:02:40 -0000	1.22
  @@ -15,6 +15,7 @@
   import java.util.Random;
   import org.apache.aut.nativelib.ExecManager;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.Task;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.tools.ant.types.Commandline;
  @@ -158,8 +159,8 @@
               for( int j = 0; j < f.length; j++ )
               {
                   String pathname = f[ j ];
  -                File file = new File( ds.getBasedir(), pathname );
  -                file = resolveFile( file.getPath() );
  +                final File file = new File( ds.getBasedir(), pathname );
  +                file = getContext().resolveFile( file.getPath() );
                   v.add( file );
               }
           }
  @@ -215,7 +216,7 @@
                   pw.println( snapshots[ i ].getAbsolutePath() );
               }
               // last file is the output snapshot
  -            pw.println( resolveFile( tofile.getPath() ) );
  +            pw.println( getContext().resolveFile( tofile.getPath() ) );
               pw.flush();
           }
           catch( IOException e )
  
  
  
  1.23      +4 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java
  
  Index: Coverage.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sitraka/Coverage.java,v
  retrieving revision 1.22
  retrieving revision 1.23
  diff -u -r1.22 -r1.23
  --- Coverage.java	10 Feb 2002 00:46:51 -0000	1.22
  +++ Coverage.java	18 Feb 2002 09:02:40 -0000	1.23
  @@ -15,6 +15,7 @@
   import java.util.ArrayList;
   import org.apache.aut.nativelib.ExecManager;
   import org.apache.myrmidon.api.TaskException;
  +import org.apache.myrmidon.api.AbstractTask;
   import org.apache.tools.ant.Task;
   import org.apache.myrmidon.framework.Execute;
   import org.apache.tools.ant.types.Argument;
  @@ -291,7 +292,7 @@
           }
           if( m_javaExe != null )
           {
  -            params.add( "-jp_java_exe=" + resolveFile( m_javaExe.getPath() ) );
  +            params.add( "-jp_java_exe=" + getContext().resolveFile( m_javaExe.getPath()
) );
           }
           params.add( "-jp_working_dir=" + m_workingDir.getPath() );
           params.add( "-jp_snapshot_dir=" + m_snapshotDir.getPath() );
  @@ -366,7 +367,7 @@
           {
               m_snapshotDir = new File( "." );
           }
  -        m_snapshotDir = resolveFile( m_snapshotDir.getPath() );
  +        m_snapshotDir = getContext().resolveFile( m_snapshotDir.getPath() );
           if( !m_snapshotDir.isDirectory() || !m_snapshotDir.exists() )
           {
               throw new TaskException( "Snapshot directory does not exists :" + m_snapshotDir
);
  @@ -375,7 +376,7 @@
           {
               m_workingDir = new File( "." );
           }
  -        m_workingDir = resolveFile( m_workingDir.getPath() );
  +        m_workingDir = getContext().resolveFile( m_workingDir.getPath() );
   
           // check for info, do your best to select the java executable.
           // JProbe 3.0 fails if there is no javaexe option. So
  
  
  
  1.20      +1 -30     jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/AbstractTask.java
  
  Index: AbstractTask.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/api/AbstractTask.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- AbstractTask.java	15 Feb 2002 07:34:24 -0000	1.19
  +++ AbstractTask.java	18 Feb 2002 09:02:41 -0000	1.20
  @@ -15,7 +15,7 @@
    * This is the class that Task writers should extend to provide custom tasks.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.19 $ $Date: 2002/02/15 07:34:24 $
  + * @version $Revision: 1.20 $ $Date: 2002/02/18 09:02:41 $
    */
   public abstract class AbstractTask
       extends AbstractLogEnabled
  @@ -56,45 +56,16 @@
           return m_context;
       }
   
  -    protected final Object get( final Object key )
  -        throws ContextException
  -    {
  -        return getContext().get( key );
  -    }
  -
       //Needs to be made protected
       public final File getBaseDirectory()
       {
           return getContext().getBaseDirectory();
       }
   
  -    protected final File resolveFile( final String filename )
  -        throws TaskException
  -    {
  -        return getContext().resolveFile( filename );
  -    }
  -
  -    protected final Object resolveValue( final String value )
  -        throws TaskException
  -    {
  -        return getContext().resolveValue( value );
  -    }
  -
  -    protected final Object getProperty( final String name )
  -    {
  -        return getContext().getProperty( name );
  -    }
  -
       ///HACK: Make this protected
       public final Object getService( final Class serviceClass )
           throws TaskException
       {
           return getContext().getService( serviceClass );
  -    }
  -
  -    protected final TaskContext createSubContext( final String name )
  -        throws TaskException
  -    {
  -        return getContext().createSubContext( name );
       }
   }
  
  
  

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