adammurdoch 02/03/27 22:29:31
Modified: proposal/myrmidon/src/todo/org/apache/tools/todo/types
PathUtil.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc
JJTree.java JavaCC.java
proposal/myrmidon/src/java/org/apache/antlib/java
JikesAdaptor.java
Added: proposal/myrmidon/src/java/org/apache/myrmidon/framework/java
JavaRuntimeClassPath.java
Log:
Moved PathUtil.addJavaRuntime() into a new <java-runtime> FileList
implementation.
Revision Changes Path
1.7 +1 -45
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.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- PathUtil.java 27 Mar 2002 07:04:17 -0000 1.6
+++ PathUtil.java 28 Mar 2002 06:29:31 -0000 1.7
@@ -23,7 +23,7 @@
* Utilities for operating on Path objects.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.6 $ $Date: 2002/03/27 07:04:17 $
+ * @version $Revision: 1.7 $ $Date: 2002/03/28 06:29:31 $
*/
public class PathUtil
{
@@ -138,50 +138,6 @@
catch( final ClassLoaderException e )
{
throw new TaskException( e.getMessage(), e );
- }
- }
-
- /**
- * Adds this JVM's runtime to a path.
- */
- public static void addJavaRuntime( final Path path )
- throws TaskException
- {
- if( System.getProperty( "java.vendor" ).toLowerCase( Locale.US
).indexOf( "microsoft" ) >= 0 )
- {
- // Pull in *.zip from packages directory
- FileSet msZipFiles = new FileSet();
- msZipFiles.setDir( new File( System.getProperty( "java.home" ) +
File.separator + "Packages" ) );
- msZipFiles.setIncludes( "*.ZIP" );
- path.addFileset( msZipFiles );
- }
- else if( "Kaffe".equals( System.getProperty( "java.vm.name" ) ) )
- {
- FileSet kaffeJarFiles = new FileSet();
- kaffeJarFiles.setDir( new File( System.getProperty( "java.home" )
- + File.separator + "share"
- + File.separator + "kaffe" ) );
-
- 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 sets java.home to the JRE directory.
- final String rt = System.getProperty( "java.home" ) +
- File.separator + "lib" + File.separator + "rt.jar";
- final File rtJar = new File( rt );
- path.addLocation( rtJar );
}
}
1.7 +0 -1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JJTree.java
Index: JJTree.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JJTree.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- JJTree.java 22 Mar 2002 07:18:07 -0000 1.6
+++ JJTree.java 28 Mar 2002 06:29:31 -0000 1.7
@@ -167,7 +167,6 @@
}
final Path classpath = exe.getClassPath();
classpath.addLocation( new File( javaccHome, "JavaCC.zip" ) );
- PathUtil.addJavaRuntime( classpath );
exe.setMaxMemory( "140M" );
exe.getSysProperties().addVariable( "install.root",
javaccHome.getAbsolutePath() );
1.6 +0 -1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JavaCC.java
Index: JavaCC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javacc/JavaCC.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JavaCC.java 21 Mar 2002 08:03:55 -0000 1.5
+++ JavaCC.java 28 Mar 2002 06:29:31 -0000 1.6
@@ -222,7 +222,6 @@
final Path classpath = exe.getClassPath();
classpath.addLocation( new File( javaccHome, "JavaCC.zip" ) );
- PathUtil.addJavaRuntime( classpath );
exe.setMaxMemory( "140M" );
exe.getSysProperties().addVariable( "install.root",
javaccHome.getAbsolutePath() );
1.1
jakarta-ant/proposal/myrmidon/src/java/org/apache/myrmidon/framework/java/JavaRuntimeClassPath.java
Index: JavaRuntimeClassPath.java
===================================================================
/*
* Copyright (C) The Apache Software Foundation. All rights reserved.
*
* This software is published under the terms of the Apache Software License
* version 1.1, a copy of which has been included with this distribution in
* the LICENSE.txt file.
*/
package org.apache.myrmidon.framework.java;
import org.apache.myrmidon.framework.file.FileList;
import org.apache.myrmidon.framework.file.Path;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.FileSet;
import org.apache.aut.nativelib.Os;
import java.util.Locale;
import java.io.File;
/**
* A FileList that evaluates to the runtime class-path for this JVM.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
* @version $Revision: 1.1 $ $Date: 2002/03/28 06:29:31 $
*
* @ant.type type="path" name="java-runtime"
*/
public class JavaRuntimeClassPath
implements FileList
{
/**
* Returns the files in this list.
*
* @param context the context to use to evaluate the list.
* @return The names of the files in this list. All names are absolute
paths.
*/
public String[] listFiles( final TaskContext context )
throws TaskException
{
final Path path = new Path();
if( System.getProperty( "java.vendor" ).toLowerCase( Locale.US
).indexOf( "microsoft" ) >= 0 )
{
// Pull in *.zip from packages directory
FileSet msZipFiles = new FileSet();
msZipFiles.setDir( new File( System.getProperty( "java.home" ) +
File.separator + "Packages" ) );
msZipFiles.setIncludes( "*.ZIP" );
path.addFileset( msZipFiles );
}
else if( "Kaffe".equals( System.getProperty( "java.vm.name" ) ) )
{
FileSet kaffeJarFiles = new FileSet();
kaffeJarFiles.setDir( new File( System.getProperty( "java.home" )
+ File.separator + "share"
+ File.separator + "kaffe" ) );
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 sets java.home to the JRE directory.
final String rt = System.getProperty( "java.home" ) +
File.separator + "lib" + File.separator + "rt.jar";
final File rtJar = new File( rt );
path.addLocation( rtJar );
}
return path.listFiles( context );
}
}
1.2 +3 -2
jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/java/JikesAdaptor.java
Index: JikesAdaptor.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/java/JikesAdaptor.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- JikesAdaptor.java 26 Mar 2002 02:19:53 -0000 1.1
+++ JikesAdaptor.java 28 Mar 2002 06:29:31 -0000 1.2
@@ -10,6 +10,7 @@
import java.io.File;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Execute;
+import org.apache.myrmidon.framework.java.JavaRuntimeClassPath;
import org.apache.myrmidon.framework.file.Path;
import org.apache.tools.todo.types.Commandline;
import org.apache.tools.todo.types.PathUtil;
@@ -24,7 +25,7 @@
* @author <a href="mailto:[EMAIL PROTECTED]">J D Glanville</a>
* @author [EMAIL PROTECTED]
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
- * @version $Revision: 1.1 $ $Date: 2002/03/26 02:19:53 $
+ * @version $Revision: 1.2 $ $Date: 2002/03/28 06:29:31 $
*
* @ant.type type="java-compiler" name="jikes"
*/
@@ -53,7 +54,7 @@
}
// Add the runtime
- PathUtil.addJavaRuntime( classpath );
+ classpath.add( new JavaRuntimeClassPath() );
// Build the command line
final Commandline cmd = exe.getCommandline();
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>