which inherited from AbstractTask and delegates to TaskContext. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270217 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -188,8 +188,7 @@ public class Checksum extends MatchingTask implements Condition | |||||
| boolean value = validateAndExecute(); | boolean value = validateAndExecute(); | ||||
| if( verifyProperty != null ) | if( verifyProperty != null ) | ||||
| { | { | ||||
| project.setNewProperty( verifyProperty, | |||||
| new Boolean( value ).toString() ); | |||||
| setProperty( verifyProperty, new Boolean( value ).toString() ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -71,7 +71,7 @@ public class ConditionTask extends ConditionBase | |||||
| Condition c = (Condition)getConditions().nextElement(); | Condition c = (Condition)getConditions().nextElement(); | ||||
| if( c.eval() ) | if( c.eval() ) | ||||
| { | { | ||||
| getProject().setNewProperty( property, value ); | |||||
| setProperty( property, value ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -267,7 +267,7 @@ public class ExecTask extends Task | |||||
| } | } | ||||
| val.append( line ); | val.append( line ); | ||||
| } | } | ||||
| project.setNewProperty( outputprop, val.toString() ); | |||||
| setProperty( outputprop, val.toString() ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -370,11 +370,12 @@ public class ExecTask extends Task | |||||
| * @param result Description of Parameter | * @param result Description of Parameter | ||||
| */ | */ | ||||
| protected void maybeSetResultPropertyValue( int result ) | protected void maybeSetResultPropertyValue( int result ) | ||||
| throws TaskException | |||||
| { | { | ||||
| String res = Integer.toString( result ); | String res = Integer.toString( result ); | ||||
| if( resultProperty != null ) | if( resultProperty != null ) | ||||
| { | { | ||||
| project.setNewProperty( resultProperty, res ); | |||||
| setProperty( resultProperty, res ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1028,9 +1028,7 @@ public class Javadoc extends Task | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| project.log( this, | |||||
| "Warning: Leaving out empty argument '" + key + "'", | |||||
| Project.MSG_WARN ); | |||||
| log( "Warning: Leaving out empty argument '" + key + "'", Project.MSG_WARN ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -226,7 +226,7 @@ public class PathConvert extends Task | |||||
| log( "Set property " + property + " = " + value, Project.MSG_VERBOSE ); | log( "Set property " + property + " = " + value, Project.MSG_VERBOSE ); | ||||
| getProject().setNewProperty( property, value ); | |||||
| setProperty( property, value ); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -200,8 +200,9 @@ public class Property extends Task | |||||
| } | } | ||||
| protected void addProperty( String n, String v ) | protected void addProperty( String n, String v ) | ||||
| throws TaskException | |||||
| { | { | ||||
| project.setNewProperty( n, v ); | |||||
| setProperty( n, v ); | |||||
| } | } | ||||
| protected void loadEnvironment( String prefix ) | protected void loadEnvironment( String prefix ) | ||||
| @@ -61,13 +61,13 @@ public class Tstamp extends Task | |||||
| Date d = new Date(); | Date d = new Date(); | ||||
| SimpleDateFormat dstamp = new SimpleDateFormat( "yyyyMMdd" ); | SimpleDateFormat dstamp = new SimpleDateFormat( "yyyyMMdd" ); | ||||
| project.setNewProperty( prefix + "DSTAMP", dstamp.format( d ) ); | |||||
| setProperty( prefix + "DSTAMP", dstamp.format( d ) ); | |||||
| SimpleDateFormat tstamp = new SimpleDateFormat( "HHmm" ); | SimpleDateFormat tstamp = new SimpleDateFormat( "HHmm" ); | ||||
| project.setNewProperty( prefix + "TSTAMP", tstamp.format( d ) ); | |||||
| setProperty( prefix + "TSTAMP", tstamp.format( d ) ); | |||||
| SimpleDateFormat today = new SimpleDateFormat( "MMMM d yyyy", Locale.US ); | SimpleDateFormat today = new SimpleDateFormat( "MMMM d yyyy", Locale.US ); | ||||
| project.setNewProperty( prefix + "TODAY", today.format( d ) ); | |||||
| setProperty( prefix + "TODAY", today.format( d ) ); | |||||
| Enumeration i = customFormats.elements(); | Enumeration i = customFormats.elements(); | ||||
| while( i.hasMoreElements() ) | while( i.hasMoreElements() ) | ||||
| @@ -243,7 +243,7 @@ public class Tstamp extends Task | |||||
| { | { | ||||
| sdf.setTimeZone( timeZone ); | sdf.setTimeZone( timeZone ); | ||||
| } | } | ||||
| project.setNewProperty( propertyName, sdf.format( date ) ); | |||||
| getContext().setProperty( propertyName, sdf.format( date ) ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -134,7 +134,7 @@ public class WaitFor extends ConditionBase | |||||
| if( timeoutProperty != null ) | if( timeoutProperty != null ) | ||||
| { | { | ||||
| project.setNewProperty( timeoutProperty, "true" ); | |||||
| setProperty( timeoutProperty, "true" ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -87,7 +87,6 @@ public class Script extends Task | |||||
| try | try | ||||
| { | { | ||||
| addBeans( project.getProperties() ); | addBeans( project.getProperties() ); | ||||
| addBeans( project.getTargets() ); | |||||
| addBeans( project.getReferences() ); | addBeans( project.getReferences() ); | ||||
| beans.put( "project", getProject() ); | beans.put( "project", getProject() ); | ||||
| @@ -205,7 +205,7 @@ public class AntSoundPlayer | |||||
| } | } | ||||
| catch( UnsupportedAudioFileException uafe ) | catch( UnsupportedAudioFileException uafe ) | ||||
| { | { | ||||
| project.log( "Audio format is not yet supported: " + uafe.getMessage() ); | |||||
| project.log( "Audio format is not yet supported: " + uafe.getMessage(), Project.MSG_INFO ); | |||||
| } | } | ||||
| catch( IOException ioe ) | catch( IOException ioe ) | ||||
| { | { | ||||
| @@ -225,7 +225,7 @@ public class AntSoundPlayer | |||||
| } | } | ||||
| catch( LineUnavailableException e ) | catch( LineUnavailableException e ) | ||||
| { | { | ||||
| project.log( "The sound device is currently unavailable" ); | |||||
| project.log( "The sound device is currently unavailable", Project.MSG_INFO ); | |||||
| return; | return; | ||||
| } | } | ||||
| catch( IOException e ) | catch( IOException e ) | ||||
| @@ -246,7 +246,7 @@ public class AntSoundPlayer | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| project.log( "Can't get data from file " + file.getName() ); | |||||
| project.log( "Can't get data from file " + file.getName(), Project.MSG_INFO ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -188,8 +188,7 @@ public class Checksum extends MatchingTask implements Condition | |||||
| boolean value = validateAndExecute(); | boolean value = validateAndExecute(); | ||||
| if( verifyProperty != null ) | if( verifyProperty != null ) | ||||
| { | { | ||||
| project.setNewProperty( verifyProperty, | |||||
| new Boolean( value ).toString() ); | |||||
| setProperty( verifyProperty, new Boolean( value ).toString() ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -71,7 +71,7 @@ public class ConditionTask extends ConditionBase | |||||
| Condition c = (Condition)getConditions().nextElement(); | Condition c = (Condition)getConditions().nextElement(); | ||||
| if( c.eval() ) | if( c.eval() ) | ||||
| { | { | ||||
| getProject().setNewProperty( property, value ); | |||||
| setProperty( property, value ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -267,7 +267,7 @@ public class ExecTask extends Task | |||||
| } | } | ||||
| val.append( line ); | val.append( line ); | ||||
| } | } | ||||
| project.setNewProperty( outputprop, val.toString() ); | |||||
| setProperty( outputprop, val.toString() ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -370,11 +370,12 @@ public class ExecTask extends Task | |||||
| * @param result Description of Parameter | * @param result Description of Parameter | ||||
| */ | */ | ||||
| protected void maybeSetResultPropertyValue( int result ) | protected void maybeSetResultPropertyValue( int result ) | ||||
| throws TaskException | |||||
| { | { | ||||
| String res = Integer.toString( result ); | String res = Integer.toString( result ); | ||||
| if( resultProperty != null ) | if( resultProperty != null ) | ||||
| { | { | ||||
| project.setNewProperty( resultProperty, res ); | |||||
| setProperty( resultProperty, res ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1028,9 +1028,7 @@ public class Javadoc extends Task | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| project.log( this, | |||||
| "Warning: Leaving out empty argument '" + key + "'", | |||||
| Project.MSG_WARN ); | |||||
| log( "Warning: Leaving out empty argument '" + key + "'", Project.MSG_WARN ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -226,7 +226,7 @@ public class PathConvert extends Task | |||||
| log( "Set property " + property + " = " + value, Project.MSG_VERBOSE ); | log( "Set property " + property + " = " + value, Project.MSG_VERBOSE ); | ||||
| getProject().setNewProperty( property, value ); | |||||
| setProperty( property, value ); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -200,8 +200,9 @@ public class Property extends Task | |||||
| } | } | ||||
| protected void addProperty( String n, String v ) | protected void addProperty( String n, String v ) | ||||
| throws TaskException | |||||
| { | { | ||||
| project.setNewProperty( n, v ); | |||||
| setProperty( n, v ); | |||||
| } | } | ||||
| protected void loadEnvironment( String prefix ) | protected void loadEnvironment( String prefix ) | ||||
| @@ -61,13 +61,13 @@ public class Tstamp extends Task | |||||
| Date d = new Date(); | Date d = new Date(); | ||||
| SimpleDateFormat dstamp = new SimpleDateFormat( "yyyyMMdd" ); | SimpleDateFormat dstamp = new SimpleDateFormat( "yyyyMMdd" ); | ||||
| project.setNewProperty( prefix + "DSTAMP", dstamp.format( d ) ); | |||||
| setProperty( prefix + "DSTAMP", dstamp.format( d ) ); | |||||
| SimpleDateFormat tstamp = new SimpleDateFormat( "HHmm" ); | SimpleDateFormat tstamp = new SimpleDateFormat( "HHmm" ); | ||||
| project.setNewProperty( prefix + "TSTAMP", tstamp.format( d ) ); | |||||
| setProperty( prefix + "TSTAMP", tstamp.format( d ) ); | |||||
| SimpleDateFormat today = new SimpleDateFormat( "MMMM d yyyy", Locale.US ); | SimpleDateFormat today = new SimpleDateFormat( "MMMM d yyyy", Locale.US ); | ||||
| project.setNewProperty( prefix + "TODAY", today.format( d ) ); | |||||
| setProperty( prefix + "TODAY", today.format( d ) ); | |||||
| Enumeration i = customFormats.elements(); | Enumeration i = customFormats.elements(); | ||||
| while( i.hasMoreElements() ) | while( i.hasMoreElements() ) | ||||
| @@ -243,7 +243,7 @@ public class Tstamp extends Task | |||||
| { | { | ||||
| sdf.setTimeZone( timeZone ); | sdf.setTimeZone( timeZone ); | ||||
| } | } | ||||
| project.setNewProperty( propertyName, sdf.format( date ) ); | |||||
| getContext().setProperty( propertyName, sdf.format( date ) ); | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| @@ -134,7 +134,7 @@ public class WaitFor extends ConditionBase | |||||
| if( timeoutProperty != null ) | if( timeoutProperty != null ) | ||||
| { | { | ||||
| project.setNewProperty( timeoutProperty, "true" ); | |||||
| setProperty( timeoutProperty, "true" ); | |||||
| } | } | ||||
| } | } | ||||
| @@ -87,7 +87,6 @@ public class Script extends Task | |||||
| try | try | ||||
| { | { | ||||
| addBeans( project.getProperties() ); | addBeans( project.getProperties() ); | ||||
| addBeans( project.getTargets() ); | |||||
| addBeans( project.getReferences() ); | addBeans( project.getReferences() ); | ||||
| beans.put( "project", getProject() ); | beans.put( "project", getProject() ); | ||||
| @@ -205,7 +205,7 @@ public class AntSoundPlayer | |||||
| } | } | ||||
| catch( UnsupportedAudioFileException uafe ) | catch( UnsupportedAudioFileException uafe ) | ||||
| { | { | ||||
| project.log( "Audio format is not yet supported: " + uafe.getMessage() ); | |||||
| project.log( "Audio format is not yet supported: " + uafe.getMessage(), Project.MSG_INFO ); | |||||
| } | } | ||||
| catch( IOException ioe ) | catch( IOException ioe ) | ||||
| { | { | ||||
| @@ -225,7 +225,7 @@ public class AntSoundPlayer | |||||
| } | } | ||||
| catch( LineUnavailableException e ) | catch( LineUnavailableException e ) | ||||
| { | { | ||||
| project.log( "The sound device is currently unavailable" ); | |||||
| project.log( "The sound device is currently unavailable", Project.MSG_INFO ); | |||||
| return; | return; | ||||
| } | } | ||||
| catch( IOException e ) | catch( IOException e ) | ||||
| @@ -246,7 +246,7 @@ public class AntSoundPlayer | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| project.log( "Can't get data from file " + file.getName() ); | |||||
| project.log( "Can't get data from file " + file.getName(), Project.MSG_INFO ); | |||||
| } | } | ||||
| } | } | ||||