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/exec Execute.java
Date Sun, 23 Dec 2001 02:55:22 GMT
donaldp     01/12/22 18:55:22

  Modified:    proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec
                        Execute.java
  Log:
  Made ExecMetaData take a Properties object for environment data rather than native format.
  
  Revision  Changes    Path
  1.16      +7 -29     jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/exec/Execute.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Execute.java	2001/12/23 00:10:44	1.15
  +++ Execute.java	2001/12/23 02:55:22	1.16
  @@ -44,7 +44,7 @@
   
       private ExecMetaData m_metaData;
       private String[] m_command;
  -    private Properties m_environment;
  +    private Properties m_environment = new Properties();
       private File m_workingDirectory = new File( "." );
       private boolean m_newEnvironment;
   
  @@ -214,6 +214,10 @@
   
       public void setEnvironment( final Properties environment )
       {
  +        if( null == environment )
  +        {
  +            throw new NullPointerException( "environment" );
  +        }
           m_environment = environment;
       }
   
  @@ -274,8 +278,8 @@
           try
           {
               final ExecMetaData metaData =
  -                new ExecMetaData( m_command, getNativeEnvironment(),
  -                                  m_workingDirectory, false );
  +                new ExecMetaData( m_command, m_environment,
  +                                  m_workingDirectory, m_newEnvironment );
   
               final CommandLauncher launcher = getLauncher();
               final Process process = launcher.exec( metaData );
  @@ -340,31 +344,5 @@
               launcher = c_shellLauncher;
           }
           return launcher;
  -    }
  -
  -    /**
  -     * Returns the environment used to create a subprocess.
  -     *
  -     * @return the environment used to create a subprocess
  -     */
  -    private String[] getNativeEnvironment()
  -        throws ExecException
  -    {
  -        if( m_newEnvironment )
  -        {
  -            return Environment.toNativeFormat( m_environment );
  -        }
  -        else
  -        {
  -            try
  -            {
  -                Environment.addNativeEnvironment( m_environment );
  -                return Environment.toNativeFormat( m_environment );
  -            }
  -            catch( final IOException ioe )
  -            {
  -                throw new ExecException( ioe.getMessage(), ioe );
  -            }
  -        }
       }
   }
  
  
  

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