method in project. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270128 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -370,6 +370,17 @@ public class Project { | |||||
| return property; | return property; | ||||
| } | } | ||||
| /** | |||||
| * Replace ${} style constructions in the given value with the | |||||
| * string value of the corresponding data types. | |||||
| * | |||||
| * @param value the string to be scanned for property references. | |||||
| */ | |||||
| public String replaceProperties(String value) | |||||
| throws BuildException { | |||||
| return ProjectHelper.replaceProperties(this, value); | |||||
| } | |||||
| /** | /** | ||||
| * query a user property. | * query a user property. | ||||
| * @param name the name of the property | * @param name the name of the property | ||||
| @@ -222,7 +222,7 @@ public class Target implements TaskContainer { | |||||
| return true; | return true; | ||||
| } | } | ||||
| String test = ProjectHelper.replaceProperties(getProject(), ifCondition); | |||||
| String test = project.replaceProperties(ifCondition); | |||||
| return project.getProperty(test) != null; | return project.getProperty(test) != null; | ||||
| } | } | ||||
| @@ -230,7 +230,7 @@ public class Target implements TaskContainer { | |||||
| if ("".equals(unlessCondition)) { | if ("".equals(unlessCondition)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| String test = ProjectHelper.replaceProperties(getProject(), unlessCondition); | |||||
| String test = project.replaceProperties(unlessCondition); | |||||
| return project.getProperty(test) == null; | return project.getProperty(test) == null; | ||||
| } | } | ||||
| @@ -127,8 +127,7 @@ public class Echo extends Task { | |||||
| * Set a multiline message. | * Set a multiline message. | ||||
| */ | */ | ||||
| public void addText(String msg) { | public void addText(String msg) { | ||||
| message += | |||||
| ProjectHelper.replaceProperties(project, msg); | |||||
| message += project.replaceProperties(msg); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -94,8 +94,7 @@ public class Exit extends Task { | |||||
| * Set a multiline message. | * Set a multiline message. | ||||
| */ | */ | ||||
| public void addText(String msg) { | public void addText(String msg) { | ||||
| message += | |||||
| ProjectHelper.replaceProperties(project, msg); | |||||
| message += project.replaceProperties(msg); | |||||
| } | } | ||||
| private boolean testIfCondition() { | private boolean testIfCondition() { | ||||
| @@ -1146,7 +1146,7 @@ public class Javadoc extends Task { | |||||
| * Convenience method to expand properties. | * Convenience method to expand properties. | ||||
| */ | */ | ||||
| protected String expand(String content) { | protected String expand(String content) { | ||||
| return ProjectHelper.replaceProperties(project, content); | |||||
| return project.replaceProperties(content); | |||||
| } | } | ||||
| private String getJavadocExecutableName() | private String getJavadocExecutableName() | ||||
| @@ -289,7 +289,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 = ProjectHelper.replaceProperties(project, value); | |||||
| String v = project.replaceProperties(value); | |||||
| addProperty(name, v); | addProperty(name, v); | ||||
| } | } | ||||
| } | } | ||||
| @@ -533,7 +533,7 @@ public class SQLExec extends Task { | |||||
| try{ | try{ | ||||
| while ((line=in.readLine()) != null){ | while ((line=in.readLine()) != null){ | ||||
| line = line.trim(); | line = line.trim(); | ||||
| line = ProjectHelper.replaceProperties(project, line); | |||||
| line = project.replaceProperties(line); | |||||
| if (line.startsWith("//")) continue; | if (line.startsWith("//")) continue; | ||||
| if (line.startsWith("--")) continue; | if (line.startsWith("--")) continue; | ||||
| StringTokenizer st = new StringTokenizer(line); | StringTokenizer st = new StringTokenizer(line); | ||||
| @@ -291,7 +291,7 @@ public class PatternSet extends DataType { | |||||
| String line = patternReader.readLine(); | String line = patternReader.readLine(); | ||||
| while (line != null) { | while (line != null) { | ||||
| if (line.length() > 0) { | if (line.length() > 0) { | ||||
| line = ProjectHelper.replaceProperties(p, line); | |||||
| line = p.replaceProperties(line); | |||||
| addPatternToList(patternlist).setName(line); | addPatternToList(patternlist).setName(line); | ||||
| } | } | ||||
| line = patternReader.readLine(); | line = patternReader.readLine(); | ||||