setProperty() is inherited from AbstractTask and actually delegates to TaskContext to do the work. project.getBaseDir() -> getBaseDirectory() getBaseDirectory() is also inherited from AbstractTask and also delegates to TaskContext. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270212 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -181,7 +181,7 @@ public class Available | |||||
| String lSep = System.getProperty( "line.separator" ); | String lSep = System.getProperty( "line.separator" ); | ||||
| if( null == project.getProperty( property ) ) | if( null == project.getProperty( property ) ) | ||||
| { | { | ||||
| this.project.setProperty( property, value ); | |||||
| setProperty( property, value ); | |||||
| } | } | ||||
| //else ignore | //else ignore | ||||
| } | } | ||||
| @@ -288,7 +288,7 @@ public class Checksum extends MatchingTask implements Condition | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| project.setProperty( prop, checksum ); | |||||
| setProperty( prop, checksum ); | |||||
| } | } | ||||
| } | } | ||||
| else if( destination instanceof java.io.File ) | else if( destination instanceof java.io.File ) | ||||
| @@ -291,8 +291,7 @@ public class Cvs extends Task | |||||
| null ); | null ); | ||||
| exe.setAntRun( project ); | exe.setAntRun( project ); | ||||
| if( dest == null ) | |||||
| dest = project.getBaseDir(); | |||||
| if( dest == null ) dest = getBaseDirectory(); | |||||
| exe.setWorkingDirectory( dest ); | exe.setWorkingDirectory( dest ); | ||||
| exe.setCommandline( toExecute.getCommandline() ); | exe.setCommandline( toExecute.getCommandline() ); | ||||
| @@ -388,8 +388,7 @@ public class ExecTask extends Task | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| // default directory to the project's base directory | // default directory to the project's base directory | ||||
| if( dir == null ) | |||||
| dir = project.getBaseDir(); | |||||
| if( dir == null ) dir = getBaseDirectory(); | |||||
| // show the command | // show the command | ||||
| log( cmdl.toString(), Project.MSG_VERBOSE ); | log( cmdl.toString(), Project.MSG_VERBOSE ); | ||||
| @@ -145,7 +145,7 @@ public class Input extends Task | |||||
| { | { | ||||
| if( project.getProperty( addproperty ) == null ) | if( project.getProperty( addproperty ) == null ) | ||||
| { | { | ||||
| project.setProperty( addproperty, input ); | |||||
| setProperty( addproperty, input ); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -386,7 +386,7 @@ public class Java extends Task | |||||
| if( dir == null ) | if( dir == null ) | ||||
| { | { | ||||
| dir = project.getBaseDir(); | |||||
| dir = getBaseDirectory(); | |||||
| } | } | ||||
| else if( !dir.exists() || !dir.isDirectory() ) | else if( !dir.exists() || !dir.isDirectory() ) | ||||
| { | { | ||||
| @@ -39,7 +39,6 @@ public class Property extends Task | |||||
| protected Reference ref; | protected Reference ref; | ||||
| protected String resource; | protected String resource; | ||||
| protected boolean userProperty; | |||||
| protected String value;// set read-only properties | protected String value;// set read-only properties | ||||
| public Property() | public Property() | ||||
| @@ -47,11 +46,6 @@ public class Property extends Task | |||||
| super(); | super(); | ||||
| } | } | ||||
| protected Property( boolean userProperty ) | |||||
| { | |||||
| this.userProperty = userProperty; | |||||
| } | |||||
| public void setClasspath( Path classpath ) | public void setClasspath( Path classpath ) | ||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| @@ -207,21 +201,7 @@ public class Property extends Task | |||||
| protected void addProperty( String n, String v ) | protected void addProperty( String n, String v ) | ||||
| { | { | ||||
| if( userProperty ) | |||||
| { | |||||
| if( project.getUserProperty( n ) == null ) | |||||
| { | |||||
| project.setUserProperty( n, v ); | |||||
| } | |||||
| else | |||||
| { | |||||
| log( "Override ignored for " + n, Project.MSG_VERBOSE ); | |||||
| } | |||||
| } | |||||
| else | |||||
| { | |||||
| project.setNewProperty( n, v ); | project.setNewProperty( n, v ); | ||||
| } | |||||
| } | } | ||||
| protected void loadEnvironment( String prefix ) | protected void loadEnvironment( String prefix ) | ||||
| @@ -147,7 +147,7 @@ public class UpToDate extends MatchingTask implements Condition | |||||
| boolean upToDate = eval(); | boolean upToDate = eval(); | ||||
| if( upToDate ) | if( upToDate ) | ||||
| { | { | ||||
| this.project.setProperty( _property, this.getValue() ); | |||||
| setProperty( _property, this.getValue() ); | |||||
| if( mapperElement == null ) | if( mapperElement == null ) | ||||
| { | { | ||||
| log( "File \"" + _targetFile.getAbsolutePath() + "\" is up to date.", | log( "File \"" + _targetFile.getAbsolutePath() + "\" is up to date.", | ||||
| @@ -39,8 +39,9 @@ import org.apache.tools.ant.util.FileUtils; | |||||
| * @author <a href="mailto:russgold@acm.org">Russell Gold</a> | * @author <a href="mailto:russgold@acm.org">Russell Gold</a> | ||||
| * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a> | * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a> | ||||
| */ | */ | ||||
| public class XSLTProcess extends MatchingTask implements XSLTLogger | |||||
| public class XSLTProcess | |||||
| extends MatchingTask | |||||
| implements XSLTLogger | |||||
| { | { | ||||
| private File destDir = null; | private File destDir = null; | ||||
| @@ -67,6 +68,11 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger | |||||
| private String processor; | private String processor; | ||||
| public void log( String msg ) | |||||
| { | |||||
| getLogger().info( msg ); | |||||
| } | |||||
| /** | /** | ||||
| * Creates a new XSLTProcess Task. | * Creates a new XSLTProcess Task. | ||||
| */ | */ | ||||
| @@ -229,7 +235,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger | |||||
| if( baseDir == null ) | if( baseDir == null ) | ||||
| { | { | ||||
| baseDir = resolveFile( "." ); | |||||
| baseDir = getBaseDirectory(); | |||||
| } | } | ||||
| liaison = getLiaison(); | liaison = getLiaison(); | ||||
| @@ -117,7 +117,7 @@ public class Native2Ascii extends MatchingTask | |||||
| // default srcDir to basedir | // default srcDir to basedir | ||||
| if( srcDir == null ) | if( srcDir == null ) | ||||
| { | { | ||||
| srcDir = resolveFile( "." ); | |||||
| srcDir = getBaseDirectory(); | |||||
| } | } | ||||
| // Require destDir | // Require destDir | ||||
| @@ -190,8 +190,7 @@ public class Rpm extends Task | |||||
| Execute exe = new Execute( streamhandler, null ); | Execute exe = new Execute( streamhandler, null ); | ||||
| exe.setAntRun( project ); | exe.setAntRun( project ); | ||||
| if( topDir == null ) | |||||
| topDir = project.getBaseDir(); | |||||
| if( topDir == null ) topDir = getBaseDirectory(); | |||||
| exe.setWorkingDirectory( topDir ); | exe.setWorkingDirectory( topDir ); | ||||
| exe.setCommandline( toExecute.getCommandline() ); | exe.setCommandline( toExecute.getCommandline() ); | ||||
| @@ -87,7 +87,6 @@ public class Script extends Task | |||||
| try | try | ||||
| { | { | ||||
| addBeans( project.getProperties() ); | addBeans( project.getProperties() ); | ||||
| addBeans( project.getUserProperties() ); | |||||
| addBeans( project.getTargets() ); | addBeans( project.getTargets() ); | ||||
| addBeans( project.getReferences() ); | addBeans( project.getReferences() ); | ||||
| @@ -113,7 +113,7 @@ public abstract class Continuus extends Task | |||||
| { | { | ||||
| Execute exe = new Execute( handler ); | Execute exe = new Execute( handler ); | ||||
| exe.setAntRun( getProject() ); | exe.setAntRun( getProject() ); | ||||
| exe.setWorkingDirectory( getProject().getBaseDir() ); | |||||
| exe.setWorkingDirectory( getBaseDirectory() ); | |||||
| exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
| return exe.execute(); | return exe.execute(); | ||||
| } | } | ||||
| @@ -331,7 +331,7 @@ public class CCCheckin extends ClearCase | |||||
| // Default the viewpath to basedir if it is not specified | // Default the viewpath to basedir if it is not specified | ||||
| if( getViewPath() == null ) | if( getViewPath() == null ) | ||||
| { | { | ||||
| setViewPath( aProj.getBaseDir().getPath() ); | |||||
| setViewPath( getBaseDirectory().getPath() ); | |||||
| } | } | ||||
| // build the command line from what we got. the format is | // build the command line from what we got. the format is | ||||
| @@ -419,7 +419,7 @@ public class CCCheckout extends ClearCase | |||||
| // Default the viewpath to basedir if it is not specified | // Default the viewpath to basedir if it is not specified | ||||
| if( getViewPath() == null ) | if( getViewPath() == null ) | ||||
| { | { | ||||
| setViewPath( aProj.getBaseDir().getPath() ); | |||||
| setViewPath( getBaseDirectory().getPath() ); | |||||
| } | } | ||||
| // build the command line from what we got the format is | // build the command line from what we got the format is | ||||
| @@ -123,7 +123,7 @@ public class CCUnCheckout extends ClearCase | |||||
| // Default the viewpath to basedir if it is not specified | // Default the viewpath to basedir if it is not specified | ||||
| if( getViewPath() == null ) | if( getViewPath() == null ) | ||||
| { | { | ||||
| setViewPath( aProj.getBaseDir().getPath() ); | |||||
| setViewPath( getBaseDirectory().getPath() ); | |||||
| } | } | ||||
| // build the command line from what we got the format is | // build the command line from what we got the format is | ||||
| @@ -332,7 +332,7 @@ public class CCUpdate extends ClearCase | |||||
| // Default the viewpath to basedir if it is not specified | // Default the viewpath to basedir if it is not specified | ||||
| if( getViewPath() == null ) | if( getViewPath() == null ) | ||||
| { | { | ||||
| setViewPath( aProj.getBaseDir().getPath() ); | |||||
| setViewPath( getBaseDirectory().getPath() ); | |||||
| } | } | ||||
| // build the command line from what we got the format is | // build the command line from what we got the format is | ||||
| @@ -111,7 +111,7 @@ public abstract class ClearCase extends Task | |||||
| Project aProj = getProject(); | Project aProj = getProject(); | ||||
| Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); | Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); | ||||
| exe.setAntRun( aProj ); | exe.setAntRun( aProj ); | ||||
| exe.setWorkingDirectory( aProj.getBaseDir() ); | |||||
| exe.setWorkingDirectory( getBaseDirectory() ); | |||||
| exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
| return exe.execute(); | return exe.execute(); | ||||
| } | } | ||||
| @@ -649,8 +649,7 @@ public class CSharp | |||||
| public void execute() | public void execute() | ||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| if( _srcDir == null ) | |||||
| _srcDir = resolveFile( "." ); | |||||
| if( _srcDir == null ) _srcDir = getBaseDirectory(); | |||||
| NetCommand command = new NetCommand( this, "CSC", csc_exe_name ); | NetCommand command = new NetCommand( this, "CSC", csc_exe_name ); | ||||
| command.setFailOnError( getFailFailOnError() ); | command.setFailOnError( getFailFailOnError() ); | ||||
| @@ -306,8 +306,7 @@ public class Ilasm | |||||
| public void execute() | public void execute() | ||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| if( _srcDir == null ) | |||||
| _srcDir = resolveFile( "." ); | |||||
| if( _srcDir == null ) _srcDir = getBaseDirectory(); | |||||
| //get dependencies list. | //get dependencies list. | ||||
| DirectoryScanner scanner = super.getDirectoryScanner( _srcDir ); | DirectoryScanner scanner = super.getDirectoryScanner( _srcDir ); | ||||
| @@ -200,7 +200,7 @@ public class NetCommand | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| // default directory to the project's base directory | // default directory to the project's base directory | ||||
| File dir = _owner.getProject().getBaseDir(); | |||||
| File dir = _owner.getBaseDirectory(); | |||||
| ExecuteStreamHandler handler = new LogStreamHandler( _owner, | ExecuteStreamHandler handler = new LogStreamHandler( _owner, | ||||
| Project.MSG_INFO, Project.MSG_WARN ); | Project.MSG_INFO, Project.MSG_WARN ); | ||||
| _exe = new Execute( handler, null ); | _exe = new Execute( handler, null ); | ||||
| @@ -416,8 +416,9 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exec | |||||
| */ | */ | ||||
| private void generateClient( File sourceJar ) | private void generateClient( File sourceJar ) | ||||
| { | { | ||||
| getTask().getProject().addTaskDefinition( "internal_bas_generateclient", | |||||
| org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient.class ); | |||||
| //UGLY HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |||||
| //getTask().getProject().addTaskDefinition( "internal_bas_generateclient", | |||||
| //org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient.class ); | |||||
| org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient gentask = null; | org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient gentask = null; | ||||
| log( "generate client for " + sourceJar, Project.MSG_INFO ); | log( "generate client for " + sourceJar, Project.MSG_INFO ); | ||||
| @@ -215,12 +215,12 @@ public class AggregateTransformer | |||||
| // set the destination directory relative from the project if needed. | // set the destination directory relative from the project if needed. | ||||
| if( toDir == null ) | if( toDir == null ) | ||||
| { | { | ||||
| toDir = FileUtils.newFileUtils().resolveFile( task.getProject().getBaseDir(), "." ); | |||||
| toDir = FileUtils.newFileUtils().resolveFile( task.getBaseDirectory(), "." ); | |||||
| } | } | ||||
| else if( !toDir.isAbsolute() ) | else if( !toDir.isAbsolute() ) | ||||
| { | { | ||||
| toDir = FileUtils.newFileUtils(). | toDir = FileUtils.newFileUtils(). | ||||
| resolveFile( task.getProject().getBaseDir(), toDir.getPath() ); | |||||
| resolveFile( task.getBaseDirectory(), toDir.getPath() ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -524,7 +524,7 @@ public class JUnitTask extends Task | |||||
| //@todo should be moved to the test class instead. | //@todo should be moved to the test class instead. | ||||
| if( test.getTodir() == null ) | if( test.getTodir() == null ) | ||||
| { | { | ||||
| test.setTodir( resolveFile( "." ) ); | |||||
| test.setTodir( getBaseDirectory() ); | |||||
| } | } | ||||
| if( test.getOutfile() == null ) | if( test.getOutfile() == null ) | ||||
| @@ -568,11 +568,11 @@ public class JUnitTask extends Task | |||||
| + ( wasKilled ? " (timeout)" : "" ), Project.MSG_ERR ); | + ( wasKilled ? " (timeout)" : "" ), Project.MSG_ERR ); | ||||
| if( errorOccurredHere && test.getErrorProperty() != null ) | if( errorOccurredHere && test.getErrorProperty() != null ) | ||||
| { | { | ||||
| project.setProperty( test.getErrorProperty(), "true" ); | |||||
| setProperty( test.getErrorProperty(), "true" ); | |||||
| } | } | ||||
| if( failureOccurredHere && test.getFailureProperty() != null ) | if( failureOccurredHere && test.getFailureProperty() != null ) | ||||
| { | { | ||||
| project.setProperty( test.getFailureProperty(), "true" ); | |||||
| setProperty( test.getFailureProperty(), "true" ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -96,7 +96,7 @@ public class P4Change extends P4Base | |||||
| int changenumber = Integer.parseInt( line ); | int changenumber = Integer.parseInt( line ); | ||||
| log( "Change Number is " + changenumber, Project.MSG_INFO ); | log( "Change Number is " + changenumber, Project.MSG_INFO ); | ||||
| myProj.setProperty( "p4.change", "" + changenumber ); | |||||
| setProperty( "p4.change", "" + changenumber ); | |||||
| } | } | ||||
| else if( util.match( "/error/", line ) ) | else if( util.match( "/error/", line ) ) | ||||
| @@ -87,7 +87,7 @@ public class P4Counter extends P4Base | |||||
| try | try | ||||
| { | { | ||||
| value = Integer.parseInt( line ); | value = Integer.parseInt( line ); | ||||
| myProj.setProperty( property, "" + value ); | |||||
| setProperty( property, "" + value ); | |||||
| } | } | ||||
| catch( NumberFormatException nfe ) | catch( NumberFormatException nfe ) | ||||
| { | { | ||||
| @@ -453,7 +453,7 @@ public class Pvcs extends org.apache.tools.ant.Task | |||||
| Project aProj = getProject(); | Project aProj = getProject(); | ||||
| Execute exe = new Execute( out ); | Execute exe = new Execute( out ); | ||||
| exe.setAntRun( aProj ); | exe.setAntRun( aProj ); | ||||
| exe.setWorkingDirectory( aProj.getBaseDir() ); | |||||
| exe.setWorkingDirectory( getBaseDirectory() ); | |||||
| exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
| return exe.execute(); | return exe.execute(); | ||||
| } | } | ||||
| @@ -291,7 +291,7 @@ public class CovReport extends Task | |||||
| if( sourcePath == null ) | if( sourcePath == null ) | ||||
| { | { | ||||
| sourcePath = new Path( project ); | sourcePath = new Path( project ); | ||||
| sourcePath.createPath().setLocation( resolveFile( "." ) ); | |||||
| sourcePath.createPath().setLocation( getBaseDirectory() ); | |||||
| } | } | ||||
| v.addElement( "-sourcepath=" + sourcePath ); | v.addElement( "-sourcepath=" + sourcePath ); | ||||
| @@ -228,7 +228,7 @@ public abstract class MSVSS extends Task | |||||
| } | } | ||||
| exe.setAntRun( project ); | exe.setAntRun( project ); | ||||
| exe.setWorkingDirectory( project.getBaseDir() ); | |||||
| exe.setWorkingDirectory( getBaseDirectory() ); | |||||
| exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
| return exe.execute(); | return exe.execute(); | ||||
| } | } | ||||
| @@ -181,7 +181,7 @@ public class Available | |||||
| String lSep = System.getProperty( "line.separator" ); | String lSep = System.getProperty( "line.separator" ); | ||||
| if( null == project.getProperty( property ) ) | if( null == project.getProperty( property ) ) | ||||
| { | { | ||||
| this.project.setProperty( property, value ); | |||||
| setProperty( property, value ); | |||||
| } | } | ||||
| //else ignore | //else ignore | ||||
| } | } | ||||
| @@ -288,7 +288,7 @@ public class Checksum extends MatchingTask implements Condition | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| project.setProperty( prop, checksum ); | |||||
| setProperty( prop, checksum ); | |||||
| } | } | ||||
| } | } | ||||
| else if( destination instanceof java.io.File ) | else if( destination instanceof java.io.File ) | ||||
| @@ -291,8 +291,7 @@ public class Cvs extends Task | |||||
| null ); | null ); | ||||
| exe.setAntRun( project ); | exe.setAntRun( project ); | ||||
| if( dest == null ) | |||||
| dest = project.getBaseDir(); | |||||
| if( dest == null ) dest = getBaseDirectory(); | |||||
| exe.setWorkingDirectory( dest ); | exe.setWorkingDirectory( dest ); | ||||
| exe.setCommandline( toExecute.getCommandline() ); | exe.setCommandline( toExecute.getCommandline() ); | ||||
| @@ -388,8 +388,7 @@ public class ExecTask extends Task | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| // default directory to the project's base directory | // default directory to the project's base directory | ||||
| if( dir == null ) | |||||
| dir = project.getBaseDir(); | |||||
| if( dir == null ) dir = getBaseDirectory(); | |||||
| // show the command | // show the command | ||||
| log( cmdl.toString(), Project.MSG_VERBOSE ); | log( cmdl.toString(), Project.MSG_VERBOSE ); | ||||
| @@ -145,7 +145,7 @@ public class Input extends Task | |||||
| { | { | ||||
| if( project.getProperty( addproperty ) == null ) | if( project.getProperty( addproperty ) == null ) | ||||
| { | { | ||||
| project.setProperty( addproperty, input ); | |||||
| setProperty( addproperty, input ); | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| @@ -386,7 +386,7 @@ public class Java extends Task | |||||
| if( dir == null ) | if( dir == null ) | ||||
| { | { | ||||
| dir = project.getBaseDir(); | |||||
| dir = getBaseDirectory(); | |||||
| } | } | ||||
| else if( !dir.exists() || !dir.isDirectory() ) | else if( !dir.exists() || !dir.isDirectory() ) | ||||
| { | { | ||||
| @@ -39,7 +39,6 @@ public class Property extends Task | |||||
| protected Reference ref; | protected Reference ref; | ||||
| protected String resource; | protected String resource; | ||||
| protected boolean userProperty; | |||||
| protected String value;// set read-only properties | protected String value;// set read-only properties | ||||
| public Property() | public Property() | ||||
| @@ -47,11 +46,6 @@ public class Property extends Task | |||||
| super(); | super(); | ||||
| } | } | ||||
| protected Property( boolean userProperty ) | |||||
| { | |||||
| this.userProperty = userProperty; | |||||
| } | |||||
| public void setClasspath( Path classpath ) | public void setClasspath( Path classpath ) | ||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| @@ -207,21 +201,7 @@ public class Property extends Task | |||||
| protected void addProperty( String n, String v ) | protected void addProperty( String n, String v ) | ||||
| { | { | ||||
| if( userProperty ) | |||||
| { | |||||
| if( project.getUserProperty( n ) == null ) | |||||
| { | |||||
| project.setUserProperty( n, v ); | |||||
| } | |||||
| else | |||||
| { | |||||
| log( "Override ignored for " + n, Project.MSG_VERBOSE ); | |||||
| } | |||||
| } | |||||
| else | |||||
| { | |||||
| project.setNewProperty( n, v ); | project.setNewProperty( n, v ); | ||||
| } | |||||
| } | } | ||||
| protected void loadEnvironment( String prefix ) | protected void loadEnvironment( String prefix ) | ||||
| @@ -147,7 +147,7 @@ public class UpToDate extends MatchingTask implements Condition | |||||
| boolean upToDate = eval(); | boolean upToDate = eval(); | ||||
| if( upToDate ) | if( upToDate ) | ||||
| { | { | ||||
| this.project.setProperty( _property, this.getValue() ); | |||||
| setProperty( _property, this.getValue() ); | |||||
| if( mapperElement == null ) | if( mapperElement == null ) | ||||
| { | { | ||||
| log( "File \"" + _targetFile.getAbsolutePath() + "\" is up to date.", | log( "File \"" + _targetFile.getAbsolutePath() + "\" is up to date.", | ||||
| @@ -39,8 +39,9 @@ import org.apache.tools.ant.util.FileUtils; | |||||
| * @author <a href="mailto:russgold@acm.org">Russell Gold</a> | * @author <a href="mailto:russgold@acm.org">Russell Gold</a> | ||||
| * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a> | * @author <a href="stefan.bodewig@epost.de">Stefan Bodewig</a> | ||||
| */ | */ | ||||
| public class XSLTProcess extends MatchingTask implements XSLTLogger | |||||
| public class XSLTProcess | |||||
| extends MatchingTask | |||||
| implements XSLTLogger | |||||
| { | { | ||||
| private File destDir = null; | private File destDir = null; | ||||
| @@ -67,6 +68,11 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger | |||||
| private String processor; | private String processor; | ||||
| public void log( String msg ) | |||||
| { | |||||
| getLogger().info( msg ); | |||||
| } | |||||
| /** | /** | ||||
| * Creates a new XSLTProcess Task. | * Creates a new XSLTProcess Task. | ||||
| */ | */ | ||||
| @@ -229,7 +235,7 @@ public class XSLTProcess extends MatchingTask implements XSLTLogger | |||||
| if( baseDir == null ) | if( baseDir == null ) | ||||
| { | { | ||||
| baseDir = resolveFile( "." ); | |||||
| baseDir = getBaseDirectory(); | |||||
| } | } | ||||
| liaison = getLiaison(); | liaison = getLiaison(); | ||||
| @@ -117,7 +117,7 @@ public class Native2Ascii extends MatchingTask | |||||
| // default srcDir to basedir | // default srcDir to basedir | ||||
| if( srcDir == null ) | if( srcDir == null ) | ||||
| { | { | ||||
| srcDir = resolveFile( "." ); | |||||
| srcDir = getBaseDirectory(); | |||||
| } | } | ||||
| // Require destDir | // Require destDir | ||||
| @@ -190,8 +190,7 @@ public class Rpm extends Task | |||||
| Execute exe = new Execute( streamhandler, null ); | Execute exe = new Execute( streamhandler, null ); | ||||
| exe.setAntRun( project ); | exe.setAntRun( project ); | ||||
| if( topDir == null ) | |||||
| topDir = project.getBaseDir(); | |||||
| if( topDir == null ) topDir = getBaseDirectory(); | |||||
| exe.setWorkingDirectory( topDir ); | exe.setWorkingDirectory( topDir ); | ||||
| exe.setCommandline( toExecute.getCommandline() ); | exe.setCommandline( toExecute.getCommandline() ); | ||||
| @@ -87,7 +87,6 @@ public class Script extends Task | |||||
| try | try | ||||
| { | { | ||||
| addBeans( project.getProperties() ); | addBeans( project.getProperties() ); | ||||
| addBeans( project.getUserProperties() ); | |||||
| addBeans( project.getTargets() ); | addBeans( project.getTargets() ); | ||||
| addBeans( project.getReferences() ); | addBeans( project.getReferences() ); | ||||
| @@ -113,7 +113,7 @@ public abstract class Continuus extends Task | |||||
| { | { | ||||
| Execute exe = new Execute( handler ); | Execute exe = new Execute( handler ); | ||||
| exe.setAntRun( getProject() ); | exe.setAntRun( getProject() ); | ||||
| exe.setWorkingDirectory( getProject().getBaseDir() ); | |||||
| exe.setWorkingDirectory( getBaseDirectory() ); | |||||
| exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
| return exe.execute(); | return exe.execute(); | ||||
| } | } | ||||
| @@ -331,7 +331,7 @@ public class CCCheckin extends ClearCase | |||||
| // Default the viewpath to basedir if it is not specified | // Default the viewpath to basedir if it is not specified | ||||
| if( getViewPath() == null ) | if( getViewPath() == null ) | ||||
| { | { | ||||
| setViewPath( aProj.getBaseDir().getPath() ); | |||||
| setViewPath( getBaseDirectory().getPath() ); | |||||
| } | } | ||||
| // build the command line from what we got. the format is | // build the command line from what we got. the format is | ||||
| @@ -419,7 +419,7 @@ public class CCCheckout extends ClearCase | |||||
| // Default the viewpath to basedir if it is not specified | // Default the viewpath to basedir if it is not specified | ||||
| if( getViewPath() == null ) | if( getViewPath() == null ) | ||||
| { | { | ||||
| setViewPath( aProj.getBaseDir().getPath() ); | |||||
| setViewPath( getBaseDirectory().getPath() ); | |||||
| } | } | ||||
| // build the command line from what we got the format is | // build the command line from what we got the format is | ||||
| @@ -123,7 +123,7 @@ public class CCUnCheckout extends ClearCase | |||||
| // Default the viewpath to basedir if it is not specified | // Default the viewpath to basedir if it is not specified | ||||
| if( getViewPath() == null ) | if( getViewPath() == null ) | ||||
| { | { | ||||
| setViewPath( aProj.getBaseDir().getPath() ); | |||||
| setViewPath( getBaseDirectory().getPath() ); | |||||
| } | } | ||||
| // build the command line from what we got the format is | // build the command line from what we got the format is | ||||
| @@ -332,7 +332,7 @@ public class CCUpdate extends ClearCase | |||||
| // Default the viewpath to basedir if it is not specified | // Default the viewpath to basedir if it is not specified | ||||
| if( getViewPath() == null ) | if( getViewPath() == null ) | ||||
| { | { | ||||
| setViewPath( aProj.getBaseDir().getPath() ); | |||||
| setViewPath( getBaseDirectory().getPath() ); | |||||
| } | } | ||||
| // build the command line from what we got the format is | // build the command line from what we got the format is | ||||
| @@ -111,7 +111,7 @@ public abstract class ClearCase extends Task | |||||
| Project aProj = getProject(); | Project aProj = getProject(); | ||||
| Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); | Execute exe = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); | ||||
| exe.setAntRun( aProj ); | exe.setAntRun( aProj ); | ||||
| exe.setWorkingDirectory( aProj.getBaseDir() ); | |||||
| exe.setWorkingDirectory( getBaseDirectory() ); | |||||
| exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
| return exe.execute(); | return exe.execute(); | ||||
| } | } | ||||
| @@ -649,8 +649,7 @@ public class CSharp | |||||
| public void execute() | public void execute() | ||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| if( _srcDir == null ) | |||||
| _srcDir = resolveFile( "." ); | |||||
| if( _srcDir == null ) _srcDir = getBaseDirectory(); | |||||
| NetCommand command = new NetCommand( this, "CSC", csc_exe_name ); | NetCommand command = new NetCommand( this, "CSC", csc_exe_name ); | ||||
| command.setFailOnError( getFailFailOnError() ); | command.setFailOnError( getFailFailOnError() ); | ||||
| @@ -306,8 +306,7 @@ public class Ilasm | |||||
| public void execute() | public void execute() | ||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| if( _srcDir == null ) | |||||
| _srcDir = resolveFile( "." ); | |||||
| if( _srcDir == null ) _srcDir = getBaseDirectory(); | |||||
| //get dependencies list. | //get dependencies list. | ||||
| DirectoryScanner scanner = super.getDirectoryScanner( _srcDir ); | DirectoryScanner scanner = super.getDirectoryScanner( _srcDir ); | ||||
| @@ -200,7 +200,7 @@ public class NetCommand | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| // default directory to the project's base directory | // default directory to the project's base directory | ||||
| File dir = _owner.getProject().getBaseDir(); | |||||
| File dir = _owner.getBaseDirectory(); | |||||
| ExecuteStreamHandler handler = new LogStreamHandler( _owner, | ExecuteStreamHandler handler = new LogStreamHandler( _owner, | ||||
| Project.MSG_INFO, Project.MSG_WARN ); | Project.MSG_INFO, Project.MSG_WARN ); | ||||
| _exe = new Execute( handler, null ); | _exe = new Execute( handler, null ); | ||||
| @@ -416,8 +416,9 @@ public class BorlandDeploymentTool extends GenericDeploymentTool implements Exec | |||||
| */ | */ | ||||
| private void generateClient( File sourceJar ) | private void generateClient( File sourceJar ) | ||||
| { | { | ||||
| getTask().getProject().addTaskDefinition( "internal_bas_generateclient", | |||||
| org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient.class ); | |||||
| //UGLY HACK!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |||||
| //getTask().getProject().addTaskDefinition( "internal_bas_generateclient", | |||||
| //org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient.class ); | |||||
| org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient gentask = null; | org.apache.tools.ant.taskdefs.optional.ejb.BorlandGenerateClient gentask = null; | ||||
| log( "generate client for " + sourceJar, Project.MSG_INFO ); | log( "generate client for " + sourceJar, Project.MSG_INFO ); | ||||
| @@ -215,12 +215,12 @@ public class AggregateTransformer | |||||
| // set the destination directory relative from the project if needed. | // set the destination directory relative from the project if needed. | ||||
| if( toDir == null ) | if( toDir == null ) | ||||
| { | { | ||||
| toDir = FileUtils.newFileUtils().resolveFile( task.getProject().getBaseDir(), "." ); | |||||
| toDir = FileUtils.newFileUtils().resolveFile( task.getBaseDirectory(), "." ); | |||||
| } | } | ||||
| else if( !toDir.isAbsolute() ) | else if( !toDir.isAbsolute() ) | ||||
| { | { | ||||
| toDir = FileUtils.newFileUtils(). | toDir = FileUtils.newFileUtils(). | ||||
| resolveFile( task.getProject().getBaseDir(), toDir.getPath() ); | |||||
| resolveFile( task.getBaseDirectory(), toDir.getPath() ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -524,7 +524,7 @@ public class JUnitTask extends Task | |||||
| //@todo should be moved to the test class instead. | //@todo should be moved to the test class instead. | ||||
| if( test.getTodir() == null ) | if( test.getTodir() == null ) | ||||
| { | { | ||||
| test.setTodir( resolveFile( "." ) ); | |||||
| test.setTodir( getBaseDirectory() ); | |||||
| } | } | ||||
| if( test.getOutfile() == null ) | if( test.getOutfile() == null ) | ||||
| @@ -568,11 +568,11 @@ public class JUnitTask extends Task | |||||
| + ( wasKilled ? " (timeout)" : "" ), Project.MSG_ERR ); | + ( wasKilled ? " (timeout)" : "" ), Project.MSG_ERR ); | ||||
| if( errorOccurredHere && test.getErrorProperty() != null ) | if( errorOccurredHere && test.getErrorProperty() != null ) | ||||
| { | { | ||||
| project.setProperty( test.getErrorProperty(), "true" ); | |||||
| setProperty( test.getErrorProperty(), "true" ); | |||||
| } | } | ||||
| if( failureOccurredHere && test.getFailureProperty() != null ) | if( failureOccurredHere && test.getFailureProperty() != null ) | ||||
| { | { | ||||
| project.setProperty( test.getFailureProperty(), "true" ); | |||||
| setProperty( test.getFailureProperty(), "true" ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -96,7 +96,7 @@ public class P4Change extends P4Base | |||||
| int changenumber = Integer.parseInt( line ); | int changenumber = Integer.parseInt( line ); | ||||
| log( "Change Number is " + changenumber, Project.MSG_INFO ); | log( "Change Number is " + changenumber, Project.MSG_INFO ); | ||||
| myProj.setProperty( "p4.change", "" + changenumber ); | |||||
| setProperty( "p4.change", "" + changenumber ); | |||||
| } | } | ||||
| else if( util.match( "/error/", line ) ) | else if( util.match( "/error/", line ) ) | ||||
| @@ -87,7 +87,7 @@ public class P4Counter extends P4Base | |||||
| try | try | ||||
| { | { | ||||
| value = Integer.parseInt( line ); | value = Integer.parseInt( line ); | ||||
| myProj.setProperty( property, "" + value ); | |||||
| setProperty( property, "" + value ); | |||||
| } | } | ||||
| catch( NumberFormatException nfe ) | catch( NumberFormatException nfe ) | ||||
| { | { | ||||
| @@ -453,7 +453,7 @@ public class Pvcs extends org.apache.tools.ant.Task | |||||
| Project aProj = getProject(); | Project aProj = getProject(); | ||||
| Execute exe = new Execute( out ); | Execute exe = new Execute( out ); | ||||
| exe.setAntRun( aProj ); | exe.setAntRun( aProj ); | ||||
| exe.setWorkingDirectory( aProj.getBaseDir() ); | |||||
| exe.setWorkingDirectory( getBaseDirectory() ); | |||||
| exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
| return exe.execute(); | return exe.execute(); | ||||
| } | } | ||||
| @@ -291,7 +291,7 @@ public class CovReport extends Task | |||||
| if( sourcePath == null ) | if( sourcePath == null ) | ||||
| { | { | ||||
| sourcePath = new Path( project ); | sourcePath = new Path( project ); | ||||
| sourcePath.createPath().setLocation( resolveFile( "." ) ); | |||||
| sourcePath.createPath().setLocation( getBaseDirectory() ); | |||||
| } | } | ||||
| v.addElement( "-sourcepath=" + sourcePath ); | v.addElement( "-sourcepath=" + sourcePath ); | ||||
| @@ -228,7 +228,7 @@ public abstract class MSVSS extends Task | |||||
| } | } | ||||
| exe.setAntRun( project ); | exe.setAntRun( project ); | ||||
| exe.setWorkingDirectory( project.getBaseDir() ); | |||||
| exe.setWorkingDirectory( getBaseDirectory() ); | |||||
| exe.setCommandline( cmd.getCommandline() ); | exe.setCommandline( cmd.getCommandline() ); | ||||
| return exe.execute(); | return exe.execute(); | ||||
| } | } | ||||