You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2005/05/05 17:57:19 UTC

cvs commit: ant/src/main/org/apache/tools/ant ComponentHelper.java

stevel      2005/05/05 08:57:19

  Modified:    src/main/org/apache/tools/ant ComponentHelper.java
  Log:
  antlib awareness in diagnostics messages
  
  Revision  Changes    Path
  1.53      +13 -5     ant/src/main/org/apache/tools/ant/ComponentHelper.java
  
  Index: ComponentHelper.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/ComponentHelper.java,v
  retrieving revision 1.52
  retrieving revision 1.53
  diff -u -r1.52 -r1.53
  --- ComponentHelper.java	3 Mar 2005 14:04:27 -0000	1.52
  +++ ComponentHelper.java	5 May 2005 15:57:19 -0000	1.53
  @@ -782,14 +782,27 @@
           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 @@
               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;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org