Browse Source

More magic names

master
twogee 5 years ago
parent
commit
814e95b745
4 changed files with 5 additions and 4 deletions
  1. +1
    -1
      src/main/org/apache/tools/ant/MagicNames.java
  2. +1
    -1
      src/main/org/apache/tools/ant/taskdefs/Definer.java
  3. +1
    -1
      src/tests/junit/org/apache/tools/ant/ExecutorTest.java
  4. +2
    -1
      src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java

+ 1
- 1
src/main/org/apache/tools/ant/MagicNames.java View File

@@ -218,7 +218,7 @@ public final class MagicNames {
* Value: {@value}
*/
public static final String PROJECT_HELPER_SERVICE =
"META-INF/services/org.apache.tools.ant.ProjectHelper";
"META-INF/services/" + PROJECT_HELPER_CLASS;

/**
* Name of ProjectHelper reference that we add to a project.


+ 1
- 1
src/main/org/apache/tools/ant/taskdefs/Definer.java View File

@@ -465,7 +465,7 @@ public abstract class Definer extends DefBase {
}
if (!antlib.startsWith(MagicNames.ANTLIB_PREFIX)) {
throw new BuildException(
"Invalid antlib attribute - it must start with antlib:");
"Invalid antlib attribute - it must start with " + MagicNames.ANTLIB_PREFIX);
}
setURI(antlib);
this.resource = antlib.substring(MagicNames.ANTLIB_PREFIX.length()).replace('.', '/')


+ 1
- 1
src/tests/junit/org/apache/tools/ant/ExecutorTest.java View File

@@ -92,7 +92,7 @@ public class ExecutorTest implements BuildListener {

private Project getProject(String e, boolean f, boolean k) {
Project p = buildRule.getProject();
p.setNewProperty("ant.executor.class", e);
p.setNewProperty(MagicNames.ANT_EXECUTOR_CLASSNAME, e);
p.setKeepGoingMode(k);
if (f) {
p.setNewProperty("failfoo", "foo");


+ 2
- 1
src/tests/junit/org/apache/tools/ant/taskdefs/optional/EchoPropertiesTest.java View File

@@ -37,6 +37,7 @@ import java.util.Properties;

import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.BuildFileRule;
import org.apache.tools.ant.MagicNames;
import org.apache.tools.ant.util.regexp.RegexpMatcherFactory;
import org.junit.After;
import org.junit.Before;
@@ -182,7 +183,7 @@ public class EchoPropertiesTest {
buildRule.executeTarget("testWithRegex");
// the following line has been changed from checking ant.home to ant.version
// so the test will still work when run outside of an Ant script
assertThat(buildRule.getFullLog(), containsString("ant.version="));
assertThat(buildRule.getFullLog(), containsString(MagicNames.ANT_VERSION + "="));
}

private void testEchoPrefixVarious(String target) throws Exception {


Loading…
Cancel
Save