Author: mbenson Date: Tue May 8 15:28:38 2007 New Revision: 536355 URL: http://svn.apache.org/viewvc?view=rev&rev=536355 Log: add a new constructor for programmatic construction of a StringResource with property substitution (will support fixing broken Concat tests)
Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java Modified: ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java?view=diff&rev=536355&r1=536354&r2=536355 ============================================================================== --- ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java (original) +++ ant/core/trunk/src/main/org/apache/tools/ant/types/resources/StringResource.java Tue May 8 15:28:38 2007 @@ -26,6 +26,7 @@ import java.io.ByteArrayOutputStream; import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.Project; import org.apache.tools.ant.types.Resource; import org.apache.tools.ant.types.Reference; @@ -52,7 +53,18 @@ * @param value the value of this StringResource. */ public StringResource(String value) { - setValue(value); + this(null, value); + } + + /** + * Construct a StringResource with the supplied project and value, + * doing property replacement against the project if non-null. + * @param project the owning Project. + * @param value the value of this StringResource. + */ + public StringResource(Project project, String value) { + setProject(project); + setValue(project == null ? value : project.replaceProperties(value)); } /** --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]