Browse Source

project.setNewProperty() --> setProperty

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-ffa450edef68
master
Peter Donald 23 years ago
parent
commit
62d9c97720
20 changed files with 34 additions and 38 deletions
  1. +1
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Checksum.java
  2. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java
  3. +3
    -2
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/ExecTask.java
  4. +1
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javadoc.java
  5. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/PathConvert.java
  6. +2
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Property.java
  7. +4
    -4
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tstamp.java
  8. +1
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/WaitFor.java
  9. +0
    -1
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Script.java
  10. +3
    -3
      proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java
  11. +1
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Checksum.java
  12. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/ConditionTask.java
  13. +3
    -2
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/ExecTask.java
  14. +1
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Javadoc.java
  15. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/PathConvert.java
  16. +2
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Property.java
  17. +4
    -4
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/Tstamp.java
  18. +1
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/WaitFor.java
  19. +0
    -1
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/Script.java
  20. +3
    -3
      proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java

+ 1
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Checksum.java View File

@@ -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() );
} }
} }




+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/ConditionTask.java View File

@@ -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 );
} }
} }
} }

+ 3
- 2
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/ExecTask.java View File

@@ -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 );
} }
} }




+ 1
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Javadoc.java View File

@@ -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 );
} }
} }
} }


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

@@ -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 );
} }


/** /**


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

@@ -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 )


+ 4
- 4
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/Tstamp.java View File

@@ -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 ) );
} }
} }
} }

+ 1
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/WaitFor.java View File

@@ -134,7 +134,7 @@ public class WaitFor extends ConditionBase


if( timeoutProperty != null ) if( timeoutProperty != null )
{ {
project.setNewProperty( timeoutProperty, "true" );
setProperty( timeoutProperty, "true" );
} }
} }




+ 0
- 1
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/Script.java View File

@@ -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() );


+ 3
- 3
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java View File

@@ -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 );
} }
} }




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

@@ -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() );
} }
} }




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

@@ -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 );
} }
} }
} }

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

@@ -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 );
} }
} }




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

@@ -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 );
} }
} }
} }


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

@@ -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 );
} }


/** /**


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

@@ -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 )


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

@@ -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 ) );
} }
} }
} }

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

@@ -134,7 +134,7 @@ public class WaitFor extends ConditionBase


if( timeoutProperty != null ) if( timeoutProperty != null )
{ {
project.setNewProperty( timeoutProperty, "true" );
setProperty( timeoutProperty, "true" );
} }
} }




+ 0
- 1
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/Script.java View File

@@ -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() );


+ 3
- 3
proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sound/AntSoundPlayer.java View File

@@ -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 );
} }
} }




Loading…
Cancel
Save