adammurdoch 02/03/20 22:38:13
Modified: proposal/myrmidon/src/java/org/apache/antlib/core
AbstractAvailableCondition.java
ClassAvailableCondition.java
ResourceAvailableCondition.java
proposal/myrmidon/src/java/org/apache/antlib/xml
XMLValidateTask.java
proposal/myrmidon/src/manifest ant1-ant-descriptor.xml
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs
DependSet.java ExecuteJava.java IContract.java
Javah.java PathConvert.java Property.java
SQLExec.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac
DefaultCompilerAdapter.java Gcj.java Javac.java
Jikes.java Jvc.java Kjc.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc
Javadoc.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend
JDependTask.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp
JspC.java WLJspc.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit
JUnitTask.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata
MAudit.java MMetrics.java MParse.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic
DefaultRmicAdapter.java Rmic.java
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka
CovReport.java Coverage.java
proposal/myrmidon/src/todo/org/apache/tools/todo/types
Argument.java EnvironmentVariable.java
FileList.java Path.java PathUtil.java
Added: proposal/myrmidon/src/todo/org/apache/tools/todo/types
ArrayFileList.java ParsedPathElement.java
SimpleFileList.java
proposal/myrmidon/src/todo/org/apache/tools/todo/types/converters
FileListToStringConverter.java
Removed: proposal/myrmidon/src/todo/org/apache/tools/todo/types
PathElement.java
Log:
Changes to todo.types.Path, should be useable now:
* Removed Path.isEmpty().
* Changed Path.list() -> listFiles( TaskContext ).
* Extracted FileList interface from Path. This interface has a single
listFile( TaskContext ) method.
* Split PathElement into two FileList implementations, ParsedPathElement and
ArrayFileList. Removed the special handling of nested PathElement
and Path objects from Path.listFiles().
* Added FileList -> String converter.
* Temporarily disabled Argument.setPath() and EnvironmentVariable.setPath().
Revision Changes Path
1.2 +7 -6
jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/AbstractAvailableCondition.java
Index: AbstractAvailableCondition.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/AbstractAvailableCondition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- AbstractAvailableCondition.java 19 Mar 2002 02:41:13 -0000 1.1
+++ AbstractAvailableCondition.java 21 Mar 2002 06:38:12 -0000 1.2
@@ -7,19 +7,20 @@
*/
package org.apache.antlib.core;
-import org.apache.myrmidon.framework.conditions.Condition;
+import java.net.URL;
+import java.net.URLClassLoader;
+import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
+import org.apache.myrmidon.framework.conditions.Condition;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.PathUtil;
-import java.net.URL;
-import java.net.URLClassLoader;
/**
* An abstract condition which checks for the availability of a particular
* resource in a classpath.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
- * @version $Revision: 1.1 $ $Date: 2002/03/19 02:41:13 $
+ * @version $Revision: 1.2 $ $Date: 2002/03/21 06:38:12 $
*/
public abstract class AbstractAvailableCondition
implements Condition
@@ -38,9 +39,9 @@
/**
* Builds the ClassLoader to use to check resources.
*/
- protected ClassLoader buildClassLoader() throws TaskException
+ protected ClassLoader buildClassLoader( final TaskContext context )
throws TaskException
{
- final URL[] urls = PathUtil.toURLs( m_classpath );
+ final URL[] urls = PathUtil.toURLs( m_classpath, context );
final ClassLoader classLoader;
if( urls.length > 0 )
{
1.2 +1 -1
jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/ClassAvailableCondition.java
Index: ClassAvailableCondition.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/ClassAvailableCondition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ClassAvailableCondition.java 19 Mar 2002 02:41:13 -0000 1.1
+++ ClassAvailableCondition.java 21 Mar 2002 06:38:12 -0000 1.2
@@ -47,7 +47,7 @@
}
// Build the classloader to use to check resources
- final ClassLoader classLoader = buildClassLoader();
+ final ClassLoader classLoader = buildClassLoader( context );
// Do the check
try
1.2 +1 -1
jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/ResourceAvailableCondition.java
Index: ResourceAvailableCondition.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/core/ResourceAvailableCondition.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- ResourceAvailableCondition.java 19 Mar 2002 02:41:13 -0000 1.1
+++ ResourceAvailableCondition.java 21 Mar 2002 06:38:12 -0000 1.2
@@ -49,7 +49,7 @@
}
// Check whether the resource is available
- final ClassLoader classLoader = buildClassLoader();
+ final ClassLoader classLoader = buildClassLoader( context );
final InputStream instr = classLoader.getResourceAsStream(
m_resource );
if( instr != null )
{
1.23 +1 -1
jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java
Index: XMLValidateTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- XMLValidateTask.java 19 Mar 2002 02:44:36 -0000 1.22
+++ XMLValidateTask.java 21 Mar 2002 06:38:12 -0000 1.23
@@ -330,7 +330,7 @@
Class readerClass = null;
if( m_classpath != null )
{
- final URL[] urls = PathUtil.toURLs( m_classpath );
+ final URL[] urls = PathUtil.toURLs( m_classpath,
getContext() );
final ClassLoader classLoader = new URLClassLoader( urls );
readerClass = classLoader.loadClass( m_readerClassName );
}
1.8 +5 -2
jakarta-ant/proposal/myrmidon/src/manifest/ant1-ant-descriptor.xml
Index: ant1-ant-descriptor.xml
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/manifest/ant1-ant-descriptor.xml,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- ant1-ant-descriptor.xml 19 Mar 2002 11:32:26 -0000 1.7
+++ ant1-ant-descriptor.xml 21 Mar 2002 06:38:12 -0000 1.8
@@ -4,9 +4,12 @@
<task name="java" classname="org.apache.tools.todo.taskdefs.Java" />
<data-type name="path" classname="org.apache.tools.todo.types.Path"
/>
<task name="path"
classname="org.apache.myrmidon.framework.TypeInstanceTask" />
- <converter
classname="org.apache.tools.ant.types.converters.StringToPathConverter"
+ <converter
classname="org.apache.tools.todo.types.converters.StringToPathConverter"
source="java.lang.String"
- destination="org.apache.tools.ant.types.Path" />
+ destination="org.apache.tools.todo.types.Path" />
+ <converter
classname="org.apache.tools.todo.types.converters.FileListToStringConverter"
+ source="org.apache.tools.todo.types.FileList"
+ destination="java.lang.String" />
</types>
</ant-lib>
1.2 +6 -8
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/DependSet.java
Index: DependSet.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/DependSet.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- DependSet.java 17 Mar 2002 09:42:21 -0000 1.1
+++ DependSet.java 21 Mar 2002 06:38:12 -0000 1.2
@@ -13,12 +13,10 @@
import java.util.Iterator;
import org.apache.aut.nativelib.Os;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.AbstractTask;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.DirectoryScanner;
-import org.apache.tools.todo.types.FileList;
import org.apache.tools.todo.types.FileSet;
import org.apache.tools.todo.types.ScannerUtil;
+import org.apache.tools.todo.types.SimpleFileList;
/**
* A Task to record explicit dependencies. If any of the target files are
out of
@@ -62,7 +60,7 @@
*
*
* @author <a href="mailto:[EMAIL PROTECTED]">Craeg Strong</a>
- * @version $Revision: 1.1 $ $Date: 2002/03/17 09:42:21 $
+ * @version $Revision: 1.2 $ $Date: 2002/03/21 06:38:12 $
*/
public class DependSet extends MatchingTask
{
@@ -84,7 +82,7 @@
*
* @param fl The feature to be added to the Srcfilelist attribute
*/
- public void addSrcfilelist( FileList fl )
+ public void addSrcfilelist( SimpleFileList fl )
{
sourceFileLists.add( fl );
}//-- DependSet
@@ -104,7 +102,7 @@
*
* @param fl The feature to be added to the Targetfilelist attribute
*/
- public void addTargetfilelist( FileList fl )
+ public void addTargetfilelist( SimpleFileList fl )
{
targetFileLists.add( fl );
}
@@ -181,7 +179,7 @@
while( enumTargetLists.hasNext() )
{
- FileList targetFL = (FileList)enumTargetLists.next();
+ SimpleFileList targetFL = (SimpleFileList)enumTargetLists.next();
String[] targetFiles = targetFL.getFiles();
for( int i = 0; i < targetFiles.length; i++ )
@@ -252,7 +250,7 @@
while( upToDate && enumSourceLists.hasNext() )
{
- FileList sourceFL = (FileList)enumSourceLists.next();
+ SimpleFileList sourceFL =
(SimpleFileList)enumSourceLists.next();
String[] sourceFiles = sourceFL.getFiles();
int i = 0;
1.4 +6 -5
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ExecuteJava.java
Index: ExecuteJava.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ExecuteJava.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- ExecuteJava.java 20 Mar 2002 08:19:42 -0000 1.3
+++ ExecuteJava.java 21 Mar 2002 06:38:12 -0000 1.4
@@ -12,16 +12,16 @@
import java.lang.reflect.Method;
import java.net.URL;
import java.net.URLClassLoader;
+import org.apache.aut.nativelib.Os;
import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.Execute;
import org.apache.tools.todo.types.Commandline;
+import org.apache.tools.todo.types.EnvironmentData;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.PathUtil;
-import org.apache.tools.todo.types.EnvironmentData;
import org.apache.tools.todo.types.SysProperties;
import org.apache.tools.todo.util.FileUtils;
-import org.apache.aut.nativelib.Os;
/**
* A utility class that executes a Java app, either in this JVM, or a forked
@@ -160,7 +160,7 @@
final Class target;
try
{
- final URL[] urls = PathUtil.toURLs( m_classPath );
+ final URL[] urls = PathUtil.toURLs( m_classPath, context );
if( urls.length == 0 )
{
target = Class.forName( m_className );
@@ -241,10 +241,11 @@
command.addArguments( props );
// Classpath
- if( ! m_classPath.isEmpty() )
+ final String[] classpath = m_classPath.listFiles( context );
+ if( classpath.length > 0 )
{
command.addArgument( "-classpath" );
- command.addArgument( PathUtil.formatPath( m_classPath ) );
+ command.addArgument( PathUtil.formatPath( classpath ) );
}
// What to execute
1.5 +2 -1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java
Index: IContract.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- IContract.java 19 Mar 2002 02:44:36 -0000 1.4
+++ IContract.java 21 Mar 2002 06:38:12 -0000 1.5
@@ -773,7 +773,8 @@
}
iControlProps.setProperty( "sourceRoot",
srcDir.getAbsolutePath() );
iControlProps.setProperty( "classRoot",
classDir.getAbsolutePath() );
- iControlProps.setProperty( "classpath", PathUtil.formatPath(
afterInstrumentationClasspath ) );
+ final String classpath = PathUtil.formatPath(
afterInstrumentationClasspath, getContext() );
+ iControlProps.setProperty( "classpath", classpath );
iControlProps.setProperty( "controlFile",
controlFile.getAbsolutePath() );
iControlProps.setProperty( "targetsFile",
targets.getAbsolutePath() );
1.3 +2 -5
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Javah.java
Index: Javah.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Javah.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Javah.java 19 Mar 2002 02:44:36 -0000 1.2
+++ Javah.java 21 Mar 2002 06:38:12 -0000 1.3
@@ -14,12 +14,9 @@
import org.apache.avalon.excalibur.util.StringUtil;
import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.Commandline;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.PathUtil;
-import org.apache.tools.todo.util.FileUtils;
-import org.apache.tools.todo.taskdefs.ClassArgument;
/**
* Task to generate JNI header files using javah. This task can take the
@@ -271,7 +268,7 @@
if( m_classpath != null )
{
cmd.addArgument( "-classpath" );
- cmd.addArgument( PathUtil.formatPath( m_classpath ) );
+ cmd.addArgument( PathUtil.formatPath( m_classpath, getContext()
) );
}
if( m_verbose )
@@ -299,7 +296,7 @@
if( m_bootclasspath != null )
{
cmd.addArgument( "-bootclasspath" );
- cmd.addArgument( PathUtil.formatPath( m_bootclasspath ) );
+ cmd.addArgument( PathUtil.formatPath( m_bootclasspath,
getContext() ) );
}
logAndAddFilesToCompile( cmd );
1.2 +1 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/PathConvert.java
Index: PathConvert.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/PathConvert.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- PathConvert.java 17 Mar 2002 09:42:21 -0000 1.1
+++ PathConvert.java 21 Mar 2002 06:38:12 -0000 1.2
@@ -12,7 +12,6 @@
import org.apache.aut.nativelib.Os;
import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.Path;
/**
@@ -135,7 +134,7 @@
StringBuffer rslt = new StringBuffer( 100 );
// Get the list of path components in canonical form
- String[] elems = m_path.list();
+ String[] elems = m_path.listFiles( getContext() );
for( int i = 0; i < elems.length; i++ )
{
1.2 +1 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Property.java
Index: Property.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Property.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Property.java 17 Mar 2002 09:42:21 -0000 1.1
+++ Property.java 21 Mar 2002 06:38:12 -0000 1.2
@@ -16,7 +16,6 @@
import java.util.Properties;
import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.PathUtil;
@@ -134,7 +133,7 @@
if( m_classpath != null )
{
- final URL[] urls = PathUtil.toURLs( m_classpath );
+ final URL[] urls = PathUtil.toURLs( m_classpath,
getContext() );
classLoader = new URLClassLoader( urls );
}
else
1.2 +1 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/SQLExec.java
Index: SQLExec.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/SQLExec.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- SQLExec.java 17 Mar 2002 09:42:21 -0000 1.1
+++ SQLExec.java 21 Mar 2002 06:38:12 -0000 1.2
@@ -34,7 +34,6 @@
import java.util.StringTokenizer;
import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.DirectoryScanner;
import org.apache.tools.todo.types.EnumeratedAttribute;
import org.apache.tools.todo.types.FileSet;
@@ -432,7 +431,7 @@
{
getContext().debug( "Loading " + driver + " using
AntClassLoader with classpath " + classpath );
- final URL[] urls = PathUtil.toURLs( classpath );
+ final URL[] urls = PathUtil.toURLs( classpath, getContext()
);
final ClassLoader classLoader = new URLClassLoader( urls );
dc = classLoader.loadClass( driver );
}
1.5 +7 -6
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java
Index: DefaultCompilerAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- DefaultCompilerAdapter.java 19 Mar 2002 02:44:36 -0000 1.4
+++ DefaultCompilerAdapter.java 21 Mar 2002 06:38:12 -0000 1.5
@@ -176,10 +176,10 @@
}
cmd.addArgument( "-classpath" );
- cmd.addArgument( PathUtil.formatPath( classpath ) );
+ cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() )
);
cmd.addArgument( "-sourcepath" );
- cmd.addArgument( PathUtil.formatPath( src ) );
+ cmd.addArgument( PathUtil.formatPath( src, getTaskContext() ) );
if( target != null )
{
@@ -187,16 +187,17 @@
cmd.addArgument( target );
}
- if( m_bootclasspath != null )
+ final String[] bootclasspath = m_bootclasspath.listFiles(
getTaskContext() );
+ if( bootclasspath.length > 0 )
{
cmd.addArgument( "-bootclasspath" );
- cmd.addArgument( PathUtil.formatPath( m_bootclasspath ) );
+ cmd.addArgument( PathUtil.formatPath( bootclasspath ) );
}
if( m_extdirs != null )
{
cmd.addArgument( "-extdirs" );
- cmd.addArgument( PathUtil.formatPath( m_extdirs ) );
+ cmd.addArgument( PathUtil.formatPath( m_extdirs,
getTaskContext() ) );
}
if( m_encoding != null )
@@ -425,7 +426,7 @@
}
}
- PathUtil.addExtdirs( path, m_extdirs );
+ PathUtil.addExtdirs( path, m_extdirs, getTaskContext() );
}
}
1.3 +6 -10
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Gcj.java
Index: Gcj.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Gcj.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Gcj.java 19 Mar 2002 02:44:36 -0000 1.2
+++ Gcj.java 21 Mar 2002 06:38:12 -0000 1.3
@@ -8,18 +8,16 @@
package org.apache.tools.todo.taskdefs.javac;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.Commandline;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.PathUtil;
-import org.apache.tools.todo.util.FileUtils;
-import org.apache.tools.todo.taskdefs.javac.DefaultCompilerAdapter;
/**
* The implementation of the gcj compiler. This is primarily a cut-and-paste
* from the jikes.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Takashi Okamoto</a>
+ * @author [EMAIL PROTECTED]
*/
public class Gcj extends DefaultCompilerAdapter
{
@@ -29,7 +27,6 @@
*
* @return Description of the Returned Value
* @exception org.apache.myrmidon.api.TaskException Description of
Exception
- * @author [EMAIL PROTECTED]
*/
public boolean execute()
throws TaskException
@@ -52,20 +49,19 @@
// gcj doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
- if( m_bootclasspath != null )
- {
- classpath.addPath( m_bootclasspath );
- }
+ final String[] bootclasspath = m_bootclasspath.listFiles(
getTaskContext() );
+ classpath.addPath( bootclasspath );
// gcj doesn't support an extension dir (-extdir)
// so we'll emulate it for compatibility and convenience.
addExtdirs( classpath );
- if( ( m_bootclasspath == null ) || m_bootclasspath.isEmpty() )
+ if( bootclasspath.length == 0 )
{
// no bootclasspath, therefore, get one from the java runtime
m_includeJavaRuntime = true;
}
+
addCompileClasspath( classpath );
// Gcj has no option for source-path so we
@@ -87,7 +83,7 @@
}
cmd.addArgument( "-classpath" );
- cmd.addArgument( PathUtil.formatPath( classpath ) );
+ cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() )
);
if( m_encoding != null )
{
1.2 +4 -16
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Javac.java
Index: Javac.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Javac.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Javac.java 17 Mar 2002 09:42:22 -0000 1.1
+++ Javac.java 21 Mar 2002 06:38:12 -0000 1.2
@@ -12,13 +12,8 @@
import java.util.Iterator;
import org.apache.aut.nativelib.Os;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.AbstractTask;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.framework.JavaVersion;
import org.apache.tools.todo.taskdefs.MatchingTask;
-import org.apache.tools.todo.taskdefs.javac.CompilerAdapter;
-import org.apache.tools.todo.taskdefs.javac.CompilerAdapterFactory;
-import org.apache.tools.todo.taskdefs.javac.ImplementationSpecificArgument;
import org.apache.tools.todo.types.DirectoryScanner;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.SourceFileScanner;
@@ -76,7 +71,7 @@
private ArrayList m_implementationSpecificArgs = new ArrayList();
protected File[] m_compileList = new File[ 0 ];
- private Path m_bootclasspath;
+ private Path m_bootclasspath = new Path();
private Path m_compileClasspath;
private String m_debugLevel;
private File m_destDir;
@@ -92,16 +87,9 @@
* Adds an element to the bootclasspath that will be used to compile the
* classes against.
*/
- public void addBootclasspath( Path bootclasspath )
+ public void addBootclasspath( final Path bootclasspath )
{
- if( m_bootclasspath == null )
- {
- m_bootclasspath = bootclasspath;
- }
- else
- {
- m_bootclasspath.addPath( bootclasspath );
- }
+ m_bootclasspath.addPath( bootclasspath );
}
/**
@@ -602,7 +590,7 @@
{
throw new TaskException( "srcdir attribute must be set!" );
}
- String[] list = m_src.list();
+ String[] list = m_src.listFiles( getContext() );
if( list.length == 0 )
{
throw new TaskException( "srcdir attribute must be set!" );
1.3 +10 -17
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jikes.java
Index: Jikes.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jikes.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Jikes.java 19 Mar 2002 02:44:36 -0000 1.2
+++ Jikes.java 21 Mar 2002 06:38:12 -0000 1.3
@@ -8,12 +8,9 @@
package org.apache.tools.todo.taskdefs.javac;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.Commandline;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.PathUtil;
-import org.apache.tools.todo.util.FileUtils;
-import org.apache.tools.todo.taskdefs.javac.DefaultCompilerAdapter;
/**
* The implementation of the jikes compiler. This is primarily a
cut-and-paste
@@ -24,6 +21,7 @@
* </a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
* @author <a href="mailto:[EMAIL PROTECTED]">J D Glanville</a>
+ * @author [EMAIL PROTECTED]
*/
public class Jikes
extends DefaultCompilerAdapter
@@ -38,7 +36,6 @@
*
* @return Description of the Returned Value
* @exception org.apache.myrmidon.api.TaskException Description of
Exception
- * @author [EMAIL PROTECTED]
*/
public boolean execute()
throws TaskException
@@ -49,27 +46,23 @@
// Jikes doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
- if( m_bootclasspath != null )
- {
- classpath.addPath( m_bootclasspath );
- }
+ final String[] bootclasspath = m_bootclasspath.listFiles(
getTaskContext() );
+ classpath.addPath( bootclasspath );
// Jikes doesn't support an extension dir (-extdir)
// so we'll emulate it for compatibility and convenience.
addExtdirs( classpath );
- if( ( m_bootclasspath == null ) || m_bootclasspath.isEmpty() )
+ if( bootclasspath.length == 0 )
{
// no bootclasspath, therefore, get one from the java runtime
m_includeJavaRuntime = true;
}
- else
- {
- // there is a bootclasspath stated. By default, the
- // includeJavaRuntime is false. If the user has stated a
- // bootclasspath and said to include the java runtime, it's on
- // their head!
- }
+ // Else, there is a bootclasspath stated. By default, the
+ // includeJavaRuntime is false. If the user has stated a
+ // bootclasspath and said to include the java runtime, it's on
+ // their head!
+
addCompileClasspath( classpath );
// Jikes has no option for source-path so we
@@ -98,7 +91,7 @@
}
cmd.addArgument( "-classpath" );
- cmd.addArgument( PathUtil.formatPath( classpath ) );
+ cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() )
);
if( m_encoding != null )
{
1.3 +9 -16
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jvc.java
Index: Jvc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jvc.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Jvc.java 19 Mar 2002 02:44:36 -0000 1.2
+++ Jvc.java 21 Mar 2002 06:38:12 -0000 1.3
@@ -8,12 +8,9 @@
package org.apache.tools.todo.taskdefs.javac;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.types.Commandline;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.PathUtil;
-import org.apache.tools.todo.util.FileUtils;
-import org.apache.tools.todo.taskdefs.javac.DefaultCompilerAdapter;
/**
* The implementation of the jvc compiler from microsoft. This is primarily a
@@ -37,27 +34,23 @@
// jvc doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
- if( m_bootclasspath != null )
- {
- classpath.addPath( m_bootclasspath );
- }
+ final String[] bootclasspath = m_bootclasspath.listFiles(
getTaskContext() );
+ classpath.addPath( bootclasspath );
// jvc doesn't support an extension dir (-extdir)
// so we'll emulate it for compatibility and convenience.
addExtdirs( classpath );
- if( ( m_bootclasspath == null ) || m_bootclasspath.isEmpty() )
+ if( bootclasspath.length == 0 )
{
// no bootclasspath, therefore, get one from the java runtime
m_includeJavaRuntime = true;
}
- else
- {
- // there is a bootclasspath stated. By default, the
- // includeJavaRuntime is false. If the user has stated a
- // bootclasspath and said to include the java runtime, it's on
- // their head!
- }
+ // Else, there is a bootclasspath stated. By default, the
+ // includeJavaRuntime is false. If the user has stated a
+ // bootclasspath and said to include the java runtime, it's on
+ // their head!
+
addCompileClasspath( classpath );
// jvc has no option for source-path so we
@@ -75,7 +68,7 @@
// Add the Classpath before the "internal" one.
cmd.addArgument( "/cp:p" );
- cmd.addArgument( PathUtil.formatPath( classpath ) );
+ cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() )
);
// Enable MS-Extensions and ...
cmd.addArgument( "/x-" );
1.3 +2 -5
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Kjc.java
Index: Kjc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Kjc.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Kjc.java 19 Mar 2002 02:44:36 -0000 1.2
+++ Kjc.java 21 Mar 2002 06:38:12 -0000 1.3
@@ -89,10 +89,7 @@
Path cp = new Path();
// kjc don't have bootclasspath option.
- if( m_bootclasspath != null )
- {
- cp.addPath( m_bootclasspath );
- }
+ cp.addPath( m_bootclasspath );
if( m_extdirs != null )
{
@@ -102,7 +99,7 @@
cp.addPath( classpath );
cp.addPath( src );
- cmd.addArgument( PathUtil.formatPath( cp ) );
+ cmd.addArgument( PathUtil.formatPath( cp, getTaskContext() ) );
// kjc-1.5A doesn't support -encoding option now.
// but it will be supported near the feature.
1.5 +5 -5
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java
Index: Javadoc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- Javadoc.java 19 Mar 2002 02:44:37 -0000 1.4
+++ Javadoc.java 21 Mar 2002 06:38:12 -0000 1.5
@@ -570,7 +570,7 @@
classpath.addPath( m_classpath );
}
cmd.addArgument( "-classpath" );
- cmd.addArgument( PathUtil.formatPath( classpath ) );
+ cmd.addArgument( PathUtil.formatPath( classpath, getContext() ) );
if( m_version && m_doclet == null )
{
@@ -607,7 +607,7 @@
if( m_doclet.getPath() != null )
{
cmd.addArgument( "-docletpath" );
- cmd.addArgument( PathUtil.formatPath( m_doclet.getPath()
) );
+ cmd.addArgument( PathUtil.formatPath(
m_doclet.getPath(), getContext() ) );
}
for( Iterator e = m_doclet.getParams(); e.hasNext(); )
{
@@ -628,7 +628,7 @@
if( m_bootclasspath != null )
{
cmd.addArgument( "-bootclasspath" );
- cmd.addArgument( PathUtil.formatPath( m_bootclasspath ) );
+ cmd.addArgument( PathUtil.formatPath( m_bootclasspath,
getContext() ) );
}
// add the links arguments
@@ -888,7 +888,7 @@
ArrayList packages, ArrayList
excludePackages )
throws TaskException
{
- getContext().debug( "Source path = " + PathUtil.formatPath(
sourcePath ) );
+ getContext().debug( "Source path = " + PathUtil.formatPath(
sourcePath, getContext() ) );
StringBuffer msg = new StringBuffer( "Packages = " );
for( int i = 0; i < packages.size(); i++ )
{
@@ -914,7 +914,7 @@
ArrayList addedPackages = new ArrayList();
- String[] list = sourcePath.list();
+ String[] list = sourcePath.listFiles( getContext() );
if( list == null )
{
list = new String[ 0 ];
1.6 +2 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend/JDependTask.java
Index: JDependTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend/JDependTask.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- JDependTask.java 20 Mar 2002 08:19:42 -0000 1.5
+++ JDependTask.java 21 Mar 2002 06:38:13 -0000 1.6
@@ -180,7 +180,7 @@
getContext().info( "Output to be stored in " +
m_outputFile.getPath() );
}
- final String[] elements = m_sourcesPath.list();
+ final String[] elements = m_sourcesPath.listFiles( getContext() );
for( int i = 0; i < elements.length; i++ )
{
File f = new File( elements[ i ] );
@@ -236,7 +236,7 @@
getContext().info( "Output to be stored in " +
m_outputFile.getPath() );
}
- final String[] elements = m_sourcesPath.list();
+ final String[] elements = m_sourcesPath.listFiles( getContext() );
for( int i = 0; i < elements.length; i++ )
{
File f = new File( elements[ i ] );
1.3 +2 -4
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/JspC.java
Index: JspC.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/JspC.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JspC.java 19 Mar 2002 02:44:37 -0000 1.2
+++ JspC.java 21 Mar 2002 06:38:13 -0000 1.3
@@ -11,8 +11,6 @@
import java.util.ArrayList;
import java.util.Date;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.AbstractTask;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.tools.todo.taskdefs.MatchingTask;
import org.apache.tools.todo.taskdefs.jsp.compilers.CompilerAdapter;
import org.apache.tools.todo.taskdefs.jsp.compilers.CompilerAdapterFactory;
@@ -58,7 +56,7 @@
* </a>
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
* @author <a href="mailto:[EMAIL PROTECTED]">J D Glanville</a>
- * @version $Revision: 1.2 $ $Date: 2002/03/19 02:44:37 $
+ * @version $Revision: 1.3 $ $Date: 2002/03/21 06:38:13 $
*/
public class JspC extends MatchingTask
{
@@ -325,7 +323,7 @@
{
throw new TaskException( "srcdir attribute must be set!" );
}
- String[] list = src.list();
+ String[] list = src.listFiles( getContext() );
if( list.length == 0 )
{
throw new TaskException( "srcdir attribute must be set!" );
1.6 +1 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java
Index: WLJspc.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- WLJspc.java 20 Mar 2002 08:19:43 -0000 1.5
+++ WLJspc.java 21 Mar 2002 06:38:13 -0000 1.6
@@ -175,7 +175,6 @@
File jspFile = null;
String parents = "";
- String arg = "";
int j = 0;
//XXX this array stuff is a remnant of prev trials.. gotta remove.
args[ j++ ] = "-d";
@@ -191,7 +190,7 @@
// Does not take the classpath from the env....
// Am i missing something about the Java task??
args[ j++ ] = "-classpath";
- args[ j++ ] = PathUtil.formatPath( compileClasspath );
+ args[ j++ ] = PathUtil.formatPath( compileClasspath, getContext() );
this.scanDir( files );
getContext().info( "Compiling " + filesToDo.size() + " JSP files" );
1.5 +3 -3
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java
Index: JUnitTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JUnitTask.java 20 Mar 2002 08:19:43 -0000 1.4
+++ JUnitTask.java 21 Mar 2002 06:38:13 -0000 1.5
@@ -21,13 +21,13 @@
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.todo.taskdefs.ExecuteJava;
import org.apache.tools.todo.types.Argument;
+import org.apache.tools.todo.types.Commandline;
import org.apache.tools.todo.types.EnumeratedAttribute;
+import org.apache.tools.todo.types.EnvironmentData;
import org.apache.tools.todo.types.EnvironmentVariable;
import org.apache.tools.todo.types.Path;
import org.apache.tools.todo.types.PathUtil;
import org.apache.tools.todo.types.SysProperties;
-import org.apache.tools.todo.types.Commandline;
-import org.apache.tools.todo.types.EnvironmentData;
/**
* Ant task to run JUnit tests. <p>
@@ -642,7 +642,7 @@
{
getContext().debug( "Using System properties " +
System.getProperties() );
ClassLoader classLoader = null;
- final URL[] urls = PathUtil.toURLs( classPath );
+ final URL[] urls = PathUtil.toURLs( classPath, getContext() );
if( urls.length > 0 )
{
classLoader = new URLClassLoader( urls );
1.4 +2 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MAudit.java
Index: MAudit.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MAudit.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MAudit.java 20 Mar 2002 08:19:43 -0000 1.3
+++ MAudit.java 21 Mar 2002 06:38:13 -0000 1.4
@@ -129,7 +129,7 @@
// don't forget to modify the pattern if you change the options
reporting
classpath.addPath( getClassPath() );
- final String formattedClasspath = PathUtil.formatPath( classpath );
+ final String formattedClasspath = PathUtil.formatPath( classpath,
getContext() );
if( formattedClasspath.length() > 0 )
{
options.add( "-classpath" );
@@ -162,7 +162,7 @@
if( m_unused )
{
options.add( "-unused" );
- options.add( PathUtil.formatPath( m_searchPath ) );
+ options.add( PathUtil.formatPath( m_searchPath, getContext() ) );
}
addAllArrayList( options, getIncludedFiles().keySet().iterator() );
return options;
1.4 +2 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MMetrics.java
Index: MMetrics.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MMetrics.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MMetrics.java 20 Mar 2002 08:19:43 -0000 1.3
+++ MMetrics.java 21 Mar 2002 06:38:13 -0000 1.4
@@ -132,7 +132,7 @@
// don't forget to modify the pattern if you change the options
reporting
classpath.addPath( getClassPath() );
- final String formattedClasspath = PathUtil.formatPath( classpath );
+ final String formattedClasspath = PathUtil.formatPath( classpath,
getContext() );
if( formattedClasspath.length() > 0 )
{
options.add( "-classpath" );
@@ -157,7 +157,7 @@
options.add( "/" );
// directories
- final String[] dirs = path.list();
+ final String[] dirs = path.listFiles( getContext() );
for( int i = 0; i < dirs.length; i++ )
{
options.add( dirs[ i ] );
1.6 +6 -4
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java
Index: MParse.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- MParse.java 20 Mar 2002 08:19:43 -0000 1.5
+++ MParse.java 21 Mar 2002 06:38:13 -0000 1.6
@@ -235,15 +235,17 @@
{
options.add( "-dp" );
}
- if( ! m_classpath.isEmpty() )
+ final String[] classpath = m_classpath.listFiles( getContext() );
+ if( classpath.length > 0 )
{
options.add( "-classpath" );
- options.add( PathUtil.formatPath( m_classpath ) );
+ options.add( PathUtil.formatPath( classpath ) );
}
- if( ! m_sourcepath.isEmpty() )
+ final String[] sourcepath = m_sourcepath.listFiles( getContext() );
+ if( sourcepath.length > 0 )
{
options.add( "-sourcepath" );
- options.add( PathUtil.formatPath( m_sourcepath ) );
+ options.add( PathUtil.formatPath( sourcepath ) );
}
options.add( m_target.getAbsolutePath() );
1.3 +2 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/DefaultRmicAdapter.java
Index: DefaultRmicAdapter.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/DefaultRmicAdapter.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- DefaultRmicAdapter.java 19 Mar 2002 02:44:37 -0000 1.2
+++ DefaultRmicAdapter.java 21 Mar 2002 06:38:13 -0000 1.3
@@ -120,11 +120,11 @@
if( attributes.getExtdirs() != null )
{
cmd.addArgument( "-extdirs" );
- cmd.addArgument( PathUtil.formatPath( attributes.getExtdirs() )
);
+ cmd.addArgument( PathUtil.formatPath( attributes.getExtdirs(),
getTaskContext() ) );
}
cmd.addArgument( "-classpath" );
- cmd.addArgument( PathUtil.formatPath( classpath ) );
+ cmd.addArgument( PathUtil.formatPath( classpath, getTaskContext() )
);
String stubVersion = attributes.getStubVersion();
if( null != stubVersion )
1.2 +1 -3
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/Rmic.java
Index: Rmic.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/Rmic.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- Rmic.java 17 Mar 2002 09:42:23 -0000 1.1
+++ Rmic.java 21 Mar 2002 06:38:13 -0000 1.2
@@ -15,8 +15,6 @@
import java.util.ArrayList;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.AbstractTask;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.framework.FileNameMapper;
import org.apache.tools.todo.taskdefs.MatchingTask;
import org.apache.tools.todo.types.DirectoryScanner;
@@ -487,7 +485,7 @@
adapter.setRmic( this );
Path classpath = adapter.getClasspath();
- final URL[] urls = PathUtil.toURLs( classpath );
+ final URL[] urls = PathUtil.toURLs( classpath, getContext() );
loader = new URLClassLoader( urls );
// scan base dirs to build up compile lists only if a
1.4 +1 -3
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovReport.java
Index: CovReport.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovReport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CovReport.java 18 Mar 2002 11:49:47 -0000 1.3
+++ CovReport.java 21 Mar 2002 06:38:13 -0000 1.4
@@ -17,10 +17,8 @@
import javax.xml.transform.TransformerFactory;
import javax.xml.transform.dom.DOMSource;
import javax.xml.transform.stream.StreamResult;
-import org.apache.aut.nativelib.ExecManager;
import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskException;
-import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.framework.Execute;
import org.apache.tools.todo.types.Commandline;
import org.apache.tools.todo.types.EnumeratedAttribute;
@@ -392,7 +390,7 @@
throw new TaskException( "Need a 'classpath' element." );
}
// and a valid one...
- String[] paths = classPath.list();
+ String[] paths = classPath.listFiles();
if( paths.length == 0 )
{
throw new TaskException( "Coverage path is invalid. It does
not contain any existing path." );
1.6 +3 -2
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java
Index: Coverage.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Coverage.java 20 Mar 2002 08:19:43 -0000 1.5
+++ Coverage.java 21 Mar 2002 06:38:13 -0000 1.6
@@ -304,10 +304,11 @@
params.addArguments( m_vmArgs );
// classpath
- if( ! m_classpath.isEmpty() )
+ final String[] classpath = m_classpath.listFiles();
+ if( classpath.length > 0 )
{
params.addArgument( "-classpath" );
- params.addArgument( PathUtil.formatPath( m_classpath ) );
+ params.addArgument( PathUtil.formatPath( classpath ) );
}
// classname (runner or standalone)
if( m_className != null )
1.3 +2 -1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/Argument.java
Index: Argument.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/Argument.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Argument.java 19 Mar 2002 02:44:37 -0000 1.2
+++ Argument.java 21 Mar 2002 06:38:13 -0000 1.3
@@ -62,7 +62,8 @@
*/
public void setPath( final Path value ) throws TaskException
{
- m_parts = new String[]{ PathUtil.formatPath( value ) };
+ throw new TaskException( "Using a path not implemented." );
+ //m_parts = new String[]{ PathUtil.formatPath( value ) };
}
/**
1.3 +2 -1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/EnvironmentVariable.java
Index: EnvironmentVariable.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/EnvironmentVariable.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- EnvironmentVariable.java 19 Mar 2002 02:44:37 -0000 1.2
+++ EnvironmentVariable.java 21 Mar 2002 06:38:13 -0000 1.3
@@ -27,7 +27,8 @@
public void setPath( final Path path ) throws TaskException
{
- m_value = PathUtil.formatPath( path );
+ throw new TaskException( "Using a path not implemented." );
+ //m_value = PathUtil.formatPath( path );
}
public void setValue( final String value )
1.2 +11 -55
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/FileList.java
Index: FileList.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/FileList.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- FileList.java 17 Mar 2002 09:42:24 -0000 1.1
+++ FileList.java 21 Mar 2002 06:38:13 -0000 1.2
@@ -7,67 +7,23 @@
*/
package org.apache.tools.todo.types;
-import java.io.File;
-import java.util.ArrayList;
-import java.util.StringTokenizer;
+import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
/**
- * FileList represents an explicitly named list of files. FileLists are
useful
- * when you want to capture a list of files regardless of whether they
currently
- * exist. By contrast, FileSet operates as a filter, only returning the name
of
- * a matched file if it currently exists in the file system.
+ * A list of files.
*
- * @author <a href="mailto:[EMAIL PROTECTED]">Craeg Strong</a>
- * @version $Revision: 1.1 $ $Date: 2002/03/17 09:42:24 $
+ * @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
+ * @version $Revision: 1.2 $ $Date: 2002/03/21 06:38:13 $
*/
-public class FileList
+public interface FileList
{
- private final ArrayList m_filenames = new ArrayList();
- private File m_dir;
-
- public FileList()
- {
- }
-
- public void setDir( File dir )
- {
- m_dir = dir;
- }
-
- public void setFiles( String filenames )
- {
- if( filenames != null && filenames.length() > 0 )
- {
- StringTokenizer tok = new StringTokenizer( filenames, ",
\t\n\r\f", false );
- while( tok.hasMoreTokens() )
- {
- m_filenames.add( tok.nextToken() );
- }
- }
- }
-
- public File getDir()
- {
- return m_dir;
- }
-
/**
- * Returns the list of files represented by this 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[] getFiles()
- throws TaskException
- {
- if( m_dir == null )
- {
- throw new TaskException( "No directory specified for filelist."
);
- }
-
- if( m_filenames.size() == 0 )
- {
- throw new TaskException( "No files specified for filelist." );
- }
-
- return (String[])m_filenames.toArray( new String[ m_filenames.size()
] );
- }
+ public String[] listFiles( TaskContext context )
+ throws TaskException;
}
1.3 +19 -47
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/Path.java
Index: Path.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/Path.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- Path.java 19 Mar 2002 02:44:37 -0000 1.2
+++ Path.java 21 Mar 2002 06:38:13 -0000 1.3
@@ -9,11 +9,10 @@
import java.io.File;
import java.util.ArrayList;
+import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.DataType;
import org.apache.tools.todo.util.FileUtils;
-import org.apache.tools.todo.types.DirectoryScanner;
-import org.apache.tools.todo.types.FileSet;
/**
* This object represents a path as used by CLASSPATH or PATH environment
@@ -45,12 +44,13 @@
*
* @author [EMAIL PROTECTED]
* @author <a href="mailto:[EMAIL PROTECTED]">Stefan Bodewig</a>
+ *
+ * @ant:data-type name="path"
*/
public class Path
- implements DataType
+ implements DataType, FileList
{
private final ArrayList m_elements = new ArrayList();
- private File m_baseDirectory;
public Path( final String path )
{
@@ -73,14 +73,6 @@
}
/**
- * Sets the base directory for this path.
- */
- public void setBaseDirectory( final File baseDir )
- {
- m_baseDirectory = baseDir;
- }
-
- /**
* Adds an element to the path.
*/
public void setLocation( final File location )
@@ -96,9 +88,8 @@
*/
public void addLocation( final File location )
{
- final PathElement pathElement = new PathElement();
+ final FileList pathElement = new ArrayFileList(
location.getAbsolutePath() );
m_elements.add( pathElement );
- pathElement.setLocation( location );
}
/**
@@ -122,9 +113,17 @@
*/
public void addPath( final String path )
{
- final PathElement pathElement = new PathElement();
+ final FileList pathElement = new ParsedPathElement( path );
+ m_elements.add( pathElement );
+ }
+
+ /**
+ * Adds a path.
+ */
+ public void addPath( final String[] path )
+ {
+ final FileList pathElement = new ArrayFileList( path );
m_elements.add( pathElement );
- pathElement.setPath( path );
}
/**
@@ -139,35 +138,17 @@
* Returns all path elements defined by this and nested path objects.
* The paths returned by this method are absolute.
*/
- public String[] list()
+ public String[] listFiles( final TaskContext context )
throws TaskException
{
ArrayList result = new ArrayList( 2 * m_elements.size() );
for( int i = 0; i < m_elements.size(); i++ )
{
Object o = m_elements.get( i );
- if( o instanceof String )
- {
- // obtained via append
- addUnlessPresent( result, (String)o );
- }
- else if( o instanceof PathElement )
+ if( o instanceof FileList )
{
- final PathElement element = (PathElement)o;
- final String[] parts = element.getParts( m_baseDirectory );
- if( parts == null )
- {
- throw new NullPointerException( "You must either set
location or path on <pathelement>" );
- }
- for( int j = 0; j < parts.length; j++ )
- {
- addUnlessPresent( result, parts[ j ] );
- }
- }
- else if( o instanceof Path )
- {
- Path p = (Path)o;
- String[] parts = p.list();
+ final FileList element = (FileList)o;
+ final String[] parts = element.listFiles( context );
for( int j = 0; j < parts.length; j++ )
{
addUnlessPresent( result, parts[ j ] );
@@ -188,14 +169,5 @@
}
}
return (String[])result.toArray( new String[ result.size() ] );
- }
-
- /**
- * Determines if this path is empty.
- */
- public boolean isEmpty()
- throws TaskException
- {
- return ( list().length == 0 );
}
}
1.3 +21 -15
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.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PathUtil.java 19 Mar 2002 02:44:37 -0000 1.2
+++ PathUtil.java 21 Mar 2002 06:38:13 -0000 1.3
@@ -11,52 +11,58 @@
import java.io.IOException;
import java.net.URL;
import java.util.Locale;
+import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
-import org.apache.tools.todo.types.FileSet;
-import org.apache.tools.todo.types.Path;
/**
* Utilities for operating on Path objects.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Peter Donald</a>
- * @version $Revision: 1.2 $ $Date: 2002/03/19 02:44:37 $
+ * @version $Revision: 1.3 $ $Date: 2002/03/21 06:38:13 $
*/
public class PathUtil
{
/**
* Formats a Path into its native representation.
*/
- public static String formatPath( final Path path )
- throws TaskException
+ public static String formatPath( final String[] path )
{
- final String[] list = path.list();
-
// empty path return empty string
- if( list.length == 0 )
+ if( path.length == 0 )
{
return "";
}
// path containing one or more elements
- final StringBuffer result = new StringBuffer( list[ 0 ].toString() );
- for( int i = 1; i < list.length; i++ )
+ final StringBuffer result = new StringBuffer( path[ 0 ].toString() );
+ for( int i = 1; i < path.length; i++ )
{
result.append( File.pathSeparatorChar );
- result.append( list[ i ] );
+ result.append( path[ i ] );
}
return result.toString();
}
/**
+ * Formats a Path into its native representation.
+ */
+ public static String formatPath( final Path path, final TaskContext
context )
+ throws TaskException
+ {
+ final String[] list = path.listFiles( context );
+ return formatPath( list );
+ }
+
+ /**
* Returns an array of URLs - useful for building a ClassLoader.
*/
- public static URL[] toURLs( final Path path )
+ public static URL[] toURLs( final Path path, final TaskContext context )
throws TaskException
{
try
{
- final String[] list = path.list();
+ final String[] list = path.listFiles( context );
final URL[] result = new URL[ list.length ];
@@ -126,10 +132,10 @@
/**
* Adds the contents of a set of directories to a path.
*/
- public static void addExtdirs( final Path toPath, final Path extDirs )
+ public static void addExtdirs( final Path toPath, final Path extDirs,
TaskContext context )
throws TaskException
{
- final String[] dirs = extDirs.list();
+ final String[] dirs = extDirs.listFiles( context );
for( int i = 0; i < dirs.length; i++ )
{
final File dir = new File( dirs[ i ] );
1.1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/ArrayFileList.java
Index: ArrayFileList.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.tools.todo.types;
import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
/**
* A PathElement made up of an array of strings.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
* @version $Revision: 1.1 $ $Date: 2002/03/21 06:38:13 $
*/
class ArrayFileList
implements FileList
{
private final String[] m_parts;
public ArrayFileList( final String part )
{
m_parts = new String[] { part } ;
}
public ArrayFileList( final String[] parts )
{
m_parts = parts;
}
public String[] listFiles( final TaskContext context )
throws TaskException
{
return m_parts;
}
}
1.1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/ParsedPathElement.java
Index: ParsedPathElement.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.tools.todo.types;
import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.todo.util.FileUtils;
/**
* A PathElement that is parsed from a string.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
* @version $Revision: 1.1 $ $Date: 2002/03/21 06:38:13 $
*/
class ParsedPathElement
implements FileList
{
private final String m_path;
public ParsedPathElement( final String path )
{
m_path = path;
}
public String[] listFiles( final TaskContext context )
throws TaskException
{
return FileUtils.translatePath( context.getBaseDirectory(), m_path );
}
}
1.1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/SimpleFileList.java
Index: SimpleFileList.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.tools.todo.types;
import java.io.File;
import java.util.ArrayList;
import java.util.StringTokenizer;
import org.apache.myrmidon.api.TaskException;
/**
* FileList represents an explicitly named list of files. FileLists are useful
* when you want to capture a list of files regardless of whether they
currently
* exist. By contrast, FileSet operates as a filter, only returning the name
of
* a matched file if it currently exists in the file system.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Craeg Strong</a>
* @version $Revision: 1.1 $ $Date: 2002/03/21 06:38:13 $
*/
public class SimpleFileList
{
private final ArrayList m_filenames = new ArrayList();
private File m_dir;
public SimpleFileList()
{
}
public void setDir( File dir )
{
m_dir = dir;
}
public void setFiles( String filenames )
{
if( filenames != null && filenames.length() > 0 )
{
StringTokenizer tok = new StringTokenizer( filenames, ",
\t\n\r\f", false );
while( tok.hasMoreTokens() )
{
m_filenames.add( tok.nextToken() );
}
}
}
public File getDir()
{
return m_dir;
}
/**
* Returns the list of files represented by this FileList.
*/
public String[] getFiles()
throws TaskException
{
if( m_dir == null )
{
throw new TaskException( "No directory specified for filelist." );
}
if( m_filenames.size() == 0 )
{
throw new TaskException( "No files specified for filelist." );
}
return (String[])m_filenames.toArray( new String[ m_filenames.size()
] );
}
}
1.1
jakarta-ant/proposal/myrmidon/src/todo/org/apache/tools/todo/types/converters/FileListToStringConverter.java
Index: FileListToStringConverter.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.tools.todo.types.converters;
import org.apache.aut.converter.AbstractConverter;
import org.apache.aut.converter.ConverterException;
import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
import org.apache.tools.todo.types.FileList;
import org.apache.tools.todo.types.PathUtil;
/**
* Converters from FileList to String.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Adam Murdoch</a>
* @version $Revision: 1.1 $ $Date: 2002/03/21 06:38:13 $
*
* @ant:converter source="org.apache.tools.todo.types.FileList"
destination="java.lang.String"
*/
public class FileListToStringConverter
extends AbstractConverter
{
public FileListToStringConverter()
{
super( FileList.class, String.class );
}
protected Object convert( final Object original, final Object context )
throws ConverterException
{
try
{
final TaskContext taskContext = (TaskContext)context;
final FileList fileList = (FileList)original;
final String[] files = fileList.listFiles( taskContext );
return PathUtil.formatPath( files );
}
catch( final TaskException e )
{
throw new ConverterException( e.getMessage(), e );
}
}
}
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>