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/main/org/apache/tools/ant/taskdefs/optional/vss MSVSS.java
Date Sun, 30 Dec 2001 01:04:35 GMT
donaldp     01/12/29 17:04:35

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant Project.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ccm
                        Continuus.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/clearcase
                        ClearCase.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb
                        DDCreator.java Ejbc.java
               proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss
                        MSVSS.java
  Log:
  Removed Project.translatePath and replaced it by allowing Files or Path objects be passed
in.
  
  Revision  Changes    Path
  1.15      +0 -36     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/Project.java
  
  Index: Project.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/Project.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Project.java	23 Dec 2001 14:23:47 -0000	1.14
  +++ Project.java	30 Dec 2001 01:04:35 -0000	1.15
  @@ -139,42 +139,6 @@
       }
   
       /**
  -     * Translate a path into its native (platform specific) format. <p>
  -     *
  -     * This method uses the PathTokenizer class to separate the input path into
  -     * its components. This handles DOS style paths in a relatively sensible
  -     * way. The file separators are then converted to their platform specific
  -     * versions.
  -     *
  -     * @param to_process the path to be converted
  -     * @return the native version of to_process or an empty string if to_process
  -     *      is null or empty
  -     */
  -    public static String translatePath( String to_process )
  -    {
  -        if( to_process == null || to_process.length() == 0 )
  -        {
  -            return "";
  -        }
  -
  -        StringBuffer path = new StringBuffer( to_process.length() + 50 );
  -        PathTokenizer tokenizer = new PathTokenizer( to_process );
  -        while( tokenizer.hasMoreTokens() )
  -        {
  -            String pathComponent = tokenizer.nextToken();
  -            pathComponent = pathComponent.replace( '/', File.separatorChar );
  -            pathComponent = pathComponent.replace( '\\', File.separatorChar );
  -            if( path.length() != 0 )
  -            {
  -                path.append( File.pathSeparatorChar );
  -            }
  -            path.append( pathComponent );
  -        }
  -
  -        return path.toString();
  -    }
  -
  -    /**
        * set the ant.java.version property, also tests for unsupported JVM
        * versions, prints the verbose log messages
        *
  
  
  
  1.13      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java
  
  Index: Continuus.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ccm/Continuus.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- Continuus.java	29 Dec 2001 23:53:42 -0000	1.12
  +++ Continuus.java	30 Dec 2001 01:04:35 -0000	1.13
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.optional.ccm;
   
   import java.io.IOException;
  +import java.io.File;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
  @@ -65,9 +66,9 @@
        *
        * @param dir the directory containing the ccm executable
        */
  -    public final void setCcmDir( String dir )
  +    public final void setCcmDir( final File dir )
       {
  -        m_ccmDir = getProject().translatePath( dir );
  +        m_ccmDir = dir.toString();
       }
   
       /**
  
  
  
  1.12      +3 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java
  
  Index: ClearCase.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/clearcase/ClearCase.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ClearCase.java	29 Dec 2001 23:53:57 -0000	1.11
  +++ ClearCase.java	30 Dec 2001 01:04:35 -0000	1.12
  @@ -7,9 +7,9 @@
    */
   package org.apache.tools.ant.taskdefs.optional.clearcase;
   
  +import java.io.File;
   import java.io.IOException;
   import org.apache.myrmidon.api.TaskException;
  -import org.apache.tools.ant.Project;
   import org.apache.tools.ant.Task;
   import org.apache.tools.ant.taskdefs.exec.Execute;
   import org.apache.tools.ant.taskdefs.exec.LogOutputStream;
  @@ -60,9 +60,9 @@
        *
        * @param dir the directory containing the cleartool executable
        */
  -    public final void setClearToolDir( String dir )
  +    public final void setClearToolDir( final File dir )
       {
  -        m_ClearToolDir = getProject().translatePath( dir );
  +        m_ClearToolDir = dir.toString();
       }
   
       /**
  
  
  
  1.8       +3 -3      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreator.java
  
  Index: DDCreator.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/DDCreator.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- DDCreator.java	30 Dec 2001 00:21:52 -0000	1.7
  +++ DDCreator.java	30 Dec 2001 01:04:35 -0000	1.8
  @@ -51,9 +51,9 @@
        *
        * @param s the classpath to use for the ddcreator tool.
        */
  -    public void setClasspath( String s )
  +    public void setClasspath( final Path p )
       {
  -        this.classpath = getProject().translatePath( s );
  +        this.classpath = p.toString();
       }
   
       /**
  @@ -118,7 +118,7 @@
           }
   
           String systemClassPath = System.getProperty( "java.class.path" );
  -        String execClassPath = getProject().translatePath( systemClassPath + ":" + classpath
);
  +        String execClassPath = systemClassPath + File.separator + classpath;
           Java ddCreatorTask = (Java)getProject().createTask( "java" );
           ddCreatorTask.setFork( true );
           ddCreatorTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper"
);
  
  
  
  1.9       +6 -6      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java
  
  Index: Ejbc.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ejb/Ejbc.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Ejbc.java	30 Dec 2001 00:21:52 -0000	1.8
  +++ Ejbc.java	30 Dec 2001 01:04:35 -0000	1.9
  @@ -62,9 +62,9 @@
        *
        * @param s The new Classpath value
        */
  -    public void setClasspath( String s )
  +    public void setClasspath( final Path s )
       {
  -        this.classpath = getProject().translatePath( s );
  +        this.classpath = s.toString();
       }
   
       /**
  @@ -85,9 +85,9 @@
        *
        * @param dirName the name of the directory into which code is generated
        */
  -    public void setDest( String dirName )
  +    public void setDest( final File dirName )
       {
  -        generatedFilesDirectory = new File( dirName );
  +        generatedFilesDirectory = dirName;
       }
   
       public void setKeepgenerated( String newKeepgenerated )
  @@ -159,8 +159,8 @@
           }
   
           String systemClassPath = System.getProperty( "java.class.path" );
  -        String execClassPath = getProject().translatePath( systemClassPath + ":" + classpath
+
  -                                                           ":" + generatedFilesDirectory
);
  +        String execClassPath =
  +            systemClassPath + File.separator + classpath + File.separator + generatedFilesDirectory;
           // get all the files in the descriptor directory
           DirectoryScanner ds = super.getDirectoryScanner( descriptorDirectory );
   
  
  
  
  1.14      +3 -2      jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java
  
  Index: MSVSS.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/vss/MSVSS.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- MSVSS.java	29 Dec 2001 23:58:51 -0000	1.13
  +++ MSVSS.java	30 Dec 2001 01:04:35 -0000	1.14
  @@ -8,6 +8,7 @@
   package org.apache.tools.ant.taskdefs.optional.vss;
   
   import java.io.IOException;
  +import java.io.File;
   import java.util.Properties;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.Project;
  @@ -134,9 +135,9 @@
        *
        * @param dir the directory containing ss.exe
        */
  -    public final void setSsdir( String dir )
  +    public final void setSsdir( final File dir )
       {
  -        m_SSDir = getProject().translatePath( dir );
  +        m_SSDir = dir.toString();
       }
   
       /**
  
  
  

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