Browse Source

* Changed Path.addPath( Path ) -> Path.add( FileList ), so that <path>

can accept any nested FileList implementation, including <path>.

* Added <list-path> diagnostic task.

* Added test cases for <path>.


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@271948 13f79535-47bb-0310-9956-ffa450edef68
master
adammurdoch 23 years ago
parent
commit
ee35557dea
45 changed files with 556 additions and 88 deletions
  1. +10
    -2
      proposal/myrmidon/build.xml
  2. +1
    -1
      proposal/myrmidon/src/java/org/apache/antlib/core/AbstractAvailableCondition.java
  3. +1
    -1
      proposal/myrmidon/src/java/org/apache/antlib/dotnet/CSharp.java
  4. +49
    -0
      proposal/myrmidon/src/java/org/apache/antlib/file/ListPathTask.java
  5. +1
    -1
      proposal/myrmidon/src/java/org/apache/antlib/java/JavaTask.java
  6. +2
    -2
      proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java
  7. +1
    -1
      proposal/myrmidon/src/java/org/apache/antlib/xml/XSLTProcess.java
  8. +2
    -0
      proposal/myrmidon/src/java/org/apache/myrmidon/framework/FileSet.java
  9. +2
    -1
      proposal/myrmidon/src/java/org/apache/myrmidon/framework/Pattern.java
  10. +2
    -0
      proposal/myrmidon/src/java/org/apache/myrmidon/framework/file/FileList.java
  11. +7
    -7
      proposal/myrmidon/src/java/org/apache/myrmidon/framework/file/Path.java
  12. +0
    -5
      proposal/myrmidon/src/test/org/apache/antlib/core/test/ant-descriptor.xml
  13. +99
    -0
      proposal/myrmidon/src/test/org/apache/myrmidon/framework/file/test/PathTestCase.java
  14. +42
    -0
      proposal/myrmidon/src/test/org/apache/myrmidon/framework/file/test/TestFileList.java
  15. +67
    -0
      proposal/myrmidon/src/test/org/apache/myrmidon/framework/file/test/path.ant
  16. +0
    -5
      proposal/myrmidon/src/testcases/org/apache/antlib/core/test/ant-descriptor.xml
  17. +99
    -0
      proposal/myrmidon/src/testcases/org/apache/myrmidon/framework/file/test/PathTestCase.java
  18. +42
    -0
      proposal/myrmidon/src/testcases/org/apache/myrmidon/framework/file/test/TestFileList.java
  19. +67
    -0
      proposal/myrmidon/src/testcases/org/apache/myrmidon/framework/file/test/path.ant
  20. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ANTLR.java
  21. +5
    -5
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java
  22. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Javah.java
  23. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/PathConvert.java
  24. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Property.java
  25. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/SQLExec.java
  26. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java
  27. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Gcj.java
  28. +4
    -4
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Javac.java
  29. +3
    -3
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jikes.java
  30. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jvc.java
  31. +3
    -3
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Kjc.java
  32. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/DocletInfo.java
  33. +8
    -8
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java
  34. +3
    -3
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend/JDependTask.java
  35. +3
    -3
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/JspC.java
  36. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java
  37. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java
  38. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/AbstractMetamataTask.java
  39. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MAudit.java
  40. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MMetrics.java
  41. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java
  42. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/DefaultRmicAdapter.java
  43. +2
    -2
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/Rmic.java
  44. +4
    -4
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovReport.java
  45. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java

+ 10
- 2
proposal/myrmidon/build.xml View File

@@ -568,8 +568,16 @@ Legal:
</jar>

<!-- Prepare the project tests -->
<copy file="${test.working.dir}/org/apache/antlib/core/test/ant-descriptor.xml"
tofile="${test.classes}/META-INF/ant-descriptor.xml"/>
<antlib-descriptor libName="unittests"
destdir="${gen.dir}"
classpathref="project.class.path">
<fileset dir="src/testcases">
<include name="org/apache/antlib/**"/>
<include name="org/apache/myrmidon/framework/**"/>
</fileset>
</antlib-descriptor>
<copy file="${gen.dir}/unittests-ant-descriptor.xml"
tofile="${test.classes}/META-INF/ant-descriptor.xml"/>

<!-- Run all the tests -->
<junit printsummary="on" fork="true" failureProperty="test.failed">


+ 1
- 1
proposal/myrmidon/src/java/org/apache/antlib/core/AbstractAvailableCondition.java View File

@@ -33,7 +33,7 @@ public abstract class AbstractAvailableCondition
public void addClasspath( final Path classpath )
throws TaskException
{
m_classpath.addPath( classpath );
m_classpath.add( classpath );
}

/**


+ 1
- 1
proposal/myrmidon/src/java/org/apache/antlib/dotnet/CSharp.java View File

@@ -396,7 +396,7 @@ public class CSharp
{
m_referenceFiles = new Path();
}
m_referenceFiles.addPath( path );
m_referenceFiles.add( path );
}

/**


+ 49
- 0
proposal/myrmidon/src/java/org/apache/antlib/file/ListPathTask.java View File

@@ -0,0 +1,49 @@
/*
* 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.antlib.file;

import org.apache.myrmidon.api.AbstractTask;
import org.apache.myrmidon.api.TaskException;
import org.apache.myrmidon.framework.file.FileList;
import org.apache.myrmidon.framework.file.Path;

/**
* A diagnostic task that lists the contents of a path.
*
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
* @version $Revision$ $Date$
*
* @ant:task name="list-path"
*/
public class ListPathTask
extends AbstractTask
{
private final Path m_path = new Path();

/**
* Adds a nested path.
*/
public void add( final FileList list )
{
m_path.add( list );
}

/**
* Executes the task.
*/
public void execute()
throws TaskException
{
final String[] files = m_path.listFiles( getContext() );
for( int i = 0; i < files.length; i++ )
{
final String file = files[ i ];
getContext().warn( file );
}
}
}

+ 1
- 1
proposal/myrmidon/src/java/org/apache/antlib/java/JavaTask.java View File

@@ -44,7 +44,7 @@ public class JavaTask
public void addClasspath( final Path classpath )
throws TaskException
{
m_exec.getClassPath().addPath( classpath );
m_exec.getClassPath().add( classpath );
}

/**


+ 2
- 2
proposal/myrmidon/src/java/org/apache/antlib/xml/XMLValidateTask.java View File

@@ -109,7 +109,7 @@ public class XMLValidateTask
}
else
{
m_classpath.addPath( classpath );
m_classpath.add( classpath );
}
}

@@ -170,7 +170,7 @@ public class XMLValidateTask
}
Path path1 = m_classpath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}



+ 1
- 1
proposal/myrmidon/src/java/org/apache/antlib/xml/XSLTProcess.java View File

@@ -142,7 +142,7 @@ public class XSLTProcess
{
m_classpath = new Path();
}
m_classpath.addPath( path );
m_classpath.add( path );
}

public void addParam( final XSLTParam param )


+ 2
- 0
proposal/myrmidon/src/java/org/apache/myrmidon/framework/FileSet.java View File

@@ -15,6 +15,8 @@ import java.io.File;
*
* @author <a href="mailto:peter@apache.org">Peter Donald</a>
* @version $Revision$ $Date$
*
* @ant:data-type name="fileset"
*/
public class FileSet
extends AbstractFileSet


+ 2
- 1
proposal/myrmidon/src/java/org/apache/myrmidon/framework/Pattern.java View File

@@ -100,7 +100,8 @@ public class Pattern
{
try
{
final boolean result = getCondition().evaluate( context );
final Condition condition = getCondition();
final boolean result = ( condition == null || condition.evaluate( context ) );
if( result )
{
return getName();


+ 2
- 0
proposal/myrmidon/src/java/org/apache/myrmidon/framework/file/FileList.java View File

@@ -15,6 +15,8 @@ import org.apache.myrmidon.api.TaskException;
*
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
* @version $Revision$ $Date$
*
* @ant:role shorthand="path"
*/
public interface FileList
{


+ 7
- 7
proposal/myrmidon/src/java/org/apache/myrmidon/framework/file/Path.java View File

@@ -59,7 +59,7 @@ public class Path

public Path( final String path )
{
addPath( path );
add( path );
}

public Path()
@@ -110,13 +110,13 @@ public class Path
*/
public void setPath( final String path )
{
addPath( path );
add( path );
}

/**
* Adds a path.
*/
public void addPath( final String path )
public void add( final String path )
{
final FileList pathElement = new ParsedPathElement( path );
m_elements.add( pathElement );
@@ -125,18 +125,18 @@ public class Path
/**
* Adds a path.
*/
public void addPath( final String[] path )
public void add( final String[] path )
{
final FileList pathElement = new ArrayFileList( path );
m_elements.add( pathElement );
}

/**
* Creates a nested <code>&lt;path&gt;</code> element.
* Adds a path.
*/
public void addPath( final Path path )
public void add( final FileList list )
{
m_elements.add( path );
m_elements.add( list );
}

/**


+ 0
- 5
proposal/myrmidon/src/test/org/apache/antlib/core/test/ant-descriptor.xml View File

@@ -1,5 +0,0 @@
<ant-lib version="1.0">
<types>
<data-type name="property-test-type" classname="org.apache.antlib.core.test.PropertyTestType"/>
</types>
</ant-lib>

+ 99
- 0
proposal/myrmidon/src/test/org/apache/myrmidon/framework/file/test/PathTestCase.java View File

@@ -0,0 +1,99 @@
/*
* 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.file.test;

import java.io.File;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.AbstractProjectTest;
import org.apache.myrmidon.LogMessageTracker;

/**
* Test-cases for the <path> data type.
*
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
* @version $Revision$ $Date$
*/
public class PathTestCase
extends AbstractProjectTest
{
public PathTestCase( final String name )
{
super( name );
}

/**
* Tests setting the location attribute.
*/
public void testLocationAttribute() throws Exception
{
testPathContent( "set-location", new String[] { "location" } );
}

/**
* Tests setting the path attribute.
*/
public void testPathAttribute() throws Exception
{
// Test a path with a single file
testPathContent( "set-path", new String[] { "single-file" } );

// Test a path with several files, using ; separator
testPathContent( "set-multi-path", new String[] { "file1", "file2", ".." } );

// Test a path with several files, using : separator
testPathContent( "set-multi-path2", new String[] { "file1", "file2", ".." } );
}

/**
* Test using nested <path> elements.
*/
public void testPathElement() throws Exception
{
testPathContent( "nested-path", new String[] { "some-file" } );
testPathContent( "mixed-path", new String[] { "file1", "file2", "file3", "file4", "file5" } );
}

/**
* Test using nested <fileset> elements.
*/
public void testFilesetElement() throws Exception
{
testPathContent( "set-fileset", new String[] { "path.ant" } );
}

/**
* Test using a nested custom file list implementation.
*/
public void testCustomFileList() throws Exception
{
testPathContent( "test-custom-file-list", new String[] { "file1" } );
}

/**
* Executes a target, and asserts that a particular list of file names
* is logged.
*/
private void testPathContent( final String targetName,
final String[] files ) throws Exception
{
final File projectFile = getTestResource( "path.ant" );
final File baseDir = projectFile.getParentFile();

// Add each of the expected file names
final LogMessageTracker listener = new LogMessageTracker();
for( int i = 0; i < files.length; i++ )
{
final String fileName = files[ i ];
final File file = FileUtil.resolveFile( baseDir, fileName );
listener.addExpectedMessage( targetName, file.getAbsolutePath() );
}

// Execute the target
executeTarget( projectFile, targetName, listener );
}
}

+ 42
- 0
proposal/myrmidon/src/test/org/apache/myrmidon/framework/file/test/TestFileList.java View File

@@ -0,0 +1,42 @@
/*
* 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.file.test;

import org.apache.myrmidon.framework.file.FileList;
import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
import java.io.File;

/**
* A test FileList implementation.
*
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
* @version $Revision$ $Date$
*
* @ant:type type="path" name="test-file-list"
*/
public class TestFileList
implements FileList
{
private String m_name;

public void setName( final String name )
{
m_name = name;
}

/**
* Returns the files in this list.
*/
public String[] listFiles( final TaskContext context )
throws TaskException
{
final File file = context.resolveFile( m_name );
return new String[] { file.getAbsolutePath() };
}
}

+ 67
- 0
proposal/myrmidon/src/test/org/apache/myrmidon/framework/file/test/path.ant View File

@@ -0,0 +1,67 @@
<project version="2.0">
<!-- Test setting the location attribute -->
<target name="set-location">
<list-path>
<path location="location"/>
</list-path>
</target>

<!-- Test setting the path attribute -->
<target name="set-path">
<list-path>
<path path="single-file"/>
</list-path>
</target>

<!-- Test setting the path attribute -->
<target name="set-multi-path">
<list-path>
<path path="file1;file2;.."/>
</list-path>
</target>

<!-- Test setting the path attribute -->
<target name="set-multi-path2">
<list-path>
<path path="file1:file2:.."/>
</list-path>
</target>

<!-- Test using a nested <path> element -->
<target name="nested-path">
<list-path>
<path>
<path location="some-file"/>
</path>
</list-path>
</target>

<!-- Test using a mix of attributes and nested <path> elements -->
<target name="mixed-path">
<list-path>
<path location="file1" path="file2;file3">
<path location="file4"/>
<path location="file5"/>
</path>
</list-path>
</target>

<!-- Test using a nested fileset -->
<target name="set-fileset">
<list-path>
<path>
<fileset dir="." includes="**/path.ant"/>
</path>
</list-path>
</target>

<!-- Test using a custom file list implementation -->
<target name="test-custom-file-list">
<list-path>
<path>
<test-file-list name="file1"/>
</path>
</list-path>
</target>

</project>

+ 0
- 5
proposal/myrmidon/src/testcases/org/apache/antlib/core/test/ant-descriptor.xml View File

@@ -1,5 +0,0 @@
<ant-lib version="1.0">
<types>
<data-type name="property-test-type" classname="org.apache.antlib.core.test.PropertyTestType"/>
</types>
</ant-lib>

+ 99
- 0
proposal/myrmidon/src/testcases/org/apache/myrmidon/framework/file/test/PathTestCase.java View File

@@ -0,0 +1,99 @@
/*
* 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.file.test;

import java.io.File;
import org.apache.avalon.excalibur.io.FileUtil;
import org.apache.myrmidon.AbstractProjectTest;
import org.apache.myrmidon.LogMessageTracker;

/**
* Test-cases for the <path> data type.
*
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
* @version $Revision$ $Date$
*/
public class PathTestCase
extends AbstractProjectTest
{
public PathTestCase( final String name )
{
super( name );
}

/**
* Tests setting the location attribute.
*/
public void testLocationAttribute() throws Exception
{
testPathContent( "set-location", new String[] { "location" } );
}

/**
* Tests setting the path attribute.
*/
public void testPathAttribute() throws Exception
{
// Test a path with a single file
testPathContent( "set-path", new String[] { "single-file" } );

// Test a path with several files, using ; separator
testPathContent( "set-multi-path", new String[] { "file1", "file2", ".." } );

// Test a path with several files, using : separator
testPathContent( "set-multi-path2", new String[] { "file1", "file2", ".." } );
}

/**
* Test using nested <path> elements.
*/
public void testPathElement() throws Exception
{
testPathContent( "nested-path", new String[] { "some-file" } );
testPathContent( "mixed-path", new String[] { "file1", "file2", "file3", "file4", "file5" } );
}

/**
* Test using nested <fileset> elements.
*/
public void testFilesetElement() throws Exception
{
testPathContent( "set-fileset", new String[] { "path.ant" } );
}

/**
* Test using a nested custom file list implementation.
*/
public void testCustomFileList() throws Exception
{
testPathContent( "test-custom-file-list", new String[] { "file1" } );
}

/**
* Executes a target, and asserts that a particular list of file names
* is logged.
*/
private void testPathContent( final String targetName,
final String[] files ) throws Exception
{
final File projectFile = getTestResource( "path.ant" );
final File baseDir = projectFile.getParentFile();

// Add each of the expected file names
final LogMessageTracker listener = new LogMessageTracker();
for( int i = 0; i < files.length; i++ )
{
final String fileName = files[ i ];
final File file = FileUtil.resolveFile( baseDir, fileName );
listener.addExpectedMessage( targetName, file.getAbsolutePath() );
}

// Execute the target
executeTarget( projectFile, targetName, listener );
}
}

+ 42
- 0
proposal/myrmidon/src/testcases/org/apache/myrmidon/framework/file/test/TestFileList.java View File

@@ -0,0 +1,42 @@
/*
* 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.file.test;

import org.apache.myrmidon.framework.file.FileList;
import org.apache.myrmidon.api.TaskContext;
import org.apache.myrmidon.api.TaskException;
import java.io.File;

/**
* A test FileList implementation.
*
* @author <a href="mailto:adammurdoch@apache.org">Adam Murdoch</a>
* @version $Revision$ $Date$
*
* @ant:type type="path" name="test-file-list"
*/
public class TestFileList
implements FileList
{
private String m_name;

public void setName( final String name )
{
m_name = name;
}

/**
* Returns the files in this list.
*/
public String[] listFiles( final TaskContext context )
throws TaskException
{
final File file = context.resolveFile( m_name );
return new String[] { file.getAbsolutePath() };
}
}

+ 67
- 0
proposal/myrmidon/src/testcases/org/apache/myrmidon/framework/file/test/path.ant View File

@@ -0,0 +1,67 @@
<project version="2.0">
<!-- Test setting the location attribute -->
<target name="set-location">
<list-path>
<path location="location"/>
</list-path>
</target>

<!-- Test setting the path attribute -->
<target name="set-path">
<list-path>
<path path="single-file"/>
</list-path>
</target>

<!-- Test setting the path attribute -->
<target name="set-multi-path">
<list-path>
<path path="file1;file2;.."/>
</list-path>
</target>

<!-- Test setting the path attribute -->
<target name="set-multi-path2">
<list-path>
<path path="file1:file2:.."/>
</list-path>
</target>

<!-- Test using a nested <path> element -->
<target name="nested-path">
<list-path>
<path>
<path location="some-file"/>
</path>
</list-path>
</target>

<!-- Test using a mix of attributes and nested <path> elements -->
<target name="mixed-path">
<list-path>
<path location="file1" path="file2;file3">
<path location="file4"/>
<path location="file5"/>
</path>
</list-path>
</target>

<!-- Test using a nested fileset -->
<target name="set-fileset">
<list-path>
<path>
<fileset dir="." includes="**/path.ant"/>
</path>
</list-path>
</target>

<!-- Test using a custom file list implementation -->
<target name="test-custom-file-list">
<list-path>
<path>
<test-file-list name="file1"/>
</path>
</list-path>
</target>

</project>

+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/ANTLR.java View File

@@ -69,7 +69,7 @@ public class ANTLR
*/
public void addClasspath( final Path path )
{
m_exe.getClassPath().addPath( path );
m_exe.getClassPath().add( path );
}

/**


+ 5
- 5
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/IContract.java View File

@@ -488,7 +488,7 @@ public class IContract extends MatchingTask
*/
public void setClasspath( final Path path )
{
createClasspath().addPath( path );
createClasspath().add( path );
}

/**
@@ -709,12 +709,12 @@ public class IContract extends MatchingTask

// Create the classpath required to compile the sourcefiles BEFORE instrumentation
Path beforeInstrumentationClasspath = new Path();
beforeInstrumentationClasspath.addPath( baseClasspath );
beforeInstrumentationClasspath.add( baseClasspath );
beforeInstrumentationClasspath.addLocation( srcDir );

// Create the classpath required to compile the sourcefiles AFTER instrumentation
Path afterInstrumentationClasspath = new Path();
afterInstrumentationClasspath.addPath( baseClasspath );
afterInstrumentationClasspath.add( baseClasspath );
afterInstrumentationClasspath.addLocation( instrumentDir );
afterInstrumentationClasspath.addLocation( repositoryDir );
afterInstrumentationClasspath.addLocation( srcDir );
@@ -722,7 +722,7 @@ public class IContract extends MatchingTask

// Create the classpath required to automatically compile the repository files
Path repositoryClasspath = new Path();
repositoryClasspath.addPath( baseClasspath );
repositoryClasspath.add( baseClasspath );
repositoryClasspath.addLocation( instrumentDir );
repositoryClasspath.addLocation( srcDir );
repositoryClasspath.addLocation( repositoryDir );
@@ -730,7 +730,7 @@ public class IContract extends MatchingTask

// Create the classpath required for iContract itself
Path iContractClasspath = new Path();
iContractClasspath.addPath( baseClasspath );
iContractClasspath.add( baseClasspath );
iContractClasspath.addLocation( new File(System.getProperty( "java.home" ) + File.separator + ".." + File.separator + "lib" + File.separator + "tools.jar" ) );
iContractClasspath.addLocation( srcDir );
iContractClasspath.addLocation( repositoryDir );


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Javah.java View File

@@ -79,7 +79,7 @@ public class Javah
}
else
{
m_bootclasspath.addPath( bootclasspath );
m_bootclasspath.add( bootclasspath );
}
}

@@ -100,7 +100,7 @@ public class Javah
}
else
{
m_classpath.addPath( classpath );
m_classpath.add( classpath );
}
}



+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/PathConvert.java View File

@@ -108,7 +108,7 @@ public class PathConvert extends AbstractTask
}
else
{
m_path.addPath( path );
m_path.add( path );
}
}



+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/Property.java View File

@@ -45,7 +45,7 @@ public class Property
}
else
{
m_classpath.addPath( classpath );
m_classpath.add( classpath );
}
}



+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/SQLExec.java View File

@@ -178,7 +178,7 @@ public class SQLExec
}
else
{
this.classpath.addPath( classpath );
this.classpath.add( classpath );
}
}



+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/DefaultCompilerAdapter.java View File

@@ -295,7 +295,7 @@ public abstract class DefaultCompilerAdapter
// add the classpath
if( m_compileClasspath != null )
{
classpath.addPath( m_compileClasspath );
classpath.add( m_compileClasspath );
}
}



+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Gcj.java View File

@@ -50,7 +50,7 @@ public class Gcj extends DefaultCompilerAdapter
// gcj doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
final String[] bootclasspath = m_bootclasspath.listFiles( getTaskContext() );
classpath.addPath( bootclasspath );
classpath.add( bootclasspath );

// gcj doesn't support an extension dir (-extdir)
// so we'll emulate it for compatibility and convenience.
@@ -66,7 +66,7 @@ public class Gcj extends DefaultCompilerAdapter

// Gcj has no option for source-path so we
// will add it to classpath.
classpath.addPath( src );
classpath.add( src );

cmd.setExecutable( "gcj" );



+ 4
- 4
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Javac.java View File

@@ -89,7 +89,7 @@ public class Javac
*/
public void addBootclasspath( final Path bootclasspath )
{
m_bootclasspath.addPath( bootclasspath );
m_bootclasspath.add( bootclasspath );
}

/**
@@ -103,7 +103,7 @@ public class Javac
}
else
{
m_compileClasspath.addPath( classpath );
m_compileClasspath.add( classpath );
}
}

@@ -181,7 +181,7 @@ public class Javac
}
else
{
m_extdirs.addPath( extdirs );
m_extdirs.add( extdirs );
}
}

@@ -282,7 +282,7 @@ public class Javac
}
else
{
m_src.addPath( srcDir );
m_src.add( srcDir );
}
}



+ 3
- 3
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jikes.java View File

@@ -47,7 +47,7 @@ public class Jikes
// Jikes doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
final String[] bootclasspath = m_bootclasspath.listFiles( getTaskContext() );
classpath.addPath( bootclasspath );
classpath.add( bootclasspath );

// Jikes doesn't support an extension dir (-extdir)
// so we'll emulate it for compatibility and convenience.
@@ -67,13 +67,13 @@ public class Jikes

// Jikes has no option for source-path so we
// will add it to classpath.
classpath.addPath( src );
classpath.add( src );

// if the user has set JIKESPATH we should add the contents as well
String jikesPath = System.getProperty( "jikes.class.path" );
if( jikesPath != null )
{
classpath.addPath( jikesPath );
classpath.add( jikesPath );
}

Commandline cmd = new Commandline();


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Jvc.java View File

@@ -35,7 +35,7 @@ public class Jvc extends DefaultCompilerAdapter
// jvc doesn't support bootclasspath dir (-bootclasspath)
// so we'll emulate it for compatibility and convenience.
final String[] bootclasspath = m_bootclasspath.listFiles( getTaskContext() );
classpath.addPath( bootclasspath );
classpath.add( bootclasspath );

// jvc doesn't support an extension dir (-extdir)
// so we'll emulate it for compatibility and convenience.
@@ -55,7 +55,7 @@ public class Jvc extends DefaultCompilerAdapter

// jvc has no option for source-path so we
// will add it to classpath.
classpath.addPath( src );
classpath.add( src );

Commandline cmd = new Commandline();
cmd.setExecutable( "jvc" );


+ 3
- 3
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javac/Kjc.java View File

@@ -89,15 +89,15 @@ public class Kjc extends DefaultCompilerAdapter
Path cp = new Path();

// kjc don't have bootclasspath option.
cp.addPath( m_bootclasspath );
cp.add( m_bootclasspath );

if( m_extdirs != null )
{
addExtdirs( cp );
}

cp.addPath( classpath );
cp.addPath( src );
cp.add( classpath );
cp.add( src );

cmd.addArgument( PathUtil.formatPath( cp, getTaskContext() ) );



+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/DocletInfo.java View File

@@ -32,7 +32,7 @@ public class DocletInfo
}
else
{
m_path.addPath( path );
m_path.add( path );
}
}

@@ -67,7 +67,7 @@ public class DocletInfo
}
Path path1 = m_path;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}
}

+ 8
- 8
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/javadoc/Javadoc.java View File

@@ -114,7 +114,7 @@ public class Javadoc
}
else
{
m_bootclasspath.addPath( src );
m_bootclasspath.add( src );
}
}

@@ -139,7 +139,7 @@ public class Javadoc
}
else
{
m_classpath.addPath( src );
m_classpath.add( src );
}
}

@@ -384,7 +384,7 @@ public class Javadoc
}
else
{
m_sourcePath.addPath( src );
m_sourcePath.add( src );
}
}

@@ -475,7 +475,7 @@ public class Javadoc
}
Path path1 = m_bootclasspath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}

@@ -488,7 +488,7 @@ public class Javadoc
}
Path path1 = m_classpath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}

@@ -521,7 +521,7 @@ public class Javadoc
}
Path path1 = m_sourcePath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}

@@ -564,10 +564,10 @@ public class Javadoc

// Build the classpath to pass to Javadoc
Path classpath = new Path();
classpath.addPath( m_sourcePath );
classpath.add( m_sourcePath );
if( m_classpath != null )
{
classpath.addPath( m_classpath );
classpath.add( m_classpath );
}
cmd.addArgument( "-classpath" );
cmd.addArgument( PathUtil.formatPath( classpath, getContext() ) );


+ 3
- 3
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jdepend/JDependTask.java View File

@@ -105,7 +105,7 @@ public class JDependTask
*/
public void addClasspath( final Path path )
{
m_compileClasspath.addPath( path );
m_compileClasspath.add( path );
}

/**
@@ -119,7 +119,7 @@ public class JDependTask
}
Path path1 = m_sourcesPath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}

@@ -169,7 +169,7 @@ public class JDependTask
exe.setJvm( m_jvm );
}

exe.getClassPath().addPath( m_compileClasspath );
exe.getClassPath().add( m_compileClasspath );

if( m_outputFile != null )
{


+ 3
- 3
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/JspC.java View File

@@ -107,7 +107,7 @@ public class JspC extends MatchingTask
}
else
{
classpath.addPath( cp );
classpath.add( cp );
}
}

@@ -185,7 +185,7 @@ public class JspC extends MatchingTask
}
else
{
src.addPath( srcDir );
src.add( srcDir );
}
}

@@ -308,7 +308,7 @@ public class JspC extends MatchingTask
}
Path path1 = classpath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}



+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/jsp/WLJspc.java View File

@@ -82,7 +82,7 @@ public class WLJspc extends MatchingTask
}
else
{
compileClasspath.addPath( classpath );
compileClasspath.add( classpath );
}
}

@@ -219,7 +219,7 @@ public class WLJspc extends MatchingTask
ExecuteJava helperTask = new ExecuteJava();
helperTask.setClassName( "weblogic.jspc" );
helperTask.getArguments().addArguments( args );
helperTask.getClassPath().addPath( compileClasspath );
helperTask.getClassPath().add( compileClasspath );
helperTask.executeForked( getContext() );
}
}


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/junit/JUnitTask.java View File

@@ -331,7 +331,7 @@ public class JUnitTask extends AbstractTask
*/
public void addClasspath( final Path path )
{
classPath.addPath( path );
classPath.add( path );
}

/**
@@ -567,7 +567,7 @@ public class JUnitTask extends AbstractTask
cmd.setIgnoreReturnCode( true );
cmd.setWorkingDirectory( dir );
cmd.setMaxMemory( maxMem );
cmd.getClassPath().addPath( classPath );
cmd.getClassPath().add( classPath );
cmd.getVmArguments().addArguments( vmArgs );
cmd.getSysProperties().addVariables( sysProperties );



+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/AbstractMetamataTask.java View File

@@ -128,7 +128,7 @@ public abstract class AbstractMetamataTask
*/
public void addClasspath( final Path path )
{
m_exe.getClassPath().addPath( path );
m_exe.getClassPath().add( path );
}

/**
@@ -144,7 +144,7 @@ public abstract class AbstractMetamataTask
*/
public void addSourcepath( final Path path )
{
m_sourcePath.addPath( path );
m_sourcePath.add( path );
}

/**


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MAudit.java View File

@@ -124,10 +124,10 @@ public class MAudit
// there is a bug in Metamata 2.0 build 37. The sourcepath argument does
// not work. So we will use the sourcepath prepended to classpath. (order
// is important since Metamata looks at .class and .java)
classpath.addPath( getSourcePath() );
classpath.add( getSourcePath() );

// don't forget to modify the pattern if you change the options reporting
classpath.addPath( getClassPath() );
classpath.add( getClassPath() );

final String formattedClasspath = PathUtil.formatPath( classpath, getContext() );
if( formattedClasspath.length() > 0 )


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MMetrics.java View File

@@ -127,10 +127,10 @@ public class MMetrics extends AbstractMetamataTask
// there is a bug in Metamata 2.0 build 37. The sourcepath argument does
// not work. So we will use the sourcepath prepended to classpath. (order
// is important since Metamata looks at .class and .java)
classpath.addPath( getSourcePath() );
classpath.add( getSourcePath() );

// don't forget to modify the pattern if you change the options reporting
classpath.addPath( getClassPath() );
classpath.add( getClassPath() );

final String formattedClasspath = PathUtil.formatPath( classpath, getContext() );
if( formattedClasspath.length() > 0 )


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/metamata/MParse.java View File

@@ -132,7 +132,7 @@ public class MParse
*/
public void addClasspath( final Path path )
{
m_classpath.addPath( path );
m_classpath.add( path );
}

/**
@@ -148,7 +148,7 @@ public class MParse
*/
public void addSourcepath( final Path path )
{
m_sourcepath.addPath( path );
m_sourcepath.add( path );
}

/**


+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/DefaultRmicAdapter.java View File

@@ -195,7 +195,7 @@ public abstract class DefaultRmicAdapter
// add the classpath
if( attributes.getClasspath() != null )
{
classpath.addPath( attributes.getClasspath() );
classpath.add( attributes.getClasspath() );
}

return classpath;


+ 2
- 2
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/rmic/Rmic.java View File

@@ -116,7 +116,7 @@ public class Rmic extends MatchingTask
}
else
{
compileClasspath.addPath( classpath );
compileClasspath.add( classpath );
}
}

@@ -145,7 +145,7 @@ public class Rmic extends MatchingTask
}
else
{
this.extdirs.addPath( extdirs );
this.extdirs.add( extdirs );
}
}



+ 4
- 4
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/CovReport.java View File

@@ -206,7 +206,7 @@ public class CovReport
}
Path path1 = coveragePath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}

@@ -227,7 +227,7 @@ public class CovReport
}
Path path1 = sourcePath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}

@@ -292,7 +292,7 @@ public class CovReport
sourcePath = new Path();
Path path1 = sourcePath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
path.setLocation( getBaseDirectory() );
}
v.add( "-sourcepath=" + sourcePath );
@@ -368,7 +368,7 @@ public class CovReport
}
Path path1 = classPath;
final Path path = new Path();
path1.addPath( path );
path1.add( path );
return path;
}



+ 1
- 1
proposal/myrmidon/src/todo/org/apache/tools/todo/taskdefs/sitraka/Coverage.java View File

@@ -184,7 +184,7 @@ public class Coverage
*/
public void setClasspath( final Path path )
{
m_classpath.addPath( path );
m_classpath.add( path );
}

public Filters createFilters()


Loading…
Cancel
Save