git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270509 13f79535-47bb-0310-9956-ffa450edef68master
@@ -15,7 +15,6 @@ import org.apache.tools.ant.Task; | |||||
import org.apache.tools.ant.taskdefs.condition.Condition; | import org.apache.tools.ant.taskdefs.condition.Condition; | ||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* Will set the given property if the requested resource is available at | * Will set the given property if the requested resource is available at | ||||
@@ -55,12 +54,6 @@ public class Available | |||||
createClasspath().append( classpath ); | createClasspath().append( classpath ); | ||||
} | } | ||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
public void setFile( String file ) | public void setFile( String file ) | ||||
{ | { | ||||
m_file = file; | m_file = file; | ||||
@@ -179,12 +179,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileList targetFL = (FileList)enumTargetLists.next(); | FileList targetFL = (FileList)enumTargetLists.next(); | ||||
String[] targetFiles = targetFL.getFiles( getProject() ); | |||||
String[] targetFiles = targetFL.getFiles(); | |||||
for( int i = 0; i < targetFiles.length; i++ ) | for( int i = 0; i < targetFiles.length; i++ ) | ||||
{ | { | ||||
File dest = new File( targetFL.getDir( getProject() ), targetFiles[ i ] ); | |||||
File dest = new File( targetFL.getDir(), targetFiles[ i ] ); | |||||
if( !dest.exists() ) | if( !dest.exists() ) | ||||
{ | { | ||||
getLogger().debug( targetFiles[ i ] + " does not exist." ); | getLogger().debug( targetFiles[ i ] + " does not exist." ); | ||||
@@ -250,12 +250,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileList sourceFL = (FileList)enumSourceLists.next(); | FileList sourceFL = (FileList)enumSourceLists.next(); | ||||
String[] sourceFiles = sourceFL.getFiles( getProject() ); | |||||
String[] sourceFiles = sourceFL.getFiles(); | |||||
int i = 0; | int i = 0; | ||||
do | do | ||||
{ | { | ||||
File src = new File( sourceFL.getDir( getProject() ), sourceFiles[ i ] ); | |||||
File src = new File( sourceFL.getDir(), sourceFiles[ i ] ); | |||||
if( src.lastModified() > now ) | if( src.lastModified() > now ) | ||||
{ | { | ||||
@@ -20,7 +20,6 @@ import org.apache.tools.ant.types.Argument; | |||||
import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
import org.apache.tools.ant.types.EnvironmentVariable; | import org.apache.tools.ant.types.EnvironmentVariable; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* This task acts as a loader for java applications but allows to use the same | * This task acts as a loader for java applications but allows to use the same | ||||
@@ -67,17 +66,6 @@ public class Java extends Task | |||||
createClasspath().append( s ); | createClasspath().append( s ); | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* The working directory of the process | * The working directory of the process | ||||
* | * | ||||
@@ -18,7 +18,6 @@ import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter; | |||||
import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | ||||
import org.apache.tools.ant.types.Argument; | import org.apache.tools.ant.types.Argument; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
import org.apache.tools.ant.util.GlobPatternMapper; | import org.apache.tools.ant.util.GlobPatternMapper; | ||||
import org.apache.tools.ant.util.SourceFileScanner; | import org.apache.tools.ant.util.SourceFileScanner; | ||||
@@ -88,17 +87,6 @@ public class Javac extends MatchingTask | |||||
private Path src; | private Path src; | ||||
private String target; | private String target; | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new BootClasspathRef value | |||||
*/ | |||||
public void setBootClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createBootclasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Sets the bootclasspath that will be used to compile the classes against. | * Sets the bootclasspath that will be used to compile the classes against. | ||||
* | * | ||||
@@ -135,17 +123,6 @@ public class Javac extends MatchingTask | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Set the debug flag. | * Set the debug flag. | ||||
* | * | ||||
@@ -11,7 +11,6 @@ import java.io.File; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.types.FileSet; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | import org.apache.tools.ant.types.Reference; | ||||
@@ -160,27 +159,6 @@ public class PathConvert extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
// If we are a reference, the create a Path from the reference | // If we are a reference, the create a Path from the reference | ||||
if( isReference() ) | |||||
{ | |||||
path = new Path().createPath(); | |||||
Object obj = refid.getReferencedObject( getProject() ); | |||||
if( obj instanceof Path ) | |||||
{ | |||||
path.setRefid( refid ); | |||||
} | |||||
else if( obj instanceof FileSet ) | |||||
{ | |||||
FileSet fs = (FileSet)obj; | |||||
path.addFileset( fs ); | |||||
} | |||||
else | |||||
{ | |||||
throw new TaskException( "'refid' does not refer to a path or fileset" ); | |||||
} | |||||
} | |||||
validateSetup();// validate our setup | validateSetup();// validate our setup | ||||
// Currently, we deal with only two path formats: Unix and Windows | // Currently, we deal with only two path formats: Unix and Windows | ||||
@@ -55,12 +55,6 @@ public class Property | |||||
} | } | ||||
} | } | ||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
public void setEnvironment( String env ) | public void setEnvironment( String env ) | ||||
{ | { | ||||
m_env = env; | m_env = env; | ||||
@@ -18,7 +18,6 @@ import org.apache.tools.ant.DirectoryScanner; | |||||
import org.apache.tools.ant.taskdefs.rmic.RmicAdapter; | import org.apache.tools.ant.taskdefs.rmic.RmicAdapter; | ||||
import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory; | import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
import org.apache.tools.ant.util.FileNameMapper; | import org.apache.tools.ant.util.FileNameMapper; | ||||
import org.apache.tools.ant.util.SourceFileScanner; | import org.apache.tools.ant.util.SourceFileScanner; | ||||
@@ -120,17 +119,6 @@ public class Rmic extends MatchingTask | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Sets the debug flag. | * Sets the debug flag. | ||||
* | * | ||||
@@ -37,7 +37,6 @@ import org.apache.tools.ant.Task; | |||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* Reads in a text file containing SQL statements seperated with semicolons and | * Reads in a text file containing SQL statements seperated with semicolons and | ||||
@@ -180,17 +179,6 @@ public class SQLExec | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Set the classpath for loading the driver using the classpath reference. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Set the statement delimiter. <p> | * Set the statement delimiter. <p> | ||||
* | * | ||||
@@ -11,7 +11,6 @@ import java.util.ArrayList; | |||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
public class DocletInfo | public class DocletInfo | ||||
{ | { | ||||
@@ -37,17 +36,6 @@ public class DocletInfo | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new PathRef value | |||||
*/ | |||||
public void setPathRef( final Reference reference ) | |||||
throws TaskException | |||||
{ | |||||
createPath().setRefid( reference ); | |||||
} | |||||
public String getName() | public String getName() | ||||
{ | { | ||||
return m_name; | return m_name; | ||||
@@ -23,7 +23,6 @@ import org.apache.tools.ant.taskdefs.exec.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* This task makes it easy to generate Javadoc documentation for a collection of | * This task makes it easy to generate Javadoc documentation for a collection of | ||||
@@ -102,17 +101,6 @@ public class Javadoc | |||||
m_author = src; | m_author = src; | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new BootClasspathRef value | |||||
*/ | |||||
public void setBootClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createBootclasspath().setRefid( r ); | |||||
} | |||||
public void setBootclasspath( Path src ) | public void setBootclasspath( Path src ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
@@ -151,17 +139,6 @@ public class Javadoc | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Sets whether default exclusions should be used or not. | * Sets whether default exclusions should be used or not. | ||||
* | * | ||||
@@ -205,16 +182,6 @@ public class Javadoc | |||||
m_doclet.setPath( src ); | m_doclet.setPath( src ); | ||||
} | } | ||||
public void setDocletPathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
if( m_doclet == null ) | |||||
{ | |||||
m_doclet = new DocletInfo(); | |||||
} | |||||
m_doclet.createPath().setRefid( r ); | |||||
} | |||||
public void setDoctitle( String src ) | public void setDoctitle( String src ) | ||||
{ | { | ||||
Html h = new Html(); | Html h = new Html(); | ||||
@@ -417,17 +384,6 @@ public class Javadoc | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new SourcepathRef value | |||||
*/ | |||||
public void setSourcepathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createSourcepath().setRefid( r ); | |||||
} | |||||
public void setSplitindex( boolean b ) | public void setSplitindex( boolean b ) | ||||
{ | { | ||||
addArgIf( b, "-splitindex" ); | addArgIf( b, "-splitindex" ); | ||||
@@ -24,7 +24,6 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
import org.apache.tools.ant.taskdefs.MatchingTask; | import org.apache.tools.ant.taskdefs.MatchingTask; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* Generate a dependency file for a given set of classes | * Generate a dependency file for a given set of classes | ||||
@@ -117,17 +116,6 @@ public class Depend extends MatchingTask | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
public void setClosure( boolean closure ) | public void setClosure( boolean closure ) | ||||
{ | { | ||||
this.closure = closure; | this.closure = closure; | ||||
@@ -13,7 +13,6 @@ import org.apache.tools.ant.Task; | |||||
import org.apache.tools.ant.taskdefs.Java; | import org.apache.tools.ant.taskdefs.Java; | ||||
import org.apache.tools.ant.taskdefs.exec.ExecTask; | import org.apache.tools.ant.taskdefs.exec.ExecTask; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | * BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | ||||
@@ -66,12 +65,6 @@ public class BorlandGenerateClient extends Task | |||||
} | } | ||||
} | } | ||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
public void setClientjar( File clientjar ) | public void setClientjar( File clientjar ) | ||||
{ | { | ||||
clientjarfile = clientjar; | clientjarfile = clientjar; | ||||
@@ -16,7 +16,6 @@ import org.apache.tools.ant.taskdefs.MatchingTask; | |||||
import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapter; | import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapter; | ||||
import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapterFactory; | import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapterFactory; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* Ant task to run the jsp compiler. <p> | * Ant task to run the jsp compiler. <p> | ||||
@@ -108,20 +107,6 @@ public class JspC extends MatchingTask | |||||
classpath.append( cp ); | classpath.append( cp ); | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/* | |||||
* ------------------------------------------------------------ | |||||
*/ | |||||
/** | /** | ||||
* Set the destination directory into which the JSP source files should be | * Set the destination directory into which the JSP source files should be | ||||
* compiled. | * compiled. | ||||
@@ -7,8 +7,6 @@ | |||||
*/ | */ | ||||
package org.apache.tools.ant.taskdefs.security; | package org.apache.tools.ant.taskdefs.security; | ||||
import java.util.ArrayList; | |||||
import java.util.Iterator; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.exec.ExecTask; | import org.apache.tools.ant.taskdefs.exec.ExecTask; | ||||
@@ -240,11 +240,11 @@ public class ReplaceRegExp extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
String res = input; | String res = input; | ||||
Regexp regexp = r.getRegexp( getProject() ); | |||||
Regexp regexp = r.getRegexp(); | |||||
if( regexp.matches( input, options ) ) | if( regexp.matches( input, options ) ) | ||||
{ | { | ||||
res = regexp.substitute( input, s.getExpression( getProject() ), options ); | |||||
res = regexp.substitute( input, s.getExpression(), options ); | |||||
} | } | ||||
return res; | return res; | ||||
@@ -277,8 +277,8 @@ public class ReplaceRegExp extends Task | |||||
boolean changes = false; | boolean changes = false; | ||||
final String message = "Replacing pattern '" + regex.getPattern( getProject() ) + | |||||
"' with '" + subs.getExpression( getProject() ) + | |||||
final String message = "Replacing pattern '" + regex.getPattern() + | |||||
"' with '" + subs.getExpression() + | |||||
"' in '" + f.getPath() + "'" + | "' in '" + f.getPath() + "'" + | ||||
( byline ? " by line" : "" ) + | ( byline ? " by line" : "" ) + | ||||
( flags.length() > 0 ? " with flags: '" + flags + "'" : "" ) + | ( flags.length() > 0 ? " with flags: '" + flags + "'" : "" ) + | ||||
@@ -7,10 +7,7 @@ | |||||
*/ | */ | ||||
package org.apache.tools.ant.taskdefs.text; | package org.apache.tools.ant.taskdefs.text; | ||||
import java.util.Stack; | |||||
import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.Project; | |||||
import org.apache.tools.ant.types.DataType; | |||||
import org.apache.tools.ant.ProjectComponent; | |||||
/** | /** | ||||
* A regular expression substitution datatype. It is an expression that is meant | * A regular expression substitution datatype. It is an expression that is meant | ||||
@@ -24,65 +21,20 @@ import org.apache.tools.ant.types.DataType; | |||||
* @see org.apache.oro.text.regex.Perl5Substitition | * @see org.apache.oro.text.regex.Perl5Substitition | ||||
*/ | */ | ||||
public class Substitution | public class Substitution | ||||
extends DataType | |||||
extends ProjectComponent | |||||
{ | { | ||||
public final static String DATA_TYPE_NAME = "substitition"; | |||||
private String m_expression; | |||||
private String expression; | |||||
public Substitution() | |||||
{ | |||||
this.expression = null; | |||||
} | |||||
public void setExpression( String expression ) | |||||
public void setExpression( final String expression ) | |||||
{ | { | ||||
this.expression = expression; | |||||
m_expression = expression; | |||||
} | } | ||||
/** | /** | ||||
* Gets the pattern string for this RegularExpression in the given project. | * Gets the pattern string for this RegularExpression in the given project. | ||||
* | |||||
* @param p Description of Parameter | |||||
* @return The Expression value | |||||
*/ | */ | ||||
public String getExpression( Project p ) | |||||
throws TaskException | |||||
public String getExpression() | |||||
{ | { | ||||
if( isReference() ) | |||||
{ | |||||
return getRef( p ).getExpression( p ); | |||||
} | |||||
return expression; | |||||
} | |||||
/** | |||||
* Get the RegularExpression this reference refers to in the given project. | |||||
* Check for circular references too | |||||
* | |||||
* @param p Description of Parameter | |||||
* @return The Ref value | |||||
*/ | |||||
public Substitution getRef( Project p ) | |||||
throws TaskException | |||||
{ | |||||
if( !checked ) | |||||
{ | |||||
Stack stk = new Stack(); | |||||
stk.push( this ); | |||||
dieOnCircularReference( stk, p ); | |||||
} | |||||
Object o = ref.getReferencedObject( p ); | |||||
if( !( o instanceof Substitution ) ) | |||||
{ | |||||
String msg = ref.getRefId() + " doesn\'t denote a substitution"; | |||||
throw new TaskException( msg ); | |||||
} | |||||
else | |||||
{ | |||||
return (Substitution)o; | |||||
} | |||||
return m_expression; | |||||
} | } | ||||
} | } |
@@ -15,7 +15,6 @@ import org.apache.tools.ant.Task; | |||||
import org.apache.tools.ant.taskdefs.condition.Condition; | import org.apache.tools.ant.taskdefs.condition.Condition; | ||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* Will set the given property if the requested resource is available at | * Will set the given property if the requested resource is available at | ||||
@@ -55,12 +54,6 @@ public class Available | |||||
createClasspath().append( classpath ); | createClasspath().append( classpath ); | ||||
} | } | ||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
public void setFile( String file ) | public void setFile( String file ) | ||||
{ | { | ||||
m_file = file; | m_file = file; | ||||
@@ -179,12 +179,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileList targetFL = (FileList)enumTargetLists.next(); | FileList targetFL = (FileList)enumTargetLists.next(); | ||||
String[] targetFiles = targetFL.getFiles( getProject() ); | |||||
String[] targetFiles = targetFL.getFiles(); | |||||
for( int i = 0; i < targetFiles.length; i++ ) | for( int i = 0; i < targetFiles.length; i++ ) | ||||
{ | { | ||||
File dest = new File( targetFL.getDir( getProject() ), targetFiles[ i ] ); | |||||
File dest = new File( targetFL.getDir(), targetFiles[ i ] ); | |||||
if( !dest.exists() ) | if( !dest.exists() ) | ||||
{ | { | ||||
getLogger().debug( targetFiles[ i ] + " does not exist." ); | getLogger().debug( targetFiles[ i ] + " does not exist." ); | ||||
@@ -250,12 +250,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileList sourceFL = (FileList)enumSourceLists.next(); | FileList sourceFL = (FileList)enumSourceLists.next(); | ||||
String[] sourceFiles = sourceFL.getFiles( getProject() ); | |||||
String[] sourceFiles = sourceFL.getFiles(); | |||||
int i = 0; | int i = 0; | ||||
do | do | ||||
{ | { | ||||
File src = new File( sourceFL.getDir( getProject() ), sourceFiles[ i ] ); | |||||
File src = new File( sourceFL.getDir(), sourceFiles[ i ] ); | |||||
if( src.lastModified() > now ) | if( src.lastModified() > now ) | ||||
{ | { | ||||
@@ -20,7 +20,6 @@ import org.apache.tools.ant.types.Argument; | |||||
import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
import org.apache.tools.ant.types.EnvironmentVariable; | import org.apache.tools.ant.types.EnvironmentVariable; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* This task acts as a loader for java applications but allows to use the same | * This task acts as a loader for java applications but allows to use the same | ||||
@@ -67,17 +66,6 @@ public class Java extends Task | |||||
createClasspath().append( s ); | createClasspath().append( s ); | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* The working directory of the process | * The working directory of the process | ||||
* | * | ||||
@@ -18,7 +18,6 @@ import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter; | |||||
import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | ||||
import org.apache.tools.ant.types.Argument; | import org.apache.tools.ant.types.Argument; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
import org.apache.tools.ant.util.GlobPatternMapper; | import org.apache.tools.ant.util.GlobPatternMapper; | ||||
import org.apache.tools.ant.util.SourceFileScanner; | import org.apache.tools.ant.util.SourceFileScanner; | ||||
@@ -88,17 +87,6 @@ public class Javac extends MatchingTask | |||||
private Path src; | private Path src; | ||||
private String target; | private String target; | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new BootClasspathRef value | |||||
*/ | |||||
public void setBootClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createBootclasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Sets the bootclasspath that will be used to compile the classes against. | * Sets the bootclasspath that will be used to compile the classes against. | ||||
* | * | ||||
@@ -135,17 +123,6 @@ public class Javac extends MatchingTask | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Set the debug flag. | * Set the debug flag. | ||||
* | * | ||||
@@ -11,7 +11,6 @@ import java.io.File; | |||||
import java.util.ArrayList; | import java.util.ArrayList; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.types.FileSet; | |||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | import org.apache.tools.ant.types.Reference; | ||||
@@ -160,27 +159,6 @@ public class PathConvert extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
// If we are a reference, the create a Path from the reference | // If we are a reference, the create a Path from the reference | ||||
if( isReference() ) | |||||
{ | |||||
path = new Path().createPath(); | |||||
Object obj = refid.getReferencedObject( getProject() ); | |||||
if( obj instanceof Path ) | |||||
{ | |||||
path.setRefid( refid ); | |||||
} | |||||
else if( obj instanceof FileSet ) | |||||
{ | |||||
FileSet fs = (FileSet)obj; | |||||
path.addFileset( fs ); | |||||
} | |||||
else | |||||
{ | |||||
throw new TaskException( "'refid' does not refer to a path or fileset" ); | |||||
} | |||||
} | |||||
validateSetup();// validate our setup | validateSetup();// validate our setup | ||||
// Currently, we deal with only two path formats: Unix and Windows | // Currently, we deal with only two path formats: Unix and Windows | ||||
@@ -55,12 +55,6 @@ public class Property | |||||
} | } | ||||
} | } | ||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
public void setEnvironment( String env ) | public void setEnvironment( String env ) | ||||
{ | { | ||||
m_env = env; | m_env = env; | ||||
@@ -18,7 +18,6 @@ import org.apache.tools.ant.DirectoryScanner; | |||||
import org.apache.tools.ant.taskdefs.rmic.RmicAdapter; | import org.apache.tools.ant.taskdefs.rmic.RmicAdapter; | ||||
import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory; | import org.apache.tools.ant.taskdefs.rmic.RmicAdapterFactory; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
import org.apache.tools.ant.util.FileNameMapper; | import org.apache.tools.ant.util.FileNameMapper; | ||||
import org.apache.tools.ant.util.SourceFileScanner; | import org.apache.tools.ant.util.SourceFileScanner; | ||||
@@ -120,17 +119,6 @@ public class Rmic extends MatchingTask | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Sets the debug flag. | * Sets the debug flag. | ||||
* | * | ||||
@@ -37,7 +37,6 @@ import org.apache.tools.ant.Task; | |||||
import org.apache.tools.ant.types.EnumeratedAttribute; | import org.apache.tools.ant.types.EnumeratedAttribute; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* Reads in a text file containing SQL statements seperated with semicolons and | * Reads in a text file containing SQL statements seperated with semicolons and | ||||
@@ -180,17 +179,6 @@ public class SQLExec | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Set the classpath for loading the driver using the classpath reference. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Set the statement delimiter. <p> | * Set the statement delimiter. <p> | ||||
* | * | ||||
@@ -11,7 +11,6 @@ import java.util.ArrayList; | |||||
import java.util.Iterator; | import java.util.Iterator; | ||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
public class DocletInfo | public class DocletInfo | ||||
{ | { | ||||
@@ -37,17 +36,6 @@ public class DocletInfo | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new PathRef value | |||||
*/ | |||||
public void setPathRef( final Reference reference ) | |||||
throws TaskException | |||||
{ | |||||
createPath().setRefid( reference ); | |||||
} | |||||
public String getName() | public String getName() | ||||
{ | { | ||||
return m_name; | return m_name; | ||||
@@ -23,7 +23,6 @@ import org.apache.tools.ant.taskdefs.exec.Execute; | |||||
import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* This task makes it easy to generate Javadoc documentation for a collection of | * This task makes it easy to generate Javadoc documentation for a collection of | ||||
@@ -102,17 +101,6 @@ public class Javadoc | |||||
m_author = src; | m_author = src; | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new BootClasspathRef value | |||||
*/ | |||||
public void setBootClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createBootclasspath().setRefid( r ); | |||||
} | |||||
public void setBootclasspath( Path src ) | public void setBootclasspath( Path src ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
@@ -151,17 +139,6 @@ public class Javadoc | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/** | /** | ||||
* Sets whether default exclusions should be used or not. | * Sets whether default exclusions should be used or not. | ||||
* | * | ||||
@@ -205,16 +182,6 @@ public class Javadoc | |||||
m_doclet.setPath( src ); | m_doclet.setPath( src ); | ||||
} | } | ||||
public void setDocletPathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
if( m_doclet == null ) | |||||
{ | |||||
m_doclet = new DocletInfo(); | |||||
} | |||||
m_doclet.createPath().setRefid( r ); | |||||
} | |||||
public void setDoctitle( String src ) | public void setDoctitle( String src ) | ||||
{ | { | ||||
Html h = new Html(); | Html h = new Html(); | ||||
@@ -417,17 +384,6 @@ public class Javadoc | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new SourcepathRef value | |||||
*/ | |||||
public void setSourcepathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createSourcepath().setRefid( r ); | |||||
} | |||||
public void setSplitindex( boolean b ) | public void setSplitindex( boolean b ) | ||||
{ | { | ||||
addArgIf( b, "-splitindex" ); | addArgIf( b, "-splitindex" ); | ||||
@@ -24,7 +24,6 @@ import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
import org.apache.tools.ant.taskdefs.MatchingTask; | import org.apache.tools.ant.taskdefs.MatchingTask; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* Generate a dependency file for a given set of classes | * Generate a dependency file for a given set of classes | ||||
@@ -117,17 +116,6 @@ public class Depend extends MatchingTask | |||||
} | } | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere. | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
public void setClosure( boolean closure ) | public void setClosure( boolean closure ) | ||||
{ | { | ||||
this.closure = closure; | this.closure = closure; | ||||
@@ -13,7 +13,6 @@ import org.apache.tools.ant.Task; | |||||
import org.apache.tools.ant.taskdefs.Java; | import org.apache.tools.ant.taskdefs.Java; | ||||
import org.apache.tools.ant.taskdefs.exec.ExecTask; | import org.apache.tools.ant.taskdefs.exec.ExecTask; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | * BorlandGenerateClient is dedicated to the Borland Application Server 4.5 This | ||||
@@ -66,12 +65,6 @@ public class BorlandGenerateClient extends Task | |||||
} | } | ||||
} | } | ||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
public void setClientjar( File clientjar ) | public void setClientjar( File clientjar ) | ||||
{ | { | ||||
clientjarfile = clientjar; | clientjarfile = clientjar; | ||||
@@ -16,7 +16,6 @@ import org.apache.tools.ant.taskdefs.MatchingTask; | |||||
import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapter; | import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapter; | ||||
import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapterFactory; | import org.apache.tools.ant.taskdefs.optional.jsp.compilers.CompilerAdapterFactory; | ||||
import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
import org.apache.tools.ant.types.Reference; | |||||
/** | /** | ||||
* Ant task to run the jsp compiler. <p> | * Ant task to run the jsp compiler. <p> | ||||
@@ -108,20 +107,6 @@ public class JspC extends MatchingTask | |||||
classpath.append( cp ); | classpath.append( cp ); | ||||
} | } | ||||
/** | |||||
* Adds a reference to a CLASSPATH defined elsewhere | |||||
* | |||||
* @param r The new ClasspathRef value | |||||
*/ | |||||
public void setClasspathRef( Reference r ) | |||||
throws TaskException | |||||
{ | |||||
createClasspath().setRefid( r ); | |||||
} | |||||
/* | |||||
* ------------------------------------------------------------ | |||||
*/ | |||||
/** | /** | ||||
* Set the destination directory into which the JSP source files should be | * Set the destination directory into which the JSP source files should be | ||||
* compiled. | * compiled. | ||||
@@ -7,8 +7,6 @@ | |||||
*/ | */ | ||||
package org.apache.tools.ant.taskdefs.security; | package org.apache.tools.ant.taskdefs.security; | ||||
import java.util.ArrayList; | |||||
import java.util.Iterator; | |||||
import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
import org.apache.tools.ant.taskdefs.exec.ExecTask; | import org.apache.tools.ant.taskdefs.exec.ExecTask; | ||||
@@ -240,11 +240,11 @@ public class ReplaceRegExp extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
String res = input; | String res = input; | ||||
Regexp regexp = r.getRegexp( getProject() ); | |||||
Regexp regexp = r.getRegexp(); | |||||
if( regexp.matches( input, options ) ) | if( regexp.matches( input, options ) ) | ||||
{ | { | ||||
res = regexp.substitute( input, s.getExpression( getProject() ), options ); | |||||
res = regexp.substitute( input, s.getExpression(), options ); | |||||
} | } | ||||
return res; | return res; | ||||
@@ -277,8 +277,8 @@ public class ReplaceRegExp extends Task | |||||
boolean changes = false; | boolean changes = false; | ||||
final String message = "Replacing pattern '" + regex.getPattern( getProject() ) + | |||||
"' with '" + subs.getExpression( getProject() ) + | |||||
final String message = "Replacing pattern '" + regex.getPattern() + | |||||
"' with '" + subs.getExpression() + | |||||
"' in '" + f.getPath() + "'" + | "' in '" + f.getPath() + "'" + | ||||
( byline ? " by line" : "" ) + | ( byline ? " by line" : "" ) + | ||||
( flags.length() > 0 ? " with flags: '" + flags + "'" : "" ) + | ( flags.length() > 0 ? " with flags: '" + flags + "'" : "" ) + | ||||
@@ -7,10 +7,7 @@ | |||||
*/ | */ | ||||
package org.apache.tools.ant.taskdefs.text; | package org.apache.tools.ant.taskdefs.text; | ||||
import java.util.Stack; | |||||
import org.apache.myrmidon.api.TaskException; | |||||
import org.apache.tools.ant.Project; | |||||
import org.apache.tools.ant.types.DataType; | |||||
import org.apache.tools.ant.ProjectComponent; | |||||
/** | /** | ||||
* A regular expression substitution datatype. It is an expression that is meant | * A regular expression substitution datatype. It is an expression that is meant | ||||
@@ -24,65 +21,20 @@ import org.apache.tools.ant.types.DataType; | |||||
* @see org.apache.oro.text.regex.Perl5Substitition | * @see org.apache.oro.text.regex.Perl5Substitition | ||||
*/ | */ | ||||
public class Substitution | public class Substitution | ||||
extends DataType | |||||
extends ProjectComponent | |||||
{ | { | ||||
public final static String DATA_TYPE_NAME = "substitition"; | |||||
private String m_expression; | |||||
private String expression; | |||||
public Substitution() | |||||
{ | |||||
this.expression = null; | |||||
} | |||||
public void setExpression( String expression ) | |||||
public void setExpression( final String expression ) | |||||
{ | { | ||||
this.expression = expression; | |||||
m_expression = expression; | |||||
} | } | ||||
/** | /** | ||||
* Gets the pattern string for this RegularExpression in the given project. | * Gets the pattern string for this RegularExpression in the given project. | ||||
* | |||||
* @param p Description of Parameter | |||||
* @return The Expression value | |||||
*/ | */ | ||||
public String getExpression( Project p ) | |||||
throws TaskException | |||||
public String getExpression() | |||||
{ | { | ||||
if( isReference() ) | |||||
{ | |||||
return getRef( p ).getExpression( p ); | |||||
} | |||||
return expression; | |||||
} | |||||
/** | |||||
* Get the RegularExpression this reference refers to in the given project. | |||||
* Check for circular references too | |||||
* | |||||
* @param p Description of Parameter | |||||
* @return The Ref value | |||||
*/ | |||||
public Substitution getRef( Project p ) | |||||
throws TaskException | |||||
{ | |||||
if( !checked ) | |||||
{ | |||||
Stack stk = new Stack(); | |||||
stk.push( this ); | |||||
dieOnCircularReference( stk, p ); | |||||
} | |||||
Object o = ref.getReferencedObject( p ); | |||||
if( !( o instanceof Substitution ) ) | |||||
{ | |||||
String msg = ref.getRefId() + " doesn\'t denote a substitution"; | |||||
throw new TaskException( msg ); | |||||
} | |||||
else | |||||
{ | |||||
return (Substitution)o; | |||||
} | |||||
return m_expression; | |||||
} | } | ||||
} | } |