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/antlib/cvslib Cvs.java
Date Sun, 20 Jan 2002 10:09:04 GMT
donaldp     02/01/20 02:09:04

  Modified:    proposal/myrmidon/src/java/org/apache/antlib/cvslib Cvs.java
  Log:
  No Need to use the EnvironmentData/EnvironmentVariable abstraction
  
  Revision  Changes    Path
  1.16      +9 -19     jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Cvs.java
  
  Index: Cvs.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/cvslib/Cvs.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Cvs.java	20 Jan 2002 02:11:42 -0000	1.15
  +++ Cvs.java	20 Jan 2002 10:09:04 -0000	1.16
  @@ -9,12 +9,11 @@
   
   import java.io.File;
   import java.io.IOException;
  +import java.util.Properties;
   import org.apache.myrmidon.api.AbstractTask;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.tools.ant.taskdefs.exec.Execute2;
   import org.apache.tools.ant.types.Commandline;
  -import org.apache.tools.ant.types.EnvironmentData;
  -import org.apache.tools.ant.types.EnvironmentVariable;
   import org.apache.tools.ant.util.FileUtils;
   
   /**
  @@ -24,7 +23,7 @@
    * @author <a href="mailto:costin@dnt.ro">costin@dnt.ro</a>
    * @author <a href="mailto:stefano@apache.org">stefano@apache.org</a>
    * @author <a href="mailto:wwerner@picturesafe.de">Wolfgang Werner</a>
  - * @version $Revision: 1.15 $ $Date: 2002/01/20 02:11:42 $
  + * @version $Revision: 1.16 $ $Date: 2002/01/20 10:09:04 $
    */
   public class Cvs
       extends AbstractTask
  @@ -145,7 +144,7 @@
           throws TaskException
       {
           final Commandline command = buildCommandline();
  -        final EnvironmentData env = buildEnvironment();
  +        final Properties env = buildEnvironment();
   
           final Execute2 exe = new Execute2();
           setupLogger( exe );
  @@ -153,7 +152,7 @@
           exe.setWorkingDirectory( m_dest );
   
           exe.setCommandline( command.getCommandline() );
  -        exe.setEnvironment( env.getVariables() );
  +        exe.setEnvironment( env );
           try
           {
               final int retCode = exe.execute();
  @@ -169,31 +168,22 @@
           }
       }
   
  -    private EnvironmentData buildEnvironment()
  +    private Properties buildEnvironment()
       {
  -        final EnvironmentData env = new EnvironmentData();
  +        final Properties env = new Properties();
           if( 0 < m_port )
           {
  -            final EnvironmentVariable var = new EnvironmentVariable();
  -            var.setKey( "CVS_CLIENT_PORT" );
  -            var.setValue( String.valueOf( m_port ) );
  -            env.addVariable( var );
  +            env.setProperty( "CVS_CLIENT_PORT", String.valueOf( m_port ) );
           }
   
           if( null != m_passwordFile )
           {
  -            final EnvironmentVariable var = new EnvironmentVariable();
  -            var.setKey( "CVS_PASSFILE" );
  -            var.setValue( String.valueOf( m_passwordFile ) );
  -            env.addVariable( var );
  +            env.setProperty( "CVS_PASSFILE", String.valueOf( m_passwordFile ) );
           }
   
           if( null != m_cvsRsh )
           {
  -            final EnvironmentVariable var = new EnvironmentVariable();
  -            var.setKey( "CVS_RSH" );
  -            var.setValue( String.valueOf( m_cvsRsh ) );
  -            env.addVariable( var );
  +            env.setProperty( "CVS_RSH", String.valueOf( m_cvsRsh ) );
           }
           return env;
       }
  
  
  

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