ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject svn commit: r393610 - in /ant/core/trunk/src/main/org/apache/tools/ant: Target.java helper/ProjectHelper2.java
Date Wed, 12 Apr 2006 20:53:30 GMT
Author: bodewig
Date: Wed Apr 12 13:53:29 2006
New Revision: 393610

URL: http://svn.apache.org/viewcvs?rev=393610&view=rev
Log:
set target's name before the depends attribute - leads to more meaningful errors.  PR 37655

Modified:
    ant/core/trunk/src/main/org/apache/tools/ant/Target.java
    ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Target.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/Target.java?rev=393610&r1=393609&r2=393610&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Target.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Target.java Wed Apr 12 13:53:29 2006
@@ -129,9 +129,9 @@
 
                 // Make sure the dependency is not empty string
                 if ("".equals(token) || ",".equals(token)) {
-                    throw new BuildException("Syntax Error: Depend "
-                        + "attribute for target \"" + getName()
-                        + "\" has an empty string for dependency.");
+                    throw new BuildException("Syntax Error: depends "
+                        + "attribute of target \"" + getName()
+                        + "\" has an empty string as dependency.");
                 }
 
                 addDependency(token);

Modified: ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java?rev=393610&r1=393609&r2=393610&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/helper/ProjectHelper2.java Wed Apr 12 13:53:29
2006
@@ -1,5 +1,5 @@
 /*
- * Copyright  2000-2005 The Apache Software Foundation
+ * Copyright  2000-2006 The Apache Software Foundation
  *
  *  Licensed under the Apache License, Version 2.0 (the "License");
  *  you may not use this file except in compliance with the License.
@@ -817,10 +817,6 @@
                     "Duplicate target '" + name + "'", target.getLocation());
             }
 
-            if (depends.length() > 0) {
-                target.setDepends(depends);
-            }
-
             Hashtable projectTargets = project.getTargets();
             boolean   usedTarget = false;
             // If the name has not already been defined define it
@@ -832,6 +828,10 @@
                 context.getCurrentTargets().put(name, target);
                 project.addOrReplaceTarget(name, target);
                 usedTarget = true;
+            }
+
+            if (depends.length() > 0) {
+                target.setDepends(depends);
             }
 
             if (context.isIgnoringProjectTag() && context.getCurrentProjectName()
!= null



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


Mime
View raw message