Browse Source

antlib awareness in diagnostics messages

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278230 13f79535-47bb-0310-9956-ffa450edef68
master
Steve Loughran 20 years ago
parent
commit
f6624325f5
1 changed files with 13 additions and 5 deletions
  1. +13
    -5
      src/main/org/apache/tools/ant/ComponentHelper.java

+ 13
- 5
src/main/org/apache/tools/ant/ComponentHelper.java View File

@@ -782,14 +782,27 @@ public class ComponentHelper {
boolean jars = false;
boolean definitions = false;
boolean antTask;
String home = System.getProperty(Launcher.USER_HOMEDIR);
File libDir = new File(home,
Launcher.ANT_PRIVATEDIR +
File.separator +
Launcher.ANT_PRIVATELIB);
//look up the name
AntTypeDefinition def = getDefinition(componentName);
if (def == null) {
//not a known type
boolean isAntlib=componentName.indexOf("antlib:")==0;
out.println("Cause: The name is undefined.");
out.println("Action: Check the spelling.");
out.println("Action: Check that any custom tasks/types have been declared");
out.println("Action: Check that any <presetdef>/<macrodefs> declarations have taken place");
if(isAntlib) {
out.println();
out.println("This appears to be an antlib declaration. ");
out.println("Action: check that the implementing library exists "
+ "in ANT_HOME/lib or in ");
out.println(" " + libDir);
}
definitions = true;
} else {
//we are defined, so it is an instantiation problem
@@ -797,11 +810,6 @@ public class ComponentHelper {
antTask = classname.startsWith("org.apache.tools.ant.");
boolean optional = classname.startsWith("org.apache.tools.ant.taskdefs.optional");
optional |= classname.startsWith("org.apache.tools.ant.types.optional");
String home = System.getProperty(Launcher.USER_HOMEDIR);
File libDir = new File(home,
Launcher.ANT_PRIVATEDIR +
File.separator +
Launcher.ANT_PRIVATELIB);

//start with instantiating the class.
Class clazz = null;


Loading…
Cancel
Save