ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adammurd...@apache.org
Subject cvs commit: jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types PathUtil.java
Date Tue, 26 Mar 2002 02:15:56 GMT
adammurdoch    02/03/25 18:15:56

  Modified:    proposal/myrmidon/src/todo/org/apache/tools/todo/types
                        PathUtil.java
  Log:
  Tidy up addJavaRuntime().
  
  Revision  Changes    Path
  1.5       +15 -19    jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/PathUtil.java
  
  Index: PathUtil.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/PathUtil.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PathUtil.java	21 Mar 2002 08:03:56 -0000	1.4
  +++ PathUtil.java	26 Mar 2002 02:15:56 -0000	1.5
  @@ -14,12 +14,13 @@
   import org.apache.myrmidon.api.TaskContext;
   import org.apache.myrmidon.api.TaskException;
   import org.apache.myrmidon.framework.file.Path;
  +import org.apache.aut.nativelib.Os;
   
   /**
    * Utilities for operating on Path objects.
    *
    * @author <a href="mailto:peter@apache.org">Peter Donald</a>
  - * @version $Revision: 1.4 $ $Date: 2002/03/21 08:03:56 $
  + * @version $Revision: 1.5 $ $Date: 2002/03/26 02:15:56 $
    */
   public class PathUtil
   {
  @@ -105,28 +106,23 @@
               kaffeJarFiles.setIncludes( "*.jar" );
               path.addFileset( kaffeJarFiles );
           }
  +        else if( Os.isFamily( Os.OS_FAMILY_OSX ) )
  +        {
  +            // MacOS X
  +            final String classDir = System.getProperty( "java.home" ) +
  +                File.separator + ".." + File.separator + "Classes";
  +            final File classes = new File( classDir, "classes.jar" );
  +            path.addLocation( classes );
  +            final File ui = new File( classDir, "ui.jar" );
  +            path.addLocation( ui );
  +        }
           else
           {
  -            // JDK > 1.1 seems to set java.home to the JRE directory.
  +            // JDK > 1.1 sets java.home to the JRE directory.
               final String rt = System.getProperty( "java.home" ) +
                   File.separator + "lib" + File.separator + "rt.jar";
  -            path.addLocation( new File( rt ) );
  -            // Just keep the old version as well and let addExisting
  -            // sort it out.
  -            final String rt2 = System.getProperty( "java.home" ) +
  -                File.separator + "jre" + File.separator + "lib" +
  -                File.separator + "rt.jar";
  -            path.addLocation( new File( rt2 ) );
  -
  -            // Added for MacOS X
  -            final String classes = System.getProperty( "java.home" ) +
  -                File.separator + ".." + File.separator + "Classes" +
  -                File.separator + "classes.jar";
  -            path.addLocation( new File( classes ) );
  -            final String ui = System.getProperty( "java.home" ) +
  -                File.separator + ".." + File.separator + "Classes" +
  -                File.separator + "ui.jar";
  -            path.addLocation( new File( ui ) );
  +            final File rtJar = new File( rt );
  +            path.addLocation( rtJar );
           }
       }
   
  
  
  

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