git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270289 13f79535-47bb-0310-9956-ffa450edef68master
@@ -20,7 +20,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
public abstract class ProjectComponent | public abstract class ProjectComponent | ||||
extends AbstractTask | extends AbstractTask | ||||
{ | { | ||||
protected Project project; | |||||
private Project project; | |||||
/** | /** | ||||
* Sets the project object of this component. This method is used by project | * Sets the project object of this component. This method is used by project | ||||
@@ -51,7 +51,7 @@ public class TaskAdapter extends Task | |||||
c.getMethod( "setProject", new Class[]{Project.class} ); | c.getMethod( "setProject", new Class[]{Project.class} ); | ||||
if( setProjectM != null ) | if( setProjectM != null ) | ||||
{ | { | ||||
setProjectM.invoke( proxy, new Object[]{project} ); | |||||
setProjectM.invoke( proxy, new Object[]{getProject()} ); | |||||
} | } | ||||
} | } | ||||
catch( NoSuchMethodException e ) | catch( NoSuchMethodException e ) | ||||
@@ -75,25 +75,25 @@ public class AntStructure extends Task | |||||
out = new PrintWriter( new FileWriter( output ) ); | out = new PrintWriter( new FileWriter( output ) ); | ||||
} | } | ||||
printHead( out, project.getTaskDefinitions().keys(), | |||||
project.getDataTypeDefinitions().keys() ); | |||||
printHead( out, getProject().getTaskDefinitions().keys(), | |||||
getProject().getDataTypeDefinitions().keys() ); | |||||
printTargetDecl( out ); | printTargetDecl( out ); | ||||
Enumeration dataTypes = project.getDataTypeDefinitions().keys(); | |||||
Enumeration dataTypes = getProject().getDataTypeDefinitions().keys(); | |||||
while( dataTypes.hasMoreElements() ) | while( dataTypes.hasMoreElements() ) | ||||
{ | { | ||||
String typeName = (String)dataTypes.nextElement(); | String typeName = (String)dataTypes.nextElement(); | ||||
printElementDecl( out, typeName, | printElementDecl( out, typeName, | ||||
(Class)project.getDataTypeDefinitions().get( typeName ) ); | |||||
(Class)getProject().getDataTypeDefinitions().get( typeName ) ); | |||||
} | } | ||||
Enumeration tasks = project.getTaskDefinitions().keys(); | |||||
Enumeration tasks = getProject().getTaskDefinitions().keys(); | |||||
while( tasks.hasMoreElements() ) | while( tasks.hasMoreElements() ) | ||||
{ | { | ||||
String taskName = (String)tasks.nextElement(); | String taskName = (String)tasks.nextElement(); | ||||
printElementDecl( out, taskName, | printElementDecl( out, taskName, | ||||
(Class)project.getTaskDefinitions().get( taskName ) ); | |||||
(Class)getProject().getTaskDefinitions().get( taskName ) ); | |||||
} | } | ||||
printTail( out ); | printTail( out ); | ||||
@@ -97,7 +97,7 @@ public class Available | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( project ); | |||||
this.classpath = new Path( getProject() ); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -107,7 +107,7 @@ public class Available | |||||
{ | { | ||||
if( this.filepath == null ) | if( this.filepath == null ) | ||||
{ | { | ||||
this.filepath = new Path( project ); | |||||
this.filepath = new Path( getProject() ); | |||||
} | } | ||||
return this.filepath.createPath(); | return this.filepath.createPath(); | ||||
} | } | ||||
@@ -130,8 +130,8 @@ public class Available | |||||
if( classpath != null ) | if( classpath != null ) | ||||
{ | { | ||||
classpath.setProject( project ); | |||||
this.loader = new AntClassLoader( project, classpath ); | |||||
classpath.setProject( getProject() ); | |||||
this.loader = new AntClassLoader( getProject(), classpath ); | |||||
} | } | ||||
if( ( classname != null ) && !checkClass( classname ) ) | if( ( classname != null ) && !checkClass( classname ) ) | ||||
@@ -178,7 +178,7 @@ public class Available | |||||
if( eval() ) | if( eval() ) | ||||
{ | { | ||||
String lSep = System.getProperty( "line.separator" ); | String lSep = System.getProperty( "line.separator" ); | ||||
if( null == project.getProperty( property ) ) | |||||
if( null == getProject().getProperty( property ) ) | |||||
{ | { | ||||
setProperty( property, value ); | setProperty( property, value ); | ||||
} | } | ||||
@@ -475,11 +475,11 @@ public class Checksum extends MatchingTask implements Condition | |||||
for( int i = 0; i < sizeofFileSet; i++ ) | for( int i = 0; i < sizeofFileSet; i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
for( int j = 0; j < srcFiles.length; j++ ) | for( int j = 0; j < srcFiles.length; j++ ) | ||||
{ | { | ||||
File src = new File( fs.getDir( project ), srcFiles[ j ] ); | |||||
File src = new File( fs.getDir( getProject() ), srcFiles[ j ] ); | |||||
addToIncludeFileMap( src ); | addToIncludeFileMap( src ); | ||||
} | } | ||||
} | } | ||||
@@ -151,14 +151,14 @@ public class Chmod extends ExecuteOn | |||||
public void execute() | public void execute() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( defaultSetDefined || defaultSet.getDir( project ) == null ) | |||||
if( defaultSetDefined || defaultSet.getDir( getProject() ) == null ) | |||||
{ | { | ||||
super.execute(); | super.execute(); | ||||
} | } | ||||
else if( isValidOs() ) | else if( isValidOs() ) | ||||
{ | { | ||||
// we are chmodding the given directory | // we are chmodding the given directory | ||||
createArg().setValue( defaultSet.getDir( project ).getPath() ); | |||||
createArg().setValue( defaultSet.getDir( getProject() ).getPath() ); | |||||
Execute execute = prepareExec(); | Execute execute = prepareExec(); | ||||
try | try | ||||
{ | { | ||||
@@ -190,7 +190,7 @@ public class Chmod extends ExecuteOn | |||||
throw new TaskException( "Required attribute perm not set in chmod" ); | throw new TaskException( "Required attribute perm not set in chmod" ); | ||||
} | } | ||||
if( defaultSetDefined && defaultSet.getDir( project ) != null ) | |||||
if( defaultSetDefined && defaultSet.getDir( getProject() ) != null ) | |||||
{ | { | ||||
addFileset( defaultSet ); | addFileset( defaultSet ); | ||||
} | } | ||||
@@ -155,13 +155,13 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileSet targetFS = (FileSet)enumTargetSets.nextElement(); | FileSet targetFS = (FileSet)enumTargetSets.nextElement(); | ||||
DirectoryScanner targetDS = targetFS.getDirectoryScanner( project ); | |||||
DirectoryScanner targetDS = targetFS.getDirectoryScanner( getProject() ); | |||||
String[] targetFiles = targetDS.getIncludedFiles(); | String[] targetFiles = targetDS.getIncludedFiles(); | ||||
for( int i = 0; i < targetFiles.length; i++ ) | for( int i = 0; i < targetFiles.length; i++ ) | ||||
{ | { | ||||
File dest = new File( targetFS.getDir( project ), targetFiles[ i ] ); | |||||
File dest = new File( targetFS.getDir( getProject() ), targetFiles[ i ] ); | |||||
allTargets.addElement( dest ); | allTargets.addElement( dest ); | ||||
if( dest.lastModified() > now ) | if( dest.lastModified() > now ) | ||||
@@ -181,12 +181,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileList targetFL = (FileList)enumTargetLists.nextElement(); | FileList targetFL = (FileList)enumTargetLists.nextElement(); | ||||
String[] targetFiles = targetFL.getFiles( project ); | |||||
String[] targetFiles = targetFL.getFiles( getProject() ); | |||||
for( int i = 0; i < targetFiles.length; i++ ) | for( int i = 0; i < targetFiles.length; i++ ) | ||||
{ | { | ||||
File dest = new File( targetFL.getDir( project ), targetFiles[ i ] ); | |||||
File dest = new File( targetFL.getDir( getProject() ), targetFiles[ i ] ); | |||||
if( !dest.exists() ) | if( !dest.exists() ) | ||||
{ | { | ||||
log( targetFiles[ i ] + " does not exist.", Project.MSG_VERBOSE ); | log( targetFiles[ i ] + " does not exist.", Project.MSG_VERBOSE ); | ||||
@@ -215,12 +215,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileSet sourceFS = (FileSet)enumSourceSets.nextElement(); | FileSet sourceFS = (FileSet)enumSourceSets.nextElement(); | ||||
DirectoryScanner sourceDS = sourceFS.getDirectoryScanner( project ); | |||||
DirectoryScanner sourceDS = sourceFS.getDirectoryScanner( getProject() ); | |||||
String[] sourceFiles = sourceDS.getIncludedFiles(); | String[] sourceFiles = sourceDS.getIncludedFiles(); | ||||
for( int i = 0; upToDate && i < sourceFiles.length; i++ ) | for( int i = 0; upToDate && i < sourceFiles.length; i++ ) | ||||
{ | { | ||||
File src = new File( sourceFS.getDir( project ), sourceFiles[ i ] ); | |||||
File src = new File( sourceFS.getDir( getProject() ), sourceFiles[ i ] ); | |||||
if( src.lastModified() > now ) | if( src.lastModified() > now ) | ||||
{ | { | ||||
@@ -255,12 +255,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileList sourceFL = (FileList)enumSourceLists.nextElement(); | FileList sourceFL = (FileList)enumSourceLists.nextElement(); | ||||
String[] sourceFiles = sourceFL.getFiles( project ); | |||||
String[] sourceFiles = sourceFL.getFiles( getProject() ); | |||||
int i = 0; | int i = 0; | ||||
do | do | ||||
{ | { | ||||
File src = new File( sourceFL.getDir( project ), sourceFiles[ i ] ); | |||||
File src = new File( sourceFL.getDir( getProject() ), sourceFiles[ i ] ); | |||||
if( src.lastModified() > now ) | if( src.lastModified() > now ) | ||||
{ | { | ||||
@@ -108,7 +108,7 @@ public class Echo extends Task | |||||
public void addText( String msg ) | public void addText( String msg ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
message += project.replaceProperties( msg ); | |||||
message += getProject().replaceProperties( msg ); | |||||
} | } | ||||
/** | /** | ||||
@@ -122,7 +122,7 @@ public class ExecuteOn extends ExecTask | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapperElement = new Mapper( project ); | |||||
mapperElement = new Mapper( getProject() ); | |||||
return mapperElement; | return mapperElement; | ||||
} | } | ||||
@@ -385,8 +385,8 @@ public class ExecuteOn extends ExecTask | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
File base = fs.getDir( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
File base = fs.getDir( getProject() ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
if( !"dir".equals( type ) ) | if( !"dir".equals( type ) ) | ||||
{ | { | ||||
@@ -132,8 +132,8 @@ public class Expand extends MatchingTask | |||||
for( int j = 0; j < filesets.size(); j++ ) | for( int j = 0; j < filesets.size(); j++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( j ); | FileSet fs = (FileSet)filesets.elementAt( j ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
File fromDir = fs.getDir( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
File fromDir = fs.getDir( getProject() ); | |||||
String[] files = ds.getIncludedFiles(); | String[] files = ds.getIncludedFiles(); | ||||
for( int i = 0; i < files.length; ++i ) | for( int i = 0; i < files.length; ++i ) | ||||
@@ -201,7 +201,7 @@ public class Expand extends MatchingTask | |||||
for( int v = 0; v < patternsets.size(); v++ ) | for( int v = 0; v < patternsets.size(); v++ ) | ||||
{ | { | ||||
PatternSet p = (PatternSet)patternsets.elementAt( v ); | PatternSet p = (PatternSet)patternsets.elementAt( v ); | ||||
String[] incls = p.getIncludePatterns( project ); | |||||
String[] incls = p.getIncludePatterns( getProject() ); | |||||
if( incls != null ) | if( incls != null ) | ||||
{ | { | ||||
for( int w = 0; w < incls.length; w++ ) | for( int w = 0; w < incls.length; w++ ) | ||||
@@ -214,7 +214,7 @@ public class Expand extends MatchingTask | |||||
} | } | ||||
} | } | ||||
} | } | ||||
String[] excls = p.getExcludePatterns( project ); | |||||
String[] excls = p.getExcludePatterns( getProject() ); | |||||
if( excls != null ) | if( excls != null ) | ||||
{ | { | ||||
for( int w = 0; w < excls.length; w++ ) | for( int w = 0; w < excls.length; w++ ) | ||||
@@ -57,7 +57,7 @@ public class Filter extends Task | |||||
if( isSingleFilter ) | if( isSingleFilter ) | ||||
{ | { | ||||
project.getGlobalFilterSet().addFilter( token, value ); | |||||
getProject().getGlobalFilterSet().addFilter( token, value ); | |||||
} | } | ||||
if( isFiltersFromFile ) | if( isFiltersFromFile ) | ||||
@@ -70,6 +70,6 @@ public class Filter extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
log( "Reading filters from " + filtersFile, Project.MSG_VERBOSE ); | log( "Reading filters from " + filtersFile, Project.MSG_VERBOSE ); | ||||
project.getGlobalFilterSet().readFiltersFromFile( filtersFile ); | |||||
getProject().getGlobalFilterSet().readFiltersFromFile( filtersFile ); | |||||
} | } | ||||
} | } |
@@ -140,7 +140,7 @@ public class GenerateKey | |||||
public void execute() | public void execute() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( project.getJavaVersion().equals( Project.JAVA_1_1 ) ) | |||||
if( getProject().getJavaVersion().equals( Project.JAVA_1_1 ) ) | |||||
{ | { | ||||
throw new TaskException( "The genkey task is only available on JDK" + | throw new TaskException( "The genkey task is only available on JDK" + | ||||
" versions 1.2 or greater" ); | " versions 1.2 or greater" ); | ||||
@@ -162,7 +162,7 @@ public class GenerateKey | |||||
} | } | ||||
getLogger().info( "Generating Key for " + alias ); | getLogger().info( "Generating Key for " + alias ); | ||||
final ExecTask cmd = (ExecTask)project.createTask( "exec" ); | |||||
final ExecTask cmd = (ExecTask)getProject().createTask( "exec" ); | |||||
cmd.setExecutable( "keytool" ); | cmd.setExecutable( "keytool" ); | ||||
cmd.createArg().setValue( "-genkey " ); | cmd.createArg().setValue( "-genkey " ); | ||||
@@ -95,7 +95,7 @@ public class Get extends Task | |||||
*/ | */ | ||||
public void setUseTimestamp( boolean v ) | public void setUseTimestamp( boolean v ) | ||||
{ | { | ||||
if( project.getJavaVersion() != Project.JAVA_1_1 ) | |||||
if( getProject().getJavaVersion() != Project.JAVA_1_1 ) | |||||
{ | { | ||||
useTimestamp = v; | useTimestamp = v; | ||||
} | } | ||||
@@ -300,9 +300,9 @@ public class Get extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( project.getJavaVersion() != Project.JAVA_1_1 ) | |||||
if( getProject().getJavaVersion() != Project.JAVA_1_1 ) | |||||
{ | { | ||||
Touch touch = (Touch)project.createTask( "touch" ); | |||||
Touch touch = (Touch)getProject().createTask( "touch" ); | |||||
touch.setFile( file ); | touch.setFile( file ); | ||||
touch.setMillis( timemillis ); | touch.setMillis( timemillis ); | ||||
touch.touch(); | touch.touch(); | ||||
@@ -89,7 +89,7 @@ public class Input extends Task | |||||
public void addText( String msg ) | public void addText( String msg ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
message += project.replaceProperties( msg ); | |||||
message += getProject().replaceProperties( msg ); | |||||
} | } | ||||
/** | /** | ||||
@@ -143,7 +143,7 @@ public class Input extends Task | |||||
// adopted from org.apache.tools.ant.taskdefs.Property | // adopted from org.apache.tools.ant.taskdefs.Property | ||||
if( addproperty != null ) | if( addproperty != null ) | ||||
{ | { | ||||
if( project.getProperty( addproperty ) == null ) | |||||
if( getProject().getProperty( addproperty ) == null ) | |||||
{ | { | ||||
setProperty( addproperty, input ); | setProperty( addproperty, input ); | ||||
} | } | ||||
@@ -197,7 +197,7 @@ public class Java extends Task | |||||
public Path createClasspath() | public Path createClasspath() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
return cmdl.createClasspath( project ).createPath(); | |||||
return cmdl.createClasspath( getProject() ).createPath(); | |||||
} | } | ||||
/** | /** | ||||
@@ -339,7 +339,7 @@ public class Java extends Task | |||||
try | try | ||||
{ | { | ||||
outStream = new PrintStream( new FileOutputStream( out ) ); | outStream = new PrintStream( new FileOutputStream( out ) ); | ||||
exe.execute( project ); | |||||
exe.execute( getProject() ); | |||||
} | } | ||||
catch( IOException io ) | catch( IOException io ) | ||||
{ | { | ||||
@@ -355,7 +355,7 @@ public class Java extends Task | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
exe.execute( project ); | |||||
exe.execute( getProject() ); | |||||
} | } | ||||
} | } | ||||
@@ -385,7 +385,7 @@ public class Java extends Task | |||||
exe = new Execute( new PumpStreamHandler( fos ), null ); | exe = new Execute( new PumpStreamHandler( fos ), null ); | ||||
} | } | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
if( dir == null ) | if( dir == null ) | ||||
{ | { | ||||
@@ -646,7 +646,7 @@ public class Javac extends MatchingTask | |||||
public boolean isForkedJavac() | public boolean isForkedJavac() | ||||
{ | { | ||||
return !"false".equals( fork ) || | return !"false".equals( fork ) || | ||||
"extJavac".equals( project.getProperty( "build.compiler" ) ); | |||||
"extJavac".equals( getProject().getProperty( "build.compiler" ) ); | |||||
} | } | ||||
/** | /** | ||||
@@ -659,7 +659,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( project ); | |||||
bootclasspath = new Path( getProject() ); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -674,7 +674,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( project ); | |||||
compileClasspath = new Path( getProject() ); | |||||
} | } | ||||
return compileClasspath.createPath(); | return compileClasspath.createPath(); | ||||
} | } | ||||
@@ -702,7 +702,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( extdirs == null ) | if( extdirs == null ) | ||||
{ | { | ||||
extdirs = new Path( project ); | |||||
extdirs = new Path( getProject() ); | |||||
} | } | ||||
return extdirs.createPath(); | return extdirs.createPath(); | ||||
} | } | ||||
@@ -717,7 +717,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( src == null ) | if( src == null ) | ||||
{ | { | ||||
src = new Path( project ); | |||||
src = new Path( getProject() ); | |||||
} | } | ||||
return src.createPath(); | return src.createPath(); | ||||
} | } | ||||
@@ -870,7 +870,7 @@ public class Javac extends MatchingTask | |||||
private String determineCompiler() | private String determineCompiler() | ||||
{ | { | ||||
String compiler = project.getProperty( "build.compiler" ); | |||||
String compiler = getProject().getProperty( "build.compiler" ); | |||||
if( !"false".equals( fork ) ) | if( !"false".equals( fork ) ) | ||||
{ | { | ||||
@@ -576,7 +576,7 @@ public class Javadoc extends Task | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( project ); | |||||
bootclasspath = new Path( getProject() ); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -586,7 +586,7 @@ public class Javadoc extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( project ); | |||||
classpath = new Path( getProject() ); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -616,7 +616,7 @@ public class Javadoc extends Task | |||||
{ | { | ||||
if( sourcePath == null ) | if( sourcePath == null ) | ||||
{ | { | ||||
sourcePath = new Path( project ); | |||||
sourcePath = new Path( getProject() ); | |||||
} | } | ||||
return sourcePath.createPath(); | return sourcePath.createPath(); | ||||
} | } | ||||
@@ -918,7 +918,7 @@ public class Javadoc extends Task | |||||
JavadocOutputStream out = new JavadocOutputStream( Project.MSG_INFO ); | JavadocOutputStream out = new JavadocOutputStream( Project.MSG_INFO ); | ||||
JavadocOutputStream err = new JavadocOutputStream( Project.MSG_WARN ); | JavadocOutputStream err = new JavadocOutputStream( Project.MSG_WARN ); | ||||
Execute exe = new Execute( new PumpStreamHandler( out, err ) ); | Execute exe = new Execute( new PumpStreamHandler( out, err ) ); | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
/* | /* | ||||
* No reason to change the working directory as all filenames and | * No reason to change the working directory as all filenames and | ||||
@@ -971,7 +971,7 @@ public class Javadoc extends Task | |||||
protected String expand( String content ) | protected String expand( String content ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
return project.replaceProperties( content ); | |||||
return getProject().replaceProperties( content ); | |||||
} | } | ||||
private String getJavadocExecutableName() | private String getJavadocExecutableName() | ||||
@@ -1130,7 +1130,7 @@ public class Javadoc extends Task | |||||
File source = resolveFile( list[ j ] ); | File source = resolveFile( list[ j ] ); | ||||
fs.setDir( source ); | fs.setDir( source ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] packageDirs = ds.getIncludedDirectories(); | String[] packageDirs = ds.getIncludedDirectories(); | ||||
for( int i = 0; i < packageDirs.length; i++ ) | for( int i = 0; i < packageDirs.length; i++ ) | ||||
@@ -157,7 +157,7 @@ public abstract class MatchingTask extends Task | |||||
{ | { | ||||
fileset.setDir( baseDir ); | fileset.setDir( baseDir ); | ||||
fileset.setDefaultexcludes( useDefaultExcludes ); | fileset.setDefaultexcludes( useDefaultExcludes ); | ||||
return fileset.getDirectoryScanner( project ); | |||||
return fileset.getDirectoryScanner( getProject() ); | |||||
} | } | ||||
} | } |
@@ -131,7 +131,7 @@ public class Property extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( project ); | |||||
this.classpath = new Path( getProject() ); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -195,7 +195,7 @@ public class Property extends Task | |||||
String name = (String)e.nextElement(); | String name = (String)e.nextElement(); | ||||
String value = (String)props.getProperty( name ); | String value = (String)props.getProperty( name ); | ||||
String v = project.replaceProperties( value ); | |||||
String v = getProject().replaceProperties( value ); | |||||
addProperty( name, v ); | addProperty( name, v ); | ||||
} | } | ||||
} | } | ||||
@@ -278,7 +278,7 @@ public class Property extends Task | |||||
if( classpath != null ) | if( classpath != null ) | ||||
{ | { | ||||
cL = new AntClassLoader( project, classpath ); | |||||
cL = new AntClassLoader( getProject(), classpath ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -502,7 +502,7 @@ public class Rmic extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( project ); | |||||
compileClasspath = new Path( getProject() ); | |||||
} | } | ||||
return compileClasspath.createPath(); | return compileClasspath.createPath(); | ||||
} | } | ||||
@@ -517,7 +517,7 @@ public class Rmic extends MatchingTask | |||||
{ | { | ||||
if( extdirs == null ) | if( extdirs == null ) | ||||
{ | { | ||||
extdirs = new Path( project ); | |||||
extdirs = new Path( getProject() ); | |||||
} | } | ||||
return extdirs.createPath(); | return extdirs.createPath(); | ||||
} | } | ||||
@@ -539,14 +539,14 @@ public class Rmic extends MatchingTask | |||||
log( "Verify has been turned on.", Project.MSG_INFO ); | log( "Verify has been turned on.", Project.MSG_INFO ); | ||||
} | } | ||||
String compiler = project.getProperty( "build.rmic" ); | |||||
String compiler = getProject().getProperty( "build.rmic" ); | |||||
RmicAdapter adapter = RmicAdapterFactory.getRmic( compiler, this ); | RmicAdapter adapter = RmicAdapterFactory.getRmic( compiler, this ); | ||||
// now we need to populate the compiler adapter | // now we need to populate the compiler adapter | ||||
adapter.setRmic( this ); | adapter.setRmic( this ); | ||||
Path classpath = adapter.getClasspath(); | Path classpath = adapter.getClasspath(); | ||||
loader = new AntClassLoader( project, classpath ); | |||||
loader = new AntClassLoader( getProject(), classpath ); | |||||
// scan base dirs to build up compile lists only if a | // scan base dirs to build up compile lists only if a | ||||
// specific classname is not given | // specific classname is not given | ||||
@@ -684,7 +684,7 @@ public class Rmic extends MatchingTask | |||||
{ | { | ||||
if( filtering ) | if( filtering ) | ||||
{ | { | ||||
final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet() ); | |||||
final FilterSetCollection filters = new FilterSetCollection( getProject().getGlobalFilterSet() ); | |||||
FileUtils.copyFile( oldFile, newFile, filters ); | FileUtils.copyFile( oldFile, newFile, filters ); | ||||
} | } | ||||
else | else | ||||
@@ -370,7 +370,7 @@ public class SQLExec extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( project ); | |||||
this.classpath = new Path( getProject() ); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -410,8 +410,8 @@ public class SQLExec extends Task | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
File srcDir = fs.getDir( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
File srcDir = fs.getDir( getProject() ); | |||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
@@ -459,7 +459,7 @@ public class SQLExec extends Task | |||||
log( "Loading " + driver + " using AntClassLoader with classpath " + classpath, | log( "Loading " + driver + " using AntClassLoader with classpath " + classpath, | ||||
Project.MSG_VERBOSE ); | Project.MSG_VERBOSE ); | ||||
loader = new AntClassLoader( project, classpath ); | |||||
loader = new AntClassLoader( getProject(), classpath ); | |||||
dc = loader.loadClass( driver ); | dc = loader.loadClass( driver ); | ||||
} | } | ||||
else | else | ||||
@@ -754,7 +754,7 @@ public class SQLExec extends Task | |||||
while( ( line = in.readLine() ) != null ) | while( ( line = in.readLine() ) != null ) | ||||
{ | { | ||||
line = line.trim(); | line = line.trim(); | ||||
line = project.replaceProperties( line ); | |||||
line = getProject().replaceProperties( line ); | |||||
if( line.startsWith( "//" ) ) | if( line.startsWith( "//" ) ) | ||||
continue; | continue; | ||||
if( line.startsWith( "--" ) ) | if( line.startsWith( "--" ) ) | ||||
@@ -155,11 +155,11 @@ public class SignJar extends Task | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] jarFiles = ds.getIncludedFiles(); | String[] jarFiles = ds.getIncludedFiles(); | ||||
for( int j = 0; j < jarFiles.length; j++ ) | for( int j = 0; j < jarFiles.length; j++ ) | ||||
{ | { | ||||
doOneJar( new File( fs.getDir( project ), jarFiles[ j ] ), null ); | |||||
doOneJar( new File( fs.getDir( getProject() ), jarFiles[ j ] ), null ); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -249,7 +249,7 @@ public class SignJar extends Task | |||||
private void doOneJar( File jarSource, File jarTarget ) | private void doOneJar( File jarSource, File jarTarget ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( project.getJavaVersion().equals( Project.JAVA_1_1 ) ) | |||||
if( getProject().getJavaVersion().equals( Project.JAVA_1_1 ) ) | |||||
{ | { | ||||
throw new TaskException( "The signjar task is only available on JDK versions 1.2 or greater" ); | throw new TaskException( "The signjar task is only available on JDK versions 1.2 or greater" ); | ||||
} | } | ||||
@@ -269,7 +269,7 @@ public class SignJar extends Task | |||||
final StringBuffer sb = new StringBuffer(); | final StringBuffer sb = new StringBuffer(); | ||||
final ExecTask cmd = (ExecTask)project.createTask( "exec" ); | |||||
final ExecTask cmd = (ExecTask)getProject().createTask( "exec" ); | |||||
cmd.setExecutable( "jarsigner" ); | cmd.setExecutable( "jarsigner" ); | ||||
if( null != keystore ) | if( null != keystore ) | ||||
@@ -145,7 +145,7 @@ public class Tar | |||||
for( Enumeration e = filesets.elements(); e.hasMoreElements(); ) | for( Enumeration e = filesets.elements(); e.hasMoreElements(); ) | ||||
{ | { | ||||
TarFileSet fs = (TarFileSet)e.nextElement(); | TarFileSet fs = (TarFileSet)e.nextElement(); | ||||
String[] files = fs.getFiles( project ); | |||||
String[] files = fs.getFiles( getProject() ); | |||||
if( !archiveIsUpToDate( files ) ) | if( !archiveIsUpToDate( files ) ) | ||||
{ | { | ||||
@@ -154,7 +154,7 @@ public class Tar | |||||
for( int i = 0; i < files.length; ++i ) | for( int i = 0; i < files.length; ++i ) | ||||
{ | { | ||||
if( tarFile.equals( new File( fs.getDir( project ), files[ i ] ) ) ) | |||||
if( tarFile.equals( new File( fs.getDir( getProject() ), files[ i ] ) ) ) | |||||
{ | { | ||||
throw new TaskException( "A tar file cannot include itself" ); | throw new TaskException( "A tar file cannot include itself" ); | ||||
} | } | ||||
@@ -194,10 +194,10 @@ public class Tar | |||||
for( Enumeration e = filesets.elements(); e.hasMoreElements(); ) | for( Enumeration e = filesets.elements(); e.hasMoreElements(); ) | ||||
{ | { | ||||
TarFileSet fs = (TarFileSet)e.nextElement(); | TarFileSet fs = (TarFileSet)e.nextElement(); | ||||
String[] files = fs.getFiles( project ); | |||||
String[] files = fs.getFiles( getProject() ); | |||||
for( int i = 0; i < files.length; i++ ) | for( int i = 0; i < files.length; i++ ) | ||||
{ | { | ||||
File f = new File( fs.getDir( project ), files[ i ] ); | |||||
File f = new File( fs.getDir( getProject() ), files[ i ] ); | |||||
String name = files[ i ].replace( File.separatorChar, '/' ); | String name = files[ i ].replace( File.separatorChar, '/' ); | ||||
tarFile( f, tOut, name, fs ); | tarFile( f, tOut, name, fs ); | ||||
} | } | ||||
@@ -148,7 +148,7 @@ public class Touch extends Task | |||||
} | } | ||||
} | } | ||||
if( millis >= 0 && project.getJavaVersion() == Project.JAVA_1_1 ) | |||||
if( millis >= 0 && getProject().getJavaVersion() == Project.JAVA_1_1 ) | |||||
{ | { | ||||
log( "modification time of files cannot be set in JDK 1.1", | log( "modification time of files cannot be set in JDK 1.1", | ||||
Project.MSG_WARN ); | Project.MSG_WARN ); | ||||
@@ -171,8 +171,8 @@ public class Touch extends Task | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
File fromDir = fs.getDir( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
File fromDir = fs.getDir( getProject() ); | |||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
String[] srcDirs = ds.getIncludedDirectories(); | String[] srcDirs = ds.getIncludedDirectories(); | ||||
@@ -202,7 +202,7 @@ public class Touch extends Task | |||||
throw new TaskException( "Can not change modification date of read-only file " + file ); | throw new TaskException( "Can not change modification date of read-only file " + file ); | ||||
} | } | ||||
if( project.getJavaVersion() == Project.JAVA_1_1 ) | |||||
if( getProject().getJavaVersion() == Project.JAVA_1_1 ) | |||||
{ | { | ||||
return; | return; | ||||
} | } | ||||
@@ -73,7 +73,7 @@ public class Tstamp extends Task | |||||
while( i.hasMoreElements() ) | while( i.hasMoreElements() ) | ||||
{ | { | ||||
CustomFormat cts = (CustomFormat)i.nextElement(); | CustomFormat cts = (CustomFormat)i.nextElement(); | ||||
cts.execute( project, d ); | |||||
cts.execute( getProject(), d ); | |||||
} | } | ||||
} | } | ||||
@@ -97,7 +97,7 @@ public class UpToDate extends MatchingTask implements Condition | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapperElement = new Mapper( project ); | |||||
mapperElement = new Mapper( getProject() ); | |||||
return mapperElement; | return mapperElement; | ||||
} | } | ||||
@@ -128,8 +128,8 @@ public class UpToDate extends MatchingTask implements Condition | |||||
while( upToDate && enum.hasMoreElements() ) | while( upToDate && enum.hasMoreElements() ) | ||||
{ | { | ||||
FileSet fs = (FileSet)enum.nextElement(); | FileSet fs = (FileSet)enum.nextElement(); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
upToDate = upToDate && scanDir( fs.getDir( project ), | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
upToDate = upToDate && scanDir( fs.getDir( getProject() ), | |||||
ds.getIncludedFiles() ); | ds.getIncludedFiles() ); | ||||
} | } | ||||
return upToDate; | return upToDate; | ||||
@@ -266,7 +266,7 @@ public class Zip extends MatchingTask | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
dss.addElement( fs.getDirectoryScanner( project ) ); | |||||
dss.addElement( fs.getDirectoryScanner( getProject() ) ); | |||||
} | } | ||||
int dssSize = dss.size(); | int dssSize = dss.size(); | ||||
FileScanner[] scanners = new FileScanner[ dssSize ]; | FileScanner[] scanners = new FileScanner[ dssSize ]; | ||||
@@ -541,7 +541,7 @@ public class Zip extends MatchingTask | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String prefix = ""; | String prefix = ""; | ||||
String fullpath = ""; | String fullpath = ""; | ||||
@@ -393,7 +393,7 @@ public class ExecTask extends Task | |||||
log( cmdl.toString(), Project.MSG_VERBOSE ); | log( cmdl.toString(), Project.MSG_VERBOSE ); | ||||
Execute exe = new Execute( createHandler(), createWatchdog() ); | Execute exe = new Execute( createHandler(), createWatchdog() ); | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
exe.setWorkingDirectory( dir ); | exe.setWorkingDirectory( dir ); | ||||
exe.setVMLauncher( vmLauncher ); | exe.setVMLauncher( vmLauncher ); | ||||
String[] environment = env.getVariables(); | String[] environment = env.getVariables(); | ||||
@@ -200,7 +200,7 @@ public class Copy | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
m_mapperElement = new Mapper( project ); | |||||
m_mapperElement = new Mapper( getProject() ); | |||||
return m_mapperElement; | return m_mapperElement; | ||||
} | } | ||||
@@ -249,8 +249,8 @@ public class Copy | |||||
for( int i = 0; i < m_filesets.size(); i++ ) | for( int i = 0; i < m_filesets.size(); i++ ) | ||||
{ | { | ||||
final FileSet fileSet = (FileSet)m_filesets.elementAt( i ); | final FileSet fileSet = (FileSet)m_filesets.elementAt( i ); | ||||
final DirectoryScanner scanner = fileSet.getDirectoryScanner( project ); | |||||
final File fromDir = fileSet.getDir( project ); | |||||
final DirectoryScanner scanner = fileSet.getDirectoryScanner( getProject() ); | |||||
final File fromDir = fileSet.getDir( getProject() ); | |||||
final String[] srcFiles = scanner.getIncludedFiles(); | final String[] srcFiles = scanner.getIncludedFiles(); | ||||
final String[] srcDirs = scanner.getIncludedDirectories(); | final String[] srcDirs = scanner.getIncludedDirectories(); | ||||
@@ -419,7 +419,7 @@ public class Copy | |||||
final FilterSetCollection executionFilters = new FilterSetCollection(); | final FilterSetCollection executionFilters = new FilterSetCollection(); | ||||
if( m_filtering ) | if( m_filtering ) | ||||
{ | { | ||||
executionFilters.addFilterSet( project.getGlobalFilterSet() ); | |||||
executionFilters.addFilterSet( getProject().getGlobalFilterSet() ); | |||||
} | } | ||||
for( final Enumeration filterEnum = m_filterSets.elements(); filterEnum.hasMoreElements(); ) | for( final Enumeration filterEnum = m_filterSets.elements(); filterEnum.hasMoreElements(); ) | ||||
@@ -506,7 +506,7 @@ public class Copy | |||||
else | else | ||||
{ | { | ||||
FileSet fs = (FileSet)m_filesets.elementAt( 0 ); | FileSet fs = (FileSet)m_filesets.elementAt( 0 ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
if( srcFiles.length > 0 ) | if( srcFiles.length > 0 ) | ||||
@@ -307,10 +307,10 @@ public class Delete | |||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
try | try | ||||
{ | { | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] files = ds.getIncludedFiles(); | String[] files = ds.getIncludedFiles(); | ||||
String[] dirs = ds.getIncludedDirectories(); | String[] dirs = ds.getIncludedDirectories(); | ||||
removeFiles( fs.getDir( project ), files, dirs ); | |||||
removeFiles( fs.getDir( getProject() ), files, dirs ); | |||||
} | } | ||||
catch( TaskException be ) | catch( TaskException be ) | ||||
{ | { | ||||
@@ -151,7 +151,7 @@ public class Move extends Copy | |||||
FilterSetCollection executionFilters = new FilterSetCollection(); | FilterSetCollection executionFilters = new FilterSetCollection(); | ||||
if( isFiltering() ) | if( isFiltering() ) | ||||
{ | { | ||||
executionFilters.addFilterSet( project.getGlobalFilterSet() ); | |||||
executionFilters.addFilterSet( getProject().getGlobalFilterSet() ); | |||||
} | } | ||||
for( Enumeration filterEnum = getFilterSets().elements(); filterEnum.hasMoreElements(); ) | for( Enumeration filterEnum = getFilterSets().elements(); filterEnum.hasMoreElements(); ) | ||||
{ | { | ||||
@@ -215,7 +215,7 @@ public class Move extends Copy | |||||
while( e.hasMoreElements() ) | while( e.hasMoreElements() ) | ||||
{ | { | ||||
FileSet fs = (FileSet)e.nextElement(); | FileSet fs = (FileSet)e.nextElement(); | ||||
File dir = fs.getDir( project ); | |||||
File dir = fs.getDir( getProject() ); | |||||
if( okToDelete( dir ) ) | if( okToDelete( dir ) ) | ||||
{ | { | ||||
@@ -94,7 +94,7 @@ public class ANTLR extends Task | |||||
*/ | */ | ||||
public Path createClasspath() | public Path createClasspath() | ||||
{ | { | ||||
return commandline.createClasspath( project ).createPath(); | |||||
return commandline.createClasspath( getProject() ).createPath(); | |||||
} | } | ||||
/** | /** | ||||
@@ -139,7 +139,7 @@ public class ANTLR extends Task | |||||
ExecuteJava exe = new ExecuteJava(); | ExecuteJava exe = new ExecuteJava(); | ||||
exe.setJavaCommand( commandline.getJavaCommand() ); | exe.setJavaCommand( commandline.getJavaCommand() ); | ||||
exe.setClasspath( commandline.getClasspath() ); | exe.setClasspath( commandline.getClasspath() ); | ||||
exe.execute( project ); | |||||
exe.execute( getProject() ); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -229,7 +229,7 @@ public class ANTLR extends Task | |||||
{ | { | ||||
Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, | Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, | ||||
Project.MSG_WARN ), null ); | Project.MSG_WARN ), null ); | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
if( workingdir != null ) | if( workingdir != null ) | ||||
{ | { | ||||
exe.setWorkingDirectory( workingdir ); | exe.setWorkingDirectory( workingdir ); | ||||
@@ -206,7 +206,7 @@ public class Cab extends MatchingTask | |||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
if( fs != null ) | if( fs != null ) | ||||
{ | { | ||||
appendFiles( files, fs.getDirectoryScanner( project ) ); | |||||
appendFiles( files, fs.getDirectoryScanner( getProject() ) ); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -310,7 +310,7 @@ public class Cab extends MatchingTask | |||||
protected ExecTask createExec() | protected ExecTask createExec() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
return (ExecTask)project.createTask( "exec" ); | |||||
return (ExecTask)getProject().createTask( "exec" ); | |||||
} | } | ||||
/** | /** | ||||
@@ -721,7 +721,7 @@ public class IContract extends MatchingTask | |||||
// Prepare the directories for iContract. iContract will make them if they | // Prepare the directories for iContract. iContract will make them if they | ||||
// don't exist, but for some reason I don't know, it will complain about the REP files | // don't exist, but for some reason I don't know, it will complain about the REP files | ||||
// afterwards | // afterwards | ||||
Mkdir mkdir = (Mkdir)project.createTask( "mkdir" ); | |||||
Mkdir mkdir = (Mkdir)getProject().createTask( "mkdir" ); | |||||
mkdir.setDir( instrumentDir ); | mkdir.setDir( instrumentDir ); | ||||
mkdir.execute(); | mkdir.execute(); | ||||
mkdir.setDir( buildDir ); | mkdir.setDir( buildDir ); | ||||
@@ -733,7 +733,7 @@ public class IContract extends MatchingTask | |||||
Path baseClasspath = createClasspath(); | Path baseClasspath = createClasspath(); | ||||
// Might need to add the core classes if we're not using Sun's Javac (like Jikes) | // Might need to add the core classes if we're not using Sun's Javac (like Jikes) | ||||
String compiler = project.getProperty( "build.compiler" ); | |||||
String compiler = getProject().getProperty( "build.compiler" ); | |||||
ClasspathHelper classpathHelper = new ClasspathHelper( compiler ); | ClasspathHelper classpathHelper = new ClasspathHelper( compiler ); | ||||
classpathHelper.modify( baseClasspath ); | classpathHelper.modify( baseClasspath ); | ||||
@@ -764,7 +764,7 @@ public class IContract extends MatchingTask | |||||
iContractClasspath.append( new Path( getProject(), buildDir.getAbsolutePath() ) ); | iContractClasspath.append( new Path( getProject(), buildDir.getAbsolutePath() ) ); | ||||
// Create a forked java process | // Create a forked java process | ||||
Java iContract = (Java)project.createTask( "java" ); | |||||
Java iContract = (Java)getProject().createTask( "java" ); | |||||
iContract.setFork( true ); | iContract.setFork( true ); | ||||
iContract.setClassname( "com.reliablesystems.iContract.Tool" ); | iContract.setClassname( "com.reliablesystems.iContract.Tool" ); | ||||
iContract.setClasspath( iContractClasspath ); | iContract.setClasspath( iContractClasspath ); | ||||
@@ -1079,8 +1079,6 @@ public class IContract extends MatchingTask | |||||
* BuildListener that sets the iContractMissing flag to true if a message | * BuildListener that sets the iContractMissing flag to true if a message | ||||
* about missing iContract is missing. Used to indicate a more verbose error | * about missing iContract is missing. Used to indicate a more verbose error | ||||
* to the user, with advice about how to solve the problem | * to the user, with advice about how to solve the problem | ||||
* | |||||
* @author RT | |||||
*/ | */ | ||||
private class IContractPresenceDetector implements BuildListener | private class IContractPresenceDetector implements BuildListener | ||||
{ | { | ||||
@@ -206,7 +206,7 @@ public class Javah extends Task | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( project ); | |||||
bootclasspath = new Path( getProject() ); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -222,7 +222,7 @@ public class Javah extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( project ); | |||||
classpath = new Path( getProject() ); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -264,7 +264,7 @@ public class Javah extends Task | |||||
classpath = Path.systemClasspath; | classpath = Path.systemClasspath; | ||||
} | } | ||||
String compiler = project.getProperty( "build.compiler" ); | |||||
String compiler = getProject().getProperty( "build.compiler" ); | |||||
if( compiler == null ) | if( compiler == null ) | ||||
{ | { | ||||
if( Project.getJavaVersion() != Project.JAVA_1_1 && | if( Project.getJavaVersion() != Project.JAVA_1_1 && | ||||
@@ -102,7 +102,7 @@ public class Native2Ascii extends MatchingTask | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapper = new Mapper( project ); | |||||
mapper = new Mapper( getProject() ); | |||||
return mapper; | return mapper; | ||||
} | } | ||||
@@ -239,11 +239,11 @@ public class ReplaceRegExp extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
String res = input; | String res = input; | ||||
Regexp regexp = r.getRegexp( project ); | |||||
Regexp regexp = r.getRegexp( getProject() ); | |||||
if( regexp.matches( input, options ) ) | if( regexp.matches( input, options ) ) | ||||
{ | { | ||||
res = regexp.substitute( input, s.getExpression( project ), options ); | |||||
res = regexp.substitute( input, s.getExpression( getProject() ), options ); | |||||
} | } | ||||
return res; | return res; | ||||
@@ -276,7 +276,7 @@ public class ReplaceRegExp extends Task | |||||
boolean changes = false; | boolean changes = false; | ||||
log( "Replacing pattern '" + regex.getPattern( project ) + "' with '" + subs.getExpression( project ) + | |||||
log( "Replacing pattern '" + regex.getPattern( getProject() ) + "' with '" + subs.getExpression( getProject() ) + | |||||
"' in '" + f.getPath() + "'" + | "' in '" + f.getPath() + "'" + | ||||
( byline ? " by line" : "" ) + | ( byline ? " by line" : "" ) + | ||||
( flags.length() > 0 ? " with flags: '" + flags + "'" : "" ) + | ( flags.length() > 0 ? " with flags: '" + flags + "'" : "" ) + | ||||
@@ -189,7 +189,7 @@ public class Rpm extends Task | |||||
Execute exe = new Execute( streamhandler, null ); | Execute exe = new Execute( streamhandler, null ); | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
if( topDir == null ) topDir = getBaseDirectory(); | if( topDir == null ) topDir = getBaseDirectory(); | ||||
exe.setWorkingDirectory( topDir ); | exe.setWorkingDirectory( topDir ); | ||||
@@ -86,8 +86,8 @@ public class Script extends Task | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
addBeans( project.getProperties() ); | |||||
addBeans( project.getReferences() ); | |||||
addBeans( getProject().getProperties() ); | |||||
addBeans( getProject().getReferences() ); | |||||
beans.put( "project", getProject() ); | beans.put( "project", getProject() ); | ||||
@@ -65,7 +65,7 @@ public abstract class Continuus extends Task | |||||
*/ | */ | ||||
public final void setCcmDir( String dir ) | public final void setCcmDir( String dir ) | ||||
{ | { | ||||
_ccmDir = project.translatePath( dir ); | |||||
_ccmDir = getProject().translatePath( dir ); | |||||
} | } | ||||
/** | /** | ||||
@@ -62,7 +62,7 @@ public abstract class ClearCase extends Task | |||||
*/ | */ | ||||
public final void setClearToolDir( String dir ) | public final void setClearToolDir( String dir ) | ||||
{ | { | ||||
m_ClearToolDir = project.translatePath( dir ); | |||||
m_ClearToolDir = getProject().translatePath( dir ); | |||||
} | } | ||||
/** | /** | ||||
@@ -184,7 +184,7 @@ public class Depend extends MatchingTask | |||||
{ | { | ||||
if( dependClasspath == null ) | if( dependClasspath == null ) | ||||
{ | { | ||||
dependClasspath = new Path( project ); | |||||
dependClasspath = new Path( getProject() ); | |||||
} | } | ||||
return dependClasspath.createPath(); | return dependClasspath.createPath(); | ||||
} | } | ||||
@@ -422,7 +422,7 @@ public class CSharp | |||||
{ | { | ||||
//demand create pathlist | //demand create pathlist | ||||
if( _referenceFiles == null ) | if( _referenceFiles == null ) | ||||
_referenceFiles = new Path( this.project ); | |||||
_referenceFiles = new Path( this.getProject() ); | |||||
_referenceFiles.append( path ); | _referenceFiles.append( path ); | ||||
} | } | ||||
@@ -98,7 +98,7 @@ public class BorlandGenerateClient extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( project ); | |||||
this.classpath = new Path( getProject() ); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -53,7 +53,7 @@ public class DDCreator extends MatchingTask | |||||
*/ | */ | ||||
public void setClasspath( String s ) | public void setClasspath( String s ) | ||||
{ | { | ||||
this.classpath = project.translatePath( s ); | |||||
this.classpath = getProject().translatePath( s ); | |||||
} | } | ||||
/** | /** | ||||
@@ -118,13 +118,13 @@ public class DDCreator extends MatchingTask | |||||
} | } | ||||
String systemClassPath = System.getProperty( "java.class.path" ); | String systemClassPath = System.getProperty( "java.class.path" ); | ||||
String execClassPath = project.translatePath( systemClassPath + ":" + classpath ); | |||||
Java ddCreatorTask = (Java)project.createTask( "java" ); | |||||
String execClassPath = getProject().translatePath( systemClassPath + ":" + classpath ); | |||||
Java ddCreatorTask = (Java)getProject().createTask( "java" ); | |||||
ddCreatorTask.setFork( true ); | ddCreatorTask.setFork( true ); | ||||
ddCreatorTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper" ); | ddCreatorTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.DDCreatorHelper" ); | ||||
Commandline.Argument arguments = ddCreatorTask.createArg(); | Commandline.Argument arguments = ddCreatorTask.createArg(); | ||||
arguments.setLine( args ); | arguments.setLine( args ); | ||||
ddCreatorTask.setClasspath( new Path( project, execClassPath ) ); | |||||
ddCreatorTask.setClasspath( new Path( getProject(), execClassPath ) ); | |||||
if( ddCreatorTask.executeJava() != 0 ) | if( ddCreatorTask.executeJava() != 0 ) | ||||
{ | { | ||||
throw new TaskException( "Execution of ddcreator helper failed" ); | throw new TaskException( "Execution of ddcreator helper failed" ); | ||||
@@ -255,7 +255,7 @@ public class EjbJar extends MatchingTask | |||||
{ | { | ||||
if( config.classpath == null ) | if( config.classpath == null ) | ||||
{ | { | ||||
config.classpath = new Path( project ); | |||||
config.classpath = new Path( getProject() ); | |||||
} | } | ||||
return config.classpath.createPath(); | return config.classpath.createPath(); | ||||
} | } | ||||
@@ -64,7 +64,7 @@ public class Ejbc extends MatchingTask | |||||
*/ | */ | ||||
public void setClasspath( String s ) | public void setClasspath( String s ) | ||||
{ | { | ||||
this.classpath = project.translatePath( s ); | |||||
this.classpath = getProject().translatePath( s ); | |||||
} | } | ||||
/** | /** | ||||
@@ -159,14 +159,14 @@ public class Ejbc extends MatchingTask | |||||
} | } | ||||
String systemClassPath = System.getProperty( "java.class.path" ); | String systemClassPath = System.getProperty( "java.class.path" ); | ||||
String execClassPath = project.translatePath( systemClassPath + ":" + classpath + | |||||
String execClassPath = getProject().translatePath( systemClassPath + ":" + classpath + | |||||
":" + generatedFilesDirectory ); | ":" + generatedFilesDirectory ); | ||||
// get all the files in the descriptor directory | // get all the files in the descriptor directory | ||||
DirectoryScanner ds = super.getDirectoryScanner( descriptorDirectory ); | DirectoryScanner ds = super.getDirectoryScanner( descriptorDirectory ); | ||||
String[] files = ds.getIncludedFiles(); | String[] files = ds.getIncludedFiles(); | ||||
Java helperTask = (Java)project.createTask( "java" ); | |||||
Java helperTask = (Java)getProject().createTask( "java" ); | |||||
helperTask.setFork( true ); | helperTask.setFork( true ); | ||||
helperTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.EjbcHelper" ); | helperTask.setClassname( "org.apache.tools.ant.taskdefs.optional.ejb.EjbcHelper" ); | ||||
String args = ""; | String args = ""; | ||||
@@ -183,7 +183,7 @@ public class Ejbc extends MatchingTask | |||||
Commandline.Argument arguments = helperTask.createArg(); | Commandline.Argument arguments = helperTask.createArg(); | ||||
arguments.setLine( args ); | arguments.setLine( args ); | ||||
helperTask.setClasspath( new Path( project, execClassPath ) ); | |||||
helperTask.setClasspath( new Path( getProject(), execClassPath ) ); | |||||
if( helperTask.executeJava() != 0 ) | if( helperTask.executeJava() != 0 ) | ||||
{ | { | ||||
throw new TaskException( "Execution of ejbc helper failed" ); | throw new TaskException( "Execution of ejbc helper failed" ); | ||||
@@ -176,7 +176,7 @@ public class IPlanetEjbcTask extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( project ); | |||||
classpath = new Path( getProject() ); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -237,7 +237,7 @@ public class WLRun extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( project ); | |||||
classpath = new Path( getProject() ); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -251,7 +251,7 @@ public class WLRun extends Task | |||||
{ | { | ||||
if( weblogicClasspath == null ) | if( weblogicClasspath == null ) | ||||
{ | { | ||||
weblogicClasspath = new Path( project ); | |||||
weblogicClasspath = new Path( getProject() ); | |||||
} | } | ||||
return weblogicClasspath.createPath(); | return weblogicClasspath.createPath(); | ||||
} | } | ||||
@@ -312,7 +312,7 @@ public class WLRun extends Task | |||||
} | } | ||||
} | } | ||||
Java weblogicServer = (Java)project.createTask( "java" ); | |||||
Java weblogicServer = (Java)getProject().createTask( "java" ); | |||||
weblogicServer.setFork( true ); | weblogicServer.setFork( true ); | ||||
weblogicServer.setClassname( weblogicMainClass ); | weblogicServer.setClassname( weblogicMainClass ); | ||||
@@ -362,7 +362,7 @@ public class WLRun extends Task | |||||
throw new TaskException( "You must supply a management password to start the server" ); | throw new TaskException( "You must supply a management password to start the server" ); | ||||
} | } | ||||
Java weblogicServer = (Java)project.createTask( "java" ); | |||||
Java weblogicServer = (Java)getProject().createTask( "java" ); | |||||
weblogicServer.setFork( true ); | weblogicServer.setFork( true ); | ||||
weblogicServer.setDir( weblogicSystemHome ); | weblogicServer.setDir( weblogicSystemHome ); | ||||
weblogicServer.setClassname( weblogicMainClass ); | weblogicServer.setClassname( weblogicMainClass ); | ||||
@@ -120,7 +120,7 @@ public class WLStop extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( project ); | |||||
classpath = new Path( getProject() ); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -145,7 +145,7 @@ public class WLStop extends Task | |||||
throw new TaskException( "The url of the weblogic server must be provided." ); | throw new TaskException( "The url of the weblogic server must be provided." ); | ||||
} | } | ||||
Java weblogicAdmin = (Java)project.createTask( "java" ); | |||||
Java weblogicAdmin = (Java)getProject().createTask( "java" ); | |||||
weblogicAdmin.setFork( true ); | weblogicAdmin.setFork( true ); | ||||
weblogicAdmin.setClassname( "weblogic.Admin" ); | weblogicAdmin.setClassname( "weblogic.Admin" ); | ||||
String args; | String args; | ||||
@@ -518,7 +518,7 @@ public class Translate extends MatchingTask | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
for( int j = 0; j < srcFiles.length; j++ ) | for( int j = 0; j < srcFiles.length; j++ ) | ||||
{ | { | ||||
@@ -224,7 +224,7 @@ public class VAJImport extends VAJTask | |||||
*/ | */ | ||||
protected void importFileset( FileSet fileset ) | protected void importFileset( FileSet fileset ) | ||||
{ | { | ||||
DirectoryScanner ds = fileset.getDirectoryScanner( this.project ); | |||||
DirectoryScanner ds = fileset.getDirectoryScanner( this.getProject() ); | |||||
if( ds.getIncludedFiles().length == 0 ) | if( ds.getIncludedFiles().length == 0 ) | ||||
{ | { | ||||
return; | return; | ||||
@@ -175,7 +175,7 @@ public class JJTree extends Task | |||||
{ | { | ||||
throw new TaskException( "Javacchome not set." ); | throw new TaskException( "Javacchome not set." ); | ||||
} | } | ||||
final Path classpath = cmdl.createClasspath( project ); | |||||
final Path classpath = cmdl.createClasspath( getProject() ); | |||||
classpath.createPathElement().setPath( javaccHome.getAbsolutePath() + | classpath.createPathElement().setPath( javaccHome.getAbsolutePath() + | ||||
"/JavaCC.zip" ); | "/JavaCC.zip" ); | ||||
classpath.addJavaRuntime(); | classpath.addJavaRuntime(); | ||||
@@ -225,7 +225,7 @@ public class JavaCC extends Task | |||||
{ | { | ||||
throw new TaskException( "Javacchome not set." ); | throw new TaskException( "Javacchome not set." ); | ||||
} | } | ||||
final Path classpath = cmdl.createClasspath( project ); | |||||
final Path classpath = cmdl.createClasspath( getProject() ); | |||||
classpath.createPathElement().setPath( javaccHome.getAbsolutePath() + | classpath.createPathElement().setPath( javaccHome.getAbsolutePath() + | ||||
"/JavaCC.zip" ); | "/JavaCC.zip" ); | ||||
classpath.addJavaRuntime(); | classpath.addJavaRuntime(); | ||||
@@ -206,7 +206,7 @@ public class JDependTask extends Task | |||||
{ | { | ||||
if( _compileClasspath == null ) | if( _compileClasspath == null ) | ||||
{ | { | ||||
_compileClasspath = new Path( project ); | |||||
_compileClasspath = new Path( getProject() ); | |||||
} | } | ||||
return _compileClasspath.createPath(); | return _compileClasspath.createPath(); | ||||
} | } | ||||
@@ -233,7 +233,7 @@ public class JDependTask extends Task | |||||
{ | { | ||||
if( _sourcesPath == null ) | if( _sourcesPath == null ) | ||||
{ | { | ||||
_sourcesPath = new Path( project ); | |||||
_sourcesPath = new Path( getProject() ); | |||||
} | } | ||||
return _sourcesPath.createPath(); | return _sourcesPath.createPath(); | ||||
} | } | ||||
@@ -340,7 +340,7 @@ public class JDependTask extends Task | |||||
if( getDir() != null ) | if( getDir() != null ) | ||||
{ | { | ||||
execute.setWorkingDirectory( getDir() ); | execute.setWorkingDirectory( getDir() ); | ||||
execute.setAntRun( project ); | |||||
execute.setAntRun( getProject() ); | |||||
} | } | ||||
if( getOutputFile() != null ) | if( getOutputFile() != null ) | ||||
@@ -315,7 +315,7 @@ public class JspC extends MatchingTask | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
classpath = new Path( project ); | |||||
classpath = new Path( getProject() ); | |||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -376,7 +376,7 @@ public class JspC extends MatchingTask | |||||
// compile the source files | // compile the source files | ||||
String compiler = project.getProperty( "jsp.compiler" ); | |||||
String compiler = getProject().getProperty( "jsp.compiler" ); | |||||
if( compiler == null ) | if( compiler == null ) | ||||
{ | { | ||||
compiler = "jasper"; | compiler = "jasper"; | ||||
@@ -127,7 +127,7 @@ public class WLJspc extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( project ); | |||||
compileClasspath = new Path( getProject() ); | |||||
} | } | ||||
return compileClasspath; | return compileClasspath; | ||||
} | } | ||||
@@ -161,7 +161,7 @@ public class WLJspc extends MatchingTask | |||||
//use the systemclasspath as well, to include the ant jar | //use the systemclasspath as well, to include the ant jar | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( project ); | |||||
compileClasspath = new Path( getProject() ); | |||||
} | } | ||||
compileClasspath.append( Path.systemClasspath ); | compileClasspath.append( Path.systemClasspath ); | ||||
@@ -171,7 +171,7 @@ public class WLJspc extends MatchingTask | |||||
// Therefore, takes loads of time | // Therefore, takes loads of time | ||||
// Can pass directories at a time (*.jsp) but easily runs out of memory on hefty dirs | // Can pass directories at a time (*.jsp) but easily runs out of memory on hefty dirs | ||||
// (even on a Sun) | // (even on a Sun) | ||||
Java helperTask = (Java)project.createTask( "java" ); | |||||
Java helperTask = (Java)getProject().createTask( "java" ); | |||||
helperTask.setFork( true ); | helperTask.setFork( true ); | ||||
helperTask.setClassname( "weblogic.jspc" ); | helperTask.setClassname( "weblogic.jspc" ); | ||||
String[] args = new String[ 12 ]; | String[] args = new String[ 12 ]; | ||||
@@ -344,7 +344,7 @@ public class JUnitTask extends Task | |||||
*/ | */ | ||||
public BatchTest createBatchTest() | public BatchTest createBatchTest() | ||||
{ | { | ||||
BatchTest test = new BatchTest( project ); | |||||
BatchTest test = new BatchTest( getProject() ); | |||||
batchTests.addElement( test ); | batchTests.addElement( test ); | ||||
return test; | return test; | ||||
} | } | ||||
@@ -356,7 +356,7 @@ public class JUnitTask extends Task | |||||
*/ | */ | ||||
public Path createClasspath() | public Path createClasspath() | ||||
{ | { | ||||
return commandline.createClasspath( project ).createPath(); | |||||
return commandline.createClasspath( getProject() ).createPath(); | |||||
} | } | ||||
/** | /** | ||||
@@ -392,7 +392,7 @@ public class JUnitTask extends Task | |||||
while( list.hasMoreElements() ) | while( list.hasMoreElements() ) | ||||
{ | { | ||||
JUnitTest test = (JUnitTest)list.nextElement(); | JUnitTest test = (JUnitTest)list.nextElement(); | ||||
if( test.shouldRun( project ) ) | |||||
if( test.shouldRun( getProject() ) ) | |||||
{ | { | ||||
execute( test ); | execute( test ); | ||||
} | } | ||||
@@ -655,7 +655,7 @@ public class JUnitTask extends Task | |||||
// Create a temporary file to pass the Ant properties to the forked test | // Create a temporary file to pass the Ant properties to the forked test | ||||
File propsFile = new File( "junit" + ( new Random( System.currentTimeMillis() ) ).nextLong() + ".properties" ); | File propsFile = new File( "junit" + ( new Random( System.currentTimeMillis() ) ).nextLong() + ".properties" ); | ||||
cmd.createArgument().setValue( "propsfile=" + propsFile.getAbsolutePath() ); | cmd.createArgument().setValue( "propsfile=" + propsFile.getAbsolutePath() ); | ||||
Hashtable p = project.getProperties(); | |||||
Hashtable p = getProject().getProperties(); | |||||
Properties props = new Properties(); | Properties props = new Properties(); | ||||
for( Enumeration enum = p.keys(); enum.hasMoreElements(); ) | for( Enumeration enum = p.keys(); enum.hasMoreElements(); ) | ||||
{ | { | ||||
@@ -675,7 +675,7 @@ public class JUnitTask extends Task | |||||
Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); | Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); | ||||
execute.setCommandline( cmd.getCommandline() ); | execute.setCommandline( cmd.getCommandline() ); | ||||
execute.setAntRun( project ); | |||||
execute.setAntRun( getProject() ); | |||||
if( dir != null ) | if( dir != null ) | ||||
{ | { | ||||
execute.setWorkingDirectory( dir ); | execute.setWorkingDirectory( dir ); | ||||
@@ -710,7 +710,7 @@ public class JUnitTask extends Task | |||||
private int executeInVM( JUnitTest test ) | private int executeInVM( JUnitTest test ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
test.setProperties( project.getProperties() ); | |||||
test.setProperties( getProject().getProperties() ); | |||||
if( dir != null ) | if( dir != null ) | ||||
{ | { | ||||
log( "dir attribute ignored if running in the same VM", Project.MSG_WARN ); | log( "dir attribute ignored if running in the same VM", Project.MSG_WARN ); | ||||
@@ -730,7 +730,7 @@ public class JUnitTask extends Task | |||||
{ | { | ||||
log( "Using CLASSPATH " + classpath, Project.MSG_VERBOSE ); | log( "Using CLASSPATH " + classpath, Project.MSG_VERBOSE ); | ||||
cl = new AntClassLoader( null, project, classpath, false ); | |||||
cl = new AntClassLoader( null, getProject(), classpath, false ); | |||||
// make sure the test will be accepted as a TestCase | // make sure the test will be accepted as a TestCase | ||||
cl.addSystemPackageRoot( "junit" ); | cl.addSystemPackageRoot( "junit" ); | ||||
// will cause trouble in JDK 1.1 if omitted | // will cause trouble in JDK 1.1 if omitted | ||||
@@ -185,7 +185,7 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||||
} | } | ||||
if( toDir == null ) | if( toDir == null ) | ||||
{ | { | ||||
toDir = FileUtil.resolveFile( project.getBaseDir(), DEFAULT_DIR ); | |||||
toDir = FileUtil.resolveFile( getProject().getBaseDir(), DEFAULT_DIR ); | |||||
} | } | ||||
return new File( toDir, toFile ); | return new File( toDir, toFile ); | ||||
} | } | ||||
@@ -202,7 +202,7 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||||
for( int i = 0; i < size; i++ ) | for( int i = 0; i < size; i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
ds.scan(); | ds.scan(); | ||||
String[] f = ds.getIncludedFiles(); | String[] f = ds.getIncludedFiles(); | ||||
for( int j = 0; j < f.length; j++ ) | for( int j = 0; j < f.length; j++ ) | ||||
@@ -212,7 +212,7 @@ public class XMLResultAggregator extends Task implements XMLConstants | |||||
{ | { | ||||
File file = new File( ds.getBasedir(), pathname ); | File file = new File( ds.getBasedir(), pathname ); | ||||
file = FileUtil. | file = FileUtil. | ||||
resolveFile( project.getBaseDir(), file.getPath() ); | |||||
resolveFile( getProject().getBaseDir(), file.getPath() ); | |||||
v.addElement( file ); | v.addElement( file ); | ||||
} | } | ||||
} | } | ||||
@@ -159,7 +159,7 @@ public abstract class AbstractMetamataTask extends Task | |||||
{ | { | ||||
if( classPath == null ) | if( classPath == null ) | ||||
{ | { | ||||
classPath = new Path( project ); | |||||
classPath = new Path( getProject() ); | |||||
} | } | ||||
return classPath; | return classPath; | ||||
} | } | ||||
@@ -183,7 +183,7 @@ public abstract class AbstractMetamataTask extends Task | |||||
{ | { | ||||
if( sourcePath == null ) | if( sourcePath == null ) | ||||
{ | { | ||||
sourcePath = new Path( project ); | |||||
sourcePath = new Path( getProject() ); | |||||
} | } | ||||
return sourcePath; | return sourcePath; | ||||
} | } | ||||
@@ -222,7 +222,7 @@ public abstract class AbstractMetamataTask extends Task | |||||
// set the classpath as the jar file | // set the classpath as the jar file | ||||
File jar = getMetamataJar( metamataHome ); | File jar = getMetamataJar( metamataHome ); | ||||
final Path classPath = cmdl.createClasspath( project ); | |||||
final Path classPath = cmdl.createClasspath( getProject() ); | |||||
classPath.createPathElement().setLocation( jar ); | classPath.createPathElement().setLocation( jar ); | ||||
// set the metamata.home property | // set the metamata.home property | ||||
@@ -374,7 +374,7 @@ public abstract class AbstractMetamataTask extends Task | |||||
for( int i = 0; i < fileSets.size(); i++ ) | for( int i = 0; i < fileSets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)fileSets.elementAt( i ); | FileSet fs = (FileSet)fileSets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
ds.scan(); | ds.scan(); | ||||
String[] f = ds.getIncludedFiles(); | String[] f = ds.getIncludedFiles(); | ||||
log( i + ") Adding " + f.length + " files from directory " + ds.getBasedir(), Project.MSG_VERBOSE ); | log( i + ") Adding " + f.length + " files from directory " + ds.getBasedir(), Project.MSG_VERBOSE ); | ||||
@@ -135,7 +135,7 @@ public class MAudit extends AbstractMetamataTask | |||||
{ | { | ||||
if( searchPath == null ) | if( searchPath == null ) | ||||
{ | { | ||||
searchPath = new Path( project ); | |||||
searchPath = new Path( getProject() ); | |||||
} | } | ||||
return searchPath; | return searchPath; | ||||
} | } | ||||
@@ -113,7 +113,7 @@ public class MMetrics extends AbstractMetamataTask | |||||
{ | { | ||||
if( path == null ) | if( path == null ) | ||||
{ | { | ||||
path = new Path( project ); | |||||
path = new Path( getProject() ); | |||||
} | } | ||||
return path; | return path; | ||||
} | } | ||||
@@ -150,7 +150,7 @@ public class MParse extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( project ); | |||||
classpath = new Path( getProject() ); | |||||
} | } | ||||
return classpath; | return classpath; | ||||
} | } | ||||
@@ -174,7 +174,7 @@ public class MParse extends Task | |||||
{ | { | ||||
if( sourcepath == null ) | if( sourcepath == null ) | ||||
{ | { | ||||
sourcepath = new Path( project ); | |||||
sourcepath = new Path( getProject() ); | |||||
} | } | ||||
return sourcepath; | return sourcepath; | ||||
} | } | ||||
@@ -211,7 +211,7 @@ public class MParse extends Task | |||||
// set the classpath as the jar files | // set the classpath as the jar files | ||||
File[] jars = getMetamataLibs(); | File[] jars = getMetamataLibs(); | ||||
final Path classPath = cmdl.createClasspath( project ); | |||||
final Path classPath = cmdl.createClasspath( getProject() ); | |||||
for( int i = 0; i < jars.length; i++ ) | for( int i = 0; i < jars.length; i++ ) | ||||
{ | { | ||||
classPath.createPathElement().setLocation( jars[ i ] ); | classPath.createPathElement().setLocation( jars[ i ] ); | ||||
@@ -798,12 +798,12 @@ public class FTP | |||||
if( action == SEND_FILES ) | if( action == SEND_FILES ) | ||||
{ | { | ||||
ds = fs.getDirectoryScanner( project ); | |||||
ds = fs.getDirectoryScanner( getProject() ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
ds = new FTPDirectoryScanner( ftp ); | ds = new FTPDirectoryScanner( ftp ); | ||||
fs.setupDirectoryScanner( ds, project ); | |||||
fs.setupDirectoryScanner( ds, getProject() ); | |||||
ds.scan(); | ds.scan(); | ||||
} | } | ||||
@@ -308,7 +308,7 @@ public class MimeMail extends Task | |||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
if( fs != null ) | if( fs != null ) | ||||
{ | { | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] dsfiles = ds.getIncludedFiles(); | String[] dsfiles = ds.getIncludedFiles(); | ||||
File baseDir = ds.getBasedir(); | File baseDir = ds.getBasedir(); | ||||
@@ -124,7 +124,7 @@ public class P4Add extends P4Base | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
//File fromDir = fs.getDir(project); | //File fromDir = fs.getDir(project); | ||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
@@ -100,11 +100,11 @@ public abstract class P4Base extends org.apache.tools.ant.Task | |||||
//Get default P4 settings from environment - Mark would have done something cool with | //Get default P4 settings from environment - Mark would have done something cool with | ||||
//introspection here.....:-) | //introspection here.....:-) | ||||
String tmpprop; | String tmpprop; | ||||
if( ( tmpprop = project.getProperty( "p4.port" ) ) != null ) | |||||
if( ( tmpprop = getProject().getProperty( "p4.port" ) ) != null ) | |||||
setPort( tmpprop ); | setPort( tmpprop ); | ||||
if( ( tmpprop = project.getProperty( "p4.client" ) ) != null ) | |||||
if( ( tmpprop = getProject().getProperty( "p4.client" ) ) != null ) | |||||
setClient( tmpprop ); | setClient( tmpprop ); | ||||
if( ( tmpprop = project.getProperty( "p4.user" ) ) != null ) | |||||
if( ( tmpprop = getProject().getProperty( "p4.user" ) ) != null ) | |||||
setUser( tmpprop ); | setUser( tmpprop ); | ||||
} | } | ||||
@@ -167,7 +167,7 @@ public abstract class P4Base extends org.apache.tools.ant.Task | |||||
Execute exe = new Execute( handler, null ); | Execute exe = new Execute( handler, null ); | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
exe.setCommandline( commandline.getCommandline() ); | exe.setCommandline( commandline.getCommandline() ); | ||||
@@ -81,7 +81,7 @@ public class P4Change extends P4Base | |||||
if( emptyChangeList == null ) | if( emptyChangeList == null ) | ||||
emptyChangeList = getEmptyChangeList(); | emptyChangeList = getEmptyChangeList(); | ||||
final Project myProj = project; | |||||
final Project myProj = getProject(); | |||||
P4Handler handler = | P4Handler handler = | ||||
new P4HandlerAdapter() | new P4HandlerAdapter() | ||||
@@ -76,7 +76,7 @@ public class P4Counter extends P4Base | |||||
if( shouldSetProperty ) | if( shouldSetProperty ) | ||||
{ | { | ||||
final Project myProj = project; | |||||
final Project myProj = getProject(); | |||||
P4Handler handler = | P4Handler handler = | ||||
new P4HandlerAdapter() | new P4HandlerAdapter() | ||||
@@ -203,7 +203,7 @@ public class CovReport extends Task | |||||
{ | { | ||||
if( coveragePath == null ) | if( coveragePath == null ) | ||||
{ | { | ||||
coveragePath = new Path( project ); | |||||
coveragePath = new Path( getProject() ); | |||||
} | } | ||||
return coveragePath.createPath(); | return coveragePath.createPath(); | ||||
} | } | ||||
@@ -221,7 +221,7 @@ public class CovReport extends Task | |||||
{ | { | ||||
if( sourcePath == null ) | if( sourcePath == null ) | ||||
{ | { | ||||
sourcePath = new Path( project ); | |||||
sourcePath = new Path( getProject() ); | |||||
} | } | ||||
return sourcePath.createPath(); | return sourcePath.createPath(); | ||||
} | } | ||||
@@ -290,7 +290,7 @@ public class CovReport extends Task | |||||
// as a default -sourcepath use . in JProbe, so use project . | // as a default -sourcepath use . in JProbe, so use project . | ||||
if( sourcePath == null ) | if( sourcePath == null ) | ||||
{ | { | ||||
sourcePath = new Path( project ); | |||||
sourcePath = new Path( getProject() ); | |||||
sourcePath.createPath().setLocation( getBaseDirectory() ); | sourcePath.createPath().setLocation( getBaseDirectory() ); | ||||
} | } | ||||
v.addElement( "-sourcepath=" + sourcePath ); | v.addElement( "-sourcepath=" + sourcePath ); | ||||
@@ -364,7 +364,7 @@ public class CovReport extends Task | |||||
{ | { | ||||
if( classPath == null ) | if( classPath == null ) | ||||
{ | { | ||||
classPath = new Path( CovReport.this.project ); | |||||
classPath = new Path( CovReport.this.getProject() ); | |||||
} | } | ||||
return classPath.createPath(); | return classPath.createPath(); | ||||
} | } | ||||
@@ -229,7 +229,7 @@ public class Coverage extends Task | |||||
*/ | */ | ||||
public Path createClasspath() | public Path createClasspath() | ||||
{ | { | ||||
return cmdlJava.createClasspath( project ).createPath(); | |||||
return cmdlJava.createClasspath( getProject() ).createPath(); | |||||
} | } | ||||
public Filters createFilters() | public Filters createFilters() | ||||
@@ -135,7 +135,7 @@ public abstract class MSVSS extends Task | |||||
*/ | */ | ||||
public final void setSsdir( String dir ) | public final void setSsdir( String dir ) | ||||
{ | { | ||||
m_SSDir = project.translatePath( dir ); | |||||
m_SSDir = getProject().translatePath( dir ); | |||||
} | } | ||||
/** | /** | ||||
@@ -227,7 +227,7 @@ public abstract class MSVSS extends Task | |||||
exe.setEnvironment( newEnv ); | exe.setEnvironment( newEnv ); | ||||
} | } | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
exe.setWorkingDirectory( getBaseDirectory() ); | exe.setWorkingDirectory( getBaseDirectory() ); | ||||
exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
return exe.execute(); | return exe.execute(); | ||||
@@ -20,7 +20,7 @@ import org.apache.myrmidon.api.TaskException; | |||||
public abstract class ProjectComponent | public abstract class ProjectComponent | ||||
extends AbstractTask | extends AbstractTask | ||||
{ | { | ||||
protected Project project; | |||||
private Project project; | |||||
/** | /** | ||||
* Sets the project object of this component. This method is used by project | * Sets the project object of this component. This method is used by project | ||||
@@ -51,7 +51,7 @@ public class TaskAdapter extends Task | |||||
c.getMethod( "setProject", new Class[]{Project.class} ); | c.getMethod( "setProject", new Class[]{Project.class} ); | ||||
if( setProjectM != null ) | if( setProjectM != null ) | ||||
{ | { | ||||
setProjectM.invoke( proxy, new Object[]{project} ); | |||||
setProjectM.invoke( proxy, new Object[]{getProject()} ); | |||||
} | } | ||||
} | } | ||||
catch( NoSuchMethodException e ) | catch( NoSuchMethodException e ) | ||||
@@ -75,25 +75,25 @@ public class AntStructure extends Task | |||||
out = new PrintWriter( new FileWriter( output ) ); | out = new PrintWriter( new FileWriter( output ) ); | ||||
} | } | ||||
printHead( out, project.getTaskDefinitions().keys(), | |||||
project.getDataTypeDefinitions().keys() ); | |||||
printHead( out, getProject().getTaskDefinitions().keys(), | |||||
getProject().getDataTypeDefinitions().keys() ); | |||||
printTargetDecl( out ); | printTargetDecl( out ); | ||||
Enumeration dataTypes = project.getDataTypeDefinitions().keys(); | |||||
Enumeration dataTypes = getProject().getDataTypeDefinitions().keys(); | |||||
while( dataTypes.hasMoreElements() ) | while( dataTypes.hasMoreElements() ) | ||||
{ | { | ||||
String typeName = (String)dataTypes.nextElement(); | String typeName = (String)dataTypes.nextElement(); | ||||
printElementDecl( out, typeName, | printElementDecl( out, typeName, | ||||
(Class)project.getDataTypeDefinitions().get( typeName ) ); | |||||
(Class)getProject().getDataTypeDefinitions().get( typeName ) ); | |||||
} | } | ||||
Enumeration tasks = project.getTaskDefinitions().keys(); | |||||
Enumeration tasks = getProject().getTaskDefinitions().keys(); | |||||
while( tasks.hasMoreElements() ) | while( tasks.hasMoreElements() ) | ||||
{ | { | ||||
String taskName = (String)tasks.nextElement(); | String taskName = (String)tasks.nextElement(); | ||||
printElementDecl( out, taskName, | printElementDecl( out, taskName, | ||||
(Class)project.getTaskDefinitions().get( taskName ) ); | |||||
(Class)getProject().getTaskDefinitions().get( taskName ) ); | |||||
} | } | ||||
printTail( out ); | printTail( out ); | ||||
@@ -97,7 +97,7 @@ public class Available | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( project ); | |||||
this.classpath = new Path( getProject() ); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -107,7 +107,7 @@ public class Available | |||||
{ | { | ||||
if( this.filepath == null ) | if( this.filepath == null ) | ||||
{ | { | ||||
this.filepath = new Path( project ); | |||||
this.filepath = new Path( getProject() ); | |||||
} | } | ||||
return this.filepath.createPath(); | return this.filepath.createPath(); | ||||
} | } | ||||
@@ -130,8 +130,8 @@ public class Available | |||||
if( classpath != null ) | if( classpath != null ) | ||||
{ | { | ||||
classpath.setProject( project ); | |||||
this.loader = new AntClassLoader( project, classpath ); | |||||
classpath.setProject( getProject() ); | |||||
this.loader = new AntClassLoader( getProject(), classpath ); | |||||
} | } | ||||
if( ( classname != null ) && !checkClass( classname ) ) | if( ( classname != null ) && !checkClass( classname ) ) | ||||
@@ -178,7 +178,7 @@ public class Available | |||||
if( eval() ) | if( eval() ) | ||||
{ | { | ||||
String lSep = System.getProperty( "line.separator" ); | String lSep = System.getProperty( "line.separator" ); | ||||
if( null == project.getProperty( property ) ) | |||||
if( null == getProject().getProperty( property ) ) | |||||
{ | { | ||||
setProperty( property, value ); | setProperty( property, value ); | ||||
} | } | ||||
@@ -475,11 +475,11 @@ public class Checksum extends MatchingTask implements Condition | |||||
for( int i = 0; i < sizeofFileSet; i++ ) | for( int i = 0; i < sizeofFileSet; i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
for( int j = 0; j < srcFiles.length; j++ ) | for( int j = 0; j < srcFiles.length; j++ ) | ||||
{ | { | ||||
File src = new File( fs.getDir( project ), srcFiles[ j ] ); | |||||
File src = new File( fs.getDir( getProject() ), srcFiles[ j ] ); | |||||
addToIncludeFileMap( src ); | addToIncludeFileMap( src ); | ||||
} | } | ||||
} | } | ||||
@@ -151,14 +151,14 @@ public class Chmod extends ExecuteOn | |||||
public void execute() | public void execute() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( defaultSetDefined || defaultSet.getDir( project ) == null ) | |||||
if( defaultSetDefined || defaultSet.getDir( getProject() ) == null ) | |||||
{ | { | ||||
super.execute(); | super.execute(); | ||||
} | } | ||||
else if( isValidOs() ) | else if( isValidOs() ) | ||||
{ | { | ||||
// we are chmodding the given directory | // we are chmodding the given directory | ||||
createArg().setValue( defaultSet.getDir( project ).getPath() ); | |||||
createArg().setValue( defaultSet.getDir( getProject() ).getPath() ); | |||||
Execute execute = prepareExec(); | Execute execute = prepareExec(); | ||||
try | try | ||||
{ | { | ||||
@@ -190,7 +190,7 @@ public class Chmod extends ExecuteOn | |||||
throw new TaskException( "Required attribute perm not set in chmod" ); | throw new TaskException( "Required attribute perm not set in chmod" ); | ||||
} | } | ||||
if( defaultSetDefined && defaultSet.getDir( project ) != null ) | |||||
if( defaultSetDefined && defaultSet.getDir( getProject() ) != null ) | |||||
{ | { | ||||
addFileset( defaultSet ); | addFileset( defaultSet ); | ||||
} | } | ||||
@@ -155,13 +155,13 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileSet targetFS = (FileSet)enumTargetSets.nextElement(); | FileSet targetFS = (FileSet)enumTargetSets.nextElement(); | ||||
DirectoryScanner targetDS = targetFS.getDirectoryScanner( project ); | |||||
DirectoryScanner targetDS = targetFS.getDirectoryScanner( getProject() ); | |||||
String[] targetFiles = targetDS.getIncludedFiles(); | String[] targetFiles = targetDS.getIncludedFiles(); | ||||
for( int i = 0; i < targetFiles.length; i++ ) | for( int i = 0; i < targetFiles.length; i++ ) | ||||
{ | { | ||||
File dest = new File( targetFS.getDir( project ), targetFiles[ i ] ); | |||||
File dest = new File( targetFS.getDir( getProject() ), targetFiles[ i ] ); | |||||
allTargets.addElement( dest ); | allTargets.addElement( dest ); | ||||
if( dest.lastModified() > now ) | if( dest.lastModified() > now ) | ||||
@@ -181,12 +181,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileList targetFL = (FileList)enumTargetLists.nextElement(); | FileList targetFL = (FileList)enumTargetLists.nextElement(); | ||||
String[] targetFiles = targetFL.getFiles( project ); | |||||
String[] targetFiles = targetFL.getFiles( getProject() ); | |||||
for( int i = 0; i < targetFiles.length; i++ ) | for( int i = 0; i < targetFiles.length; i++ ) | ||||
{ | { | ||||
File dest = new File( targetFL.getDir( project ), targetFiles[ i ] ); | |||||
File dest = new File( targetFL.getDir( getProject() ), targetFiles[ i ] ); | |||||
if( !dest.exists() ) | if( !dest.exists() ) | ||||
{ | { | ||||
log( targetFiles[ i ] + " does not exist.", Project.MSG_VERBOSE ); | log( targetFiles[ i ] + " does not exist.", Project.MSG_VERBOSE ); | ||||
@@ -215,12 +215,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileSet sourceFS = (FileSet)enumSourceSets.nextElement(); | FileSet sourceFS = (FileSet)enumSourceSets.nextElement(); | ||||
DirectoryScanner sourceDS = sourceFS.getDirectoryScanner( project ); | |||||
DirectoryScanner sourceDS = sourceFS.getDirectoryScanner( getProject() ); | |||||
String[] sourceFiles = sourceDS.getIncludedFiles(); | String[] sourceFiles = sourceDS.getIncludedFiles(); | ||||
for( int i = 0; upToDate && i < sourceFiles.length; i++ ) | for( int i = 0; upToDate && i < sourceFiles.length; i++ ) | ||||
{ | { | ||||
File src = new File( sourceFS.getDir( project ), sourceFiles[ i ] ); | |||||
File src = new File( sourceFS.getDir( getProject() ), sourceFiles[ i ] ); | |||||
if( src.lastModified() > now ) | if( src.lastModified() > now ) | ||||
{ | { | ||||
@@ -255,12 +255,12 @@ public class DependSet extends MatchingTask | |||||
{ | { | ||||
FileList sourceFL = (FileList)enumSourceLists.nextElement(); | FileList sourceFL = (FileList)enumSourceLists.nextElement(); | ||||
String[] sourceFiles = sourceFL.getFiles( project ); | |||||
String[] sourceFiles = sourceFL.getFiles( getProject() ); | |||||
int i = 0; | int i = 0; | ||||
do | do | ||||
{ | { | ||||
File src = new File( sourceFL.getDir( project ), sourceFiles[ i ] ); | |||||
File src = new File( sourceFL.getDir( getProject() ), sourceFiles[ i ] ); | |||||
if( src.lastModified() > now ) | if( src.lastModified() > now ) | ||||
{ | { | ||||
@@ -108,7 +108,7 @@ public class Echo extends Task | |||||
public void addText( String msg ) | public void addText( String msg ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
message += project.replaceProperties( msg ); | |||||
message += getProject().replaceProperties( msg ); | |||||
} | } | ||||
/** | /** | ||||
@@ -122,7 +122,7 @@ public class ExecuteOn extends ExecTask | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapperElement = new Mapper( project ); | |||||
mapperElement = new Mapper( getProject() ); | |||||
return mapperElement; | return mapperElement; | ||||
} | } | ||||
@@ -385,8 +385,8 @@ public class ExecuteOn extends ExecTask | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
File base = fs.getDir( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
File base = fs.getDir( getProject() ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
if( !"dir".equals( type ) ) | if( !"dir".equals( type ) ) | ||||
{ | { | ||||
@@ -132,8 +132,8 @@ public class Expand extends MatchingTask | |||||
for( int j = 0; j < filesets.size(); j++ ) | for( int j = 0; j < filesets.size(); j++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( j ); | FileSet fs = (FileSet)filesets.elementAt( j ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
File fromDir = fs.getDir( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
File fromDir = fs.getDir( getProject() ); | |||||
String[] files = ds.getIncludedFiles(); | String[] files = ds.getIncludedFiles(); | ||||
for( int i = 0; i < files.length; ++i ) | for( int i = 0; i < files.length; ++i ) | ||||
@@ -201,7 +201,7 @@ public class Expand extends MatchingTask | |||||
for( int v = 0; v < patternsets.size(); v++ ) | for( int v = 0; v < patternsets.size(); v++ ) | ||||
{ | { | ||||
PatternSet p = (PatternSet)patternsets.elementAt( v ); | PatternSet p = (PatternSet)patternsets.elementAt( v ); | ||||
String[] incls = p.getIncludePatterns( project ); | |||||
String[] incls = p.getIncludePatterns( getProject() ); | |||||
if( incls != null ) | if( incls != null ) | ||||
{ | { | ||||
for( int w = 0; w < incls.length; w++ ) | for( int w = 0; w < incls.length; w++ ) | ||||
@@ -214,7 +214,7 @@ public class Expand extends MatchingTask | |||||
} | } | ||||
} | } | ||||
} | } | ||||
String[] excls = p.getExcludePatterns( project ); | |||||
String[] excls = p.getExcludePatterns( getProject() ); | |||||
if( excls != null ) | if( excls != null ) | ||||
{ | { | ||||
for( int w = 0; w < excls.length; w++ ) | for( int w = 0; w < excls.length; w++ ) | ||||
@@ -57,7 +57,7 @@ public class Filter extends Task | |||||
if( isSingleFilter ) | if( isSingleFilter ) | ||||
{ | { | ||||
project.getGlobalFilterSet().addFilter( token, value ); | |||||
getProject().getGlobalFilterSet().addFilter( token, value ); | |||||
} | } | ||||
if( isFiltersFromFile ) | if( isFiltersFromFile ) | ||||
@@ -70,6 +70,6 @@ public class Filter extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
log( "Reading filters from " + filtersFile, Project.MSG_VERBOSE ); | log( "Reading filters from " + filtersFile, Project.MSG_VERBOSE ); | ||||
project.getGlobalFilterSet().readFiltersFromFile( filtersFile ); | |||||
getProject().getGlobalFilterSet().readFiltersFromFile( filtersFile ); | |||||
} | } | ||||
} | } |
@@ -140,7 +140,7 @@ public class GenerateKey | |||||
public void execute() | public void execute() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( project.getJavaVersion().equals( Project.JAVA_1_1 ) ) | |||||
if( getProject().getJavaVersion().equals( Project.JAVA_1_1 ) ) | |||||
{ | { | ||||
throw new TaskException( "The genkey task is only available on JDK" + | throw new TaskException( "The genkey task is only available on JDK" + | ||||
" versions 1.2 or greater" ); | " versions 1.2 or greater" ); | ||||
@@ -162,7 +162,7 @@ public class GenerateKey | |||||
} | } | ||||
getLogger().info( "Generating Key for " + alias ); | getLogger().info( "Generating Key for " + alias ); | ||||
final ExecTask cmd = (ExecTask)project.createTask( "exec" ); | |||||
final ExecTask cmd = (ExecTask)getProject().createTask( "exec" ); | |||||
cmd.setExecutable( "keytool" ); | cmd.setExecutable( "keytool" ); | ||||
cmd.createArg().setValue( "-genkey " ); | cmd.createArg().setValue( "-genkey " ); | ||||
@@ -95,7 +95,7 @@ public class Get extends Task | |||||
*/ | */ | ||||
public void setUseTimestamp( boolean v ) | public void setUseTimestamp( boolean v ) | ||||
{ | { | ||||
if( project.getJavaVersion() != Project.JAVA_1_1 ) | |||||
if( getProject().getJavaVersion() != Project.JAVA_1_1 ) | |||||
{ | { | ||||
useTimestamp = v; | useTimestamp = v; | ||||
} | } | ||||
@@ -300,9 +300,9 @@ public class Get extends Task | |||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( project.getJavaVersion() != Project.JAVA_1_1 ) | |||||
if( getProject().getJavaVersion() != Project.JAVA_1_1 ) | |||||
{ | { | ||||
Touch touch = (Touch)project.createTask( "touch" ); | |||||
Touch touch = (Touch)getProject().createTask( "touch" ); | |||||
touch.setFile( file ); | touch.setFile( file ); | ||||
touch.setMillis( timemillis ); | touch.setMillis( timemillis ); | ||||
touch.touch(); | touch.touch(); | ||||
@@ -89,7 +89,7 @@ public class Input extends Task | |||||
public void addText( String msg ) | public void addText( String msg ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
message += project.replaceProperties( msg ); | |||||
message += getProject().replaceProperties( msg ); | |||||
} | } | ||||
/** | /** | ||||
@@ -143,7 +143,7 @@ public class Input extends Task | |||||
// adopted from org.apache.tools.ant.taskdefs.Property | // adopted from org.apache.tools.ant.taskdefs.Property | ||||
if( addproperty != null ) | if( addproperty != null ) | ||||
{ | { | ||||
if( project.getProperty( addproperty ) == null ) | |||||
if( getProject().getProperty( addproperty ) == null ) | |||||
{ | { | ||||
setProperty( addproperty, input ); | setProperty( addproperty, input ); | ||||
} | } | ||||
@@ -197,7 +197,7 @@ public class Java extends Task | |||||
public Path createClasspath() | public Path createClasspath() | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
return cmdl.createClasspath( project ).createPath(); | |||||
return cmdl.createClasspath( getProject() ).createPath(); | |||||
} | } | ||||
/** | /** | ||||
@@ -339,7 +339,7 @@ public class Java extends Task | |||||
try | try | ||||
{ | { | ||||
outStream = new PrintStream( new FileOutputStream( out ) ); | outStream = new PrintStream( new FileOutputStream( out ) ); | ||||
exe.execute( project ); | |||||
exe.execute( getProject() ); | |||||
} | } | ||||
catch( IOException io ) | catch( IOException io ) | ||||
{ | { | ||||
@@ -355,7 +355,7 @@ public class Java extends Task | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
exe.execute( project ); | |||||
exe.execute( getProject() ); | |||||
} | } | ||||
} | } | ||||
@@ -385,7 +385,7 @@ public class Java extends Task | |||||
exe = new Execute( new PumpStreamHandler( fos ), null ); | exe = new Execute( new PumpStreamHandler( fos ), null ); | ||||
} | } | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
if( dir == null ) | if( dir == null ) | ||||
{ | { | ||||
@@ -646,7 +646,7 @@ public class Javac extends MatchingTask | |||||
public boolean isForkedJavac() | public boolean isForkedJavac() | ||||
{ | { | ||||
return !"false".equals( fork ) || | return !"false".equals( fork ) || | ||||
"extJavac".equals( project.getProperty( "build.compiler" ) ); | |||||
"extJavac".equals( getProject().getProperty( "build.compiler" ) ); | |||||
} | } | ||||
/** | /** | ||||
@@ -659,7 +659,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( project ); | |||||
bootclasspath = new Path( getProject() ); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -674,7 +674,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( project ); | |||||
compileClasspath = new Path( getProject() ); | |||||
} | } | ||||
return compileClasspath.createPath(); | return compileClasspath.createPath(); | ||||
} | } | ||||
@@ -702,7 +702,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( extdirs == null ) | if( extdirs == null ) | ||||
{ | { | ||||
extdirs = new Path( project ); | |||||
extdirs = new Path( getProject() ); | |||||
} | } | ||||
return extdirs.createPath(); | return extdirs.createPath(); | ||||
} | } | ||||
@@ -717,7 +717,7 @@ public class Javac extends MatchingTask | |||||
{ | { | ||||
if( src == null ) | if( src == null ) | ||||
{ | { | ||||
src = new Path( project ); | |||||
src = new Path( getProject() ); | |||||
} | } | ||||
return src.createPath(); | return src.createPath(); | ||||
} | } | ||||
@@ -870,7 +870,7 @@ public class Javac extends MatchingTask | |||||
private String determineCompiler() | private String determineCompiler() | ||||
{ | { | ||||
String compiler = project.getProperty( "build.compiler" ); | |||||
String compiler = getProject().getProperty( "build.compiler" ); | |||||
if( !"false".equals( fork ) ) | if( !"false".equals( fork ) ) | ||||
{ | { | ||||
@@ -576,7 +576,7 @@ public class Javadoc extends Task | |||||
{ | { | ||||
if( bootclasspath == null ) | if( bootclasspath == null ) | ||||
{ | { | ||||
bootclasspath = new Path( project ); | |||||
bootclasspath = new Path( getProject() ); | |||||
} | } | ||||
return bootclasspath.createPath(); | return bootclasspath.createPath(); | ||||
} | } | ||||
@@ -586,7 +586,7 @@ public class Javadoc extends Task | |||||
{ | { | ||||
if( classpath == null ) | if( classpath == null ) | ||||
{ | { | ||||
classpath = new Path( project ); | |||||
classpath = new Path( getProject() ); | |||||
} | } | ||||
return classpath.createPath(); | return classpath.createPath(); | ||||
} | } | ||||
@@ -616,7 +616,7 @@ public class Javadoc extends Task | |||||
{ | { | ||||
if( sourcePath == null ) | if( sourcePath == null ) | ||||
{ | { | ||||
sourcePath = new Path( project ); | |||||
sourcePath = new Path( getProject() ); | |||||
} | } | ||||
return sourcePath.createPath(); | return sourcePath.createPath(); | ||||
} | } | ||||
@@ -918,7 +918,7 @@ public class Javadoc extends Task | |||||
JavadocOutputStream out = new JavadocOutputStream( Project.MSG_INFO ); | JavadocOutputStream out = new JavadocOutputStream( Project.MSG_INFO ); | ||||
JavadocOutputStream err = new JavadocOutputStream( Project.MSG_WARN ); | JavadocOutputStream err = new JavadocOutputStream( Project.MSG_WARN ); | ||||
Execute exe = new Execute( new PumpStreamHandler( out, err ) ); | Execute exe = new Execute( new PumpStreamHandler( out, err ) ); | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
/* | /* | ||||
* No reason to change the working directory as all filenames and | * No reason to change the working directory as all filenames and | ||||
@@ -971,7 +971,7 @@ public class Javadoc extends Task | |||||
protected String expand( String content ) | protected String expand( String content ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
return project.replaceProperties( content ); | |||||
return getProject().replaceProperties( content ); | |||||
} | } | ||||
private String getJavadocExecutableName() | private String getJavadocExecutableName() | ||||
@@ -1130,7 +1130,7 @@ public class Javadoc extends Task | |||||
File source = resolveFile( list[ j ] ); | File source = resolveFile( list[ j ] ); | ||||
fs.setDir( source ); | fs.setDir( source ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] packageDirs = ds.getIncludedDirectories(); | String[] packageDirs = ds.getIncludedDirectories(); | ||||
for( int i = 0; i < packageDirs.length; i++ ) | for( int i = 0; i < packageDirs.length; i++ ) | ||||
@@ -157,7 +157,7 @@ public abstract class MatchingTask extends Task | |||||
{ | { | ||||
fileset.setDir( baseDir ); | fileset.setDir( baseDir ); | ||||
fileset.setDefaultexcludes( useDefaultExcludes ); | fileset.setDefaultexcludes( useDefaultExcludes ); | ||||
return fileset.getDirectoryScanner( project ); | |||||
return fileset.getDirectoryScanner( getProject() ); | |||||
} | } | ||||
} | } |
@@ -131,7 +131,7 @@ public class Property extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( project ); | |||||
this.classpath = new Path( getProject() ); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -195,7 +195,7 @@ public class Property extends Task | |||||
String name = (String)e.nextElement(); | String name = (String)e.nextElement(); | ||||
String value = (String)props.getProperty( name ); | String value = (String)props.getProperty( name ); | ||||
String v = project.replaceProperties( value ); | |||||
String v = getProject().replaceProperties( value ); | |||||
addProperty( name, v ); | addProperty( name, v ); | ||||
} | } | ||||
} | } | ||||
@@ -278,7 +278,7 @@ public class Property extends Task | |||||
if( classpath != null ) | if( classpath != null ) | ||||
{ | { | ||||
cL = new AntClassLoader( project, classpath ); | |||||
cL = new AntClassLoader( getProject(), classpath ); | |||||
} | } | ||||
else | else | ||||
{ | { | ||||
@@ -502,7 +502,7 @@ public class Rmic extends MatchingTask | |||||
{ | { | ||||
if( compileClasspath == null ) | if( compileClasspath == null ) | ||||
{ | { | ||||
compileClasspath = new Path( project ); | |||||
compileClasspath = new Path( getProject() ); | |||||
} | } | ||||
return compileClasspath.createPath(); | return compileClasspath.createPath(); | ||||
} | } | ||||
@@ -517,7 +517,7 @@ public class Rmic extends MatchingTask | |||||
{ | { | ||||
if( extdirs == null ) | if( extdirs == null ) | ||||
{ | { | ||||
extdirs = new Path( project ); | |||||
extdirs = new Path( getProject() ); | |||||
} | } | ||||
return extdirs.createPath(); | return extdirs.createPath(); | ||||
} | } | ||||
@@ -539,14 +539,14 @@ public class Rmic extends MatchingTask | |||||
log( "Verify has been turned on.", Project.MSG_INFO ); | log( "Verify has been turned on.", Project.MSG_INFO ); | ||||
} | } | ||||
String compiler = project.getProperty( "build.rmic" ); | |||||
String compiler = getProject().getProperty( "build.rmic" ); | |||||
RmicAdapter adapter = RmicAdapterFactory.getRmic( compiler, this ); | RmicAdapter adapter = RmicAdapterFactory.getRmic( compiler, this ); | ||||
// now we need to populate the compiler adapter | // now we need to populate the compiler adapter | ||||
adapter.setRmic( this ); | adapter.setRmic( this ); | ||||
Path classpath = adapter.getClasspath(); | Path classpath = adapter.getClasspath(); | ||||
loader = new AntClassLoader( project, classpath ); | |||||
loader = new AntClassLoader( getProject(), classpath ); | |||||
// scan base dirs to build up compile lists only if a | // scan base dirs to build up compile lists only if a | ||||
// specific classname is not given | // specific classname is not given | ||||
@@ -684,7 +684,7 @@ public class Rmic extends MatchingTask | |||||
{ | { | ||||
if( filtering ) | if( filtering ) | ||||
{ | { | ||||
final FilterSetCollection filters = new FilterSetCollection( project.getGlobalFilterSet() ); | |||||
final FilterSetCollection filters = new FilterSetCollection( getProject().getGlobalFilterSet() ); | |||||
FileUtils.copyFile( oldFile, newFile, filters ); | FileUtils.copyFile( oldFile, newFile, filters ); | ||||
} | } | ||||
else | else | ||||
@@ -370,7 +370,7 @@ public class SQLExec extends Task | |||||
{ | { | ||||
if( this.classpath == null ) | if( this.classpath == null ) | ||||
{ | { | ||||
this.classpath = new Path( project ); | |||||
this.classpath = new Path( getProject() ); | |||||
} | } | ||||
return this.classpath.createPath(); | return this.classpath.createPath(); | ||||
} | } | ||||
@@ -410,8 +410,8 @@ public class SQLExec extends Task | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
File srcDir = fs.getDir( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
File srcDir = fs.getDir( getProject() ); | |||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
@@ -459,7 +459,7 @@ public class SQLExec extends Task | |||||
log( "Loading " + driver + " using AntClassLoader with classpath " + classpath, | log( "Loading " + driver + " using AntClassLoader with classpath " + classpath, | ||||
Project.MSG_VERBOSE ); | Project.MSG_VERBOSE ); | ||||
loader = new AntClassLoader( project, classpath ); | |||||
loader = new AntClassLoader( getProject(), classpath ); | |||||
dc = loader.loadClass( driver ); | dc = loader.loadClass( driver ); | ||||
} | } | ||||
else | else | ||||
@@ -754,7 +754,7 @@ public class SQLExec extends Task | |||||
while( ( line = in.readLine() ) != null ) | while( ( line = in.readLine() ) != null ) | ||||
{ | { | ||||
line = line.trim(); | line = line.trim(); | ||||
line = project.replaceProperties( line ); | |||||
line = getProject().replaceProperties( line ); | |||||
if( line.startsWith( "//" ) ) | if( line.startsWith( "//" ) ) | ||||
continue; | continue; | ||||
if( line.startsWith( "--" ) ) | if( line.startsWith( "--" ) ) | ||||
@@ -155,11 +155,11 @@ public class SignJar extends Task | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String[] jarFiles = ds.getIncludedFiles(); | String[] jarFiles = ds.getIncludedFiles(); | ||||
for( int j = 0; j < jarFiles.length; j++ ) | for( int j = 0; j < jarFiles.length; j++ ) | ||||
{ | { | ||||
doOneJar( new File( fs.getDir( project ), jarFiles[ j ] ), null ); | |||||
doOneJar( new File( fs.getDir( getProject() ), jarFiles[ j ] ), null ); | |||||
} | } | ||||
} | } | ||||
} | } | ||||
@@ -249,7 +249,7 @@ public class SignJar extends Task | |||||
private void doOneJar( File jarSource, File jarTarget ) | private void doOneJar( File jarSource, File jarTarget ) | ||||
throws TaskException | throws TaskException | ||||
{ | { | ||||
if( project.getJavaVersion().equals( Project.JAVA_1_1 ) ) | |||||
if( getProject().getJavaVersion().equals( Project.JAVA_1_1 ) ) | |||||
{ | { | ||||
throw new TaskException( "The signjar task is only available on JDK versions 1.2 or greater" ); | throw new TaskException( "The signjar task is only available on JDK versions 1.2 or greater" ); | ||||
} | } | ||||
@@ -269,7 +269,7 @@ public class SignJar extends Task | |||||
final StringBuffer sb = new StringBuffer(); | final StringBuffer sb = new StringBuffer(); | ||||
final ExecTask cmd = (ExecTask)project.createTask( "exec" ); | |||||
final ExecTask cmd = (ExecTask)getProject().createTask( "exec" ); | |||||
cmd.setExecutable( "jarsigner" ); | cmd.setExecutable( "jarsigner" ); | ||||
if( null != keystore ) | if( null != keystore ) | ||||
@@ -145,7 +145,7 @@ public class Tar | |||||
for( Enumeration e = filesets.elements(); e.hasMoreElements(); ) | for( Enumeration e = filesets.elements(); e.hasMoreElements(); ) | ||||
{ | { | ||||
TarFileSet fs = (TarFileSet)e.nextElement(); | TarFileSet fs = (TarFileSet)e.nextElement(); | ||||
String[] files = fs.getFiles( project ); | |||||
String[] files = fs.getFiles( getProject() ); | |||||
if( !archiveIsUpToDate( files ) ) | if( !archiveIsUpToDate( files ) ) | ||||
{ | { | ||||
@@ -154,7 +154,7 @@ public class Tar | |||||
for( int i = 0; i < files.length; ++i ) | for( int i = 0; i < files.length; ++i ) | ||||
{ | { | ||||
if( tarFile.equals( new File( fs.getDir( project ), files[ i ] ) ) ) | |||||
if( tarFile.equals( new File( fs.getDir( getProject() ), files[ i ] ) ) ) | |||||
{ | { | ||||
throw new TaskException( "A tar file cannot include itself" ); | throw new TaskException( "A tar file cannot include itself" ); | ||||
} | } | ||||
@@ -194,10 +194,10 @@ public class Tar | |||||
for( Enumeration e = filesets.elements(); e.hasMoreElements(); ) | for( Enumeration e = filesets.elements(); e.hasMoreElements(); ) | ||||
{ | { | ||||
TarFileSet fs = (TarFileSet)e.nextElement(); | TarFileSet fs = (TarFileSet)e.nextElement(); | ||||
String[] files = fs.getFiles( project ); | |||||
String[] files = fs.getFiles( getProject() ); | |||||
for( int i = 0; i < files.length; i++ ) | for( int i = 0; i < files.length; i++ ) | ||||
{ | { | ||||
File f = new File( fs.getDir( project ), files[ i ] ); | |||||
File f = new File( fs.getDir( getProject() ), files[ i ] ); | |||||
String name = files[ i ].replace( File.separatorChar, '/' ); | String name = files[ i ].replace( File.separatorChar, '/' ); | ||||
tarFile( f, tOut, name, fs ); | tarFile( f, tOut, name, fs ); | ||||
} | } | ||||
@@ -148,7 +148,7 @@ public class Touch extends Task | |||||
} | } | ||||
} | } | ||||
if( millis >= 0 && project.getJavaVersion() == Project.JAVA_1_1 ) | |||||
if( millis >= 0 && getProject().getJavaVersion() == Project.JAVA_1_1 ) | |||||
{ | { | ||||
log( "modification time of files cannot be set in JDK 1.1", | log( "modification time of files cannot be set in JDK 1.1", | ||||
Project.MSG_WARN ); | Project.MSG_WARN ); | ||||
@@ -171,8 +171,8 @@ public class Touch extends Task | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
File fromDir = fs.getDir( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
File fromDir = fs.getDir( getProject() ); | |||||
String[] srcFiles = ds.getIncludedFiles(); | String[] srcFiles = ds.getIncludedFiles(); | ||||
String[] srcDirs = ds.getIncludedDirectories(); | String[] srcDirs = ds.getIncludedDirectories(); | ||||
@@ -202,7 +202,7 @@ public class Touch extends Task | |||||
throw new TaskException( "Can not change modification date of read-only file " + file ); | throw new TaskException( "Can not change modification date of read-only file " + file ); | ||||
} | } | ||||
if( project.getJavaVersion() == Project.JAVA_1_1 ) | |||||
if( getProject().getJavaVersion() == Project.JAVA_1_1 ) | |||||
{ | { | ||||
return; | return; | ||||
} | } | ||||
@@ -73,7 +73,7 @@ public class Tstamp extends Task | |||||
while( i.hasMoreElements() ) | while( i.hasMoreElements() ) | ||||
{ | { | ||||
CustomFormat cts = (CustomFormat)i.nextElement(); | CustomFormat cts = (CustomFormat)i.nextElement(); | ||||
cts.execute( project, d ); | |||||
cts.execute( getProject(), d ); | |||||
} | } | ||||
} | } | ||||
@@ -97,7 +97,7 @@ public class UpToDate extends MatchingTask implements Condition | |||||
{ | { | ||||
throw new TaskException( "Cannot define more than one mapper" ); | throw new TaskException( "Cannot define more than one mapper" ); | ||||
} | } | ||||
mapperElement = new Mapper( project ); | |||||
mapperElement = new Mapper( getProject() ); | |||||
return mapperElement; | return mapperElement; | ||||
} | } | ||||
@@ -128,8 +128,8 @@ public class UpToDate extends MatchingTask implements Condition | |||||
while( upToDate && enum.hasMoreElements() ) | while( upToDate && enum.hasMoreElements() ) | ||||
{ | { | ||||
FileSet fs = (FileSet)enum.nextElement(); | FileSet fs = (FileSet)enum.nextElement(); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
upToDate = upToDate && scanDir( fs.getDir( project ), | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
upToDate = upToDate && scanDir( fs.getDir( getProject() ), | |||||
ds.getIncludedFiles() ); | ds.getIncludedFiles() ); | ||||
} | } | ||||
return upToDate; | return upToDate; | ||||
@@ -266,7 +266,7 @@ public class Zip extends MatchingTask | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
dss.addElement( fs.getDirectoryScanner( project ) ); | |||||
dss.addElement( fs.getDirectoryScanner( getProject() ) ); | |||||
} | } | ||||
int dssSize = dss.size(); | int dssSize = dss.size(); | ||||
FileScanner[] scanners = new FileScanner[ dssSize ]; | FileScanner[] scanners = new FileScanner[ dssSize ]; | ||||
@@ -541,7 +541,7 @@ public class Zip extends MatchingTask | |||||
for( int i = 0; i < filesets.size(); i++ ) | for( int i = 0; i < filesets.size(); i++ ) | ||||
{ | { | ||||
FileSet fs = (FileSet)filesets.elementAt( i ); | FileSet fs = (FileSet)filesets.elementAt( i ); | ||||
DirectoryScanner ds = fs.getDirectoryScanner( project ); | |||||
DirectoryScanner ds = fs.getDirectoryScanner( getProject() ); | |||||
String prefix = ""; | String prefix = ""; | ||||
String fullpath = ""; | String fullpath = ""; | ||||
@@ -393,7 +393,7 @@ public class ExecTask extends Task | |||||
log( cmdl.toString(), Project.MSG_VERBOSE ); | log( cmdl.toString(), Project.MSG_VERBOSE ); | ||||
Execute exe = new Execute( createHandler(), createWatchdog() ); | Execute exe = new Execute( createHandler(), createWatchdog() ); | ||||
exe.setAntRun( project ); | |||||
exe.setAntRun( getProject() ); | |||||
exe.setWorkingDirectory( dir ); | exe.setWorkingDirectory( dir ); | ||||
exe.setVMLauncher( vmLauncher ); | exe.setVMLauncher( vmLauncher ); | ||||
String[] environment = env.getVariables(); | String[] environment = env.getVariables(); | ||||