donaldp     01/04/11 15:44:20

  Modified:    src/main/org/apache/tools/ant/taskdefs Execute.java
  Log:
  Updated ant to get environment from MacOS X
  
  Submitted By: Archit Shah <[EMAIL PROTECTED]>
  
  Revision  Changes    Path
  1.15      +12 -0     
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java
  
  Index: Execute.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Execute.java,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- Execute.java      2001/02/18 13:44:42     1.14
  +++ Execute.java      2001/04/11 22:44:19     1.15
  @@ -179,6 +179,18 @@
           String osname = System.getProperty("os.name").toLowerCase();
           if ( osname.indexOf("mac os") >= 0 ) {
               // Mac
  +            // Determine if we are running under OS X
  +            try {
  +                float version = 
Float.parseFloat(System.getProperty("os.version"));
  +                if (version >= 10.0) {
  +                    // OS X - just line UNIX
  +                    String[] cmd = {"/usr/bin/env"};
  +                    return cmd;
  +                }
  +            } catch (NumberFormatException e) {
  +                // fall through to OS 9
  +            }
  +            // OS 9 and previous
               // TODO: I have no idea how to get it, someone must fix it
               String[] cmd = null;
               return cmd;
  
  
  

Reply via email to