From f6624325f53f33627fda986b65abc557b86dd3d1 Mon Sep 17 00:00:00 2001 From: Steve Loughran Date: Thu, 5 May 2005 15:57:19 +0000 Subject: [PATCH] antlib awareness in diagnostics messages git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@278230 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/tools/ant/ComponentHelper.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/main/org/apache/tools/ant/ComponentHelper.java b/src/main/org/apache/tools/ant/ComponentHelper.java index 4d6a0c773..7c3916a16 100644 --- a/src/main/org/apache/tools/ant/ComponentHelper.java +++ b/src/main/org/apache/tools/ant/ComponentHelper.java @@ -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 / 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;