diff --git a/src/main/org/apache/tools/ant/Target.java b/src/main/org/apache/tools/ant/Target.java index 21304d73d..0a0f9f23a 100644 --- a/src/main/org/apache/tools/ant/Target.java +++ b/src/main/org/apache/tools/ant/Target.java @@ -129,9 +129,9 @@ public class Target implements TaskContainer { // 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); diff --git a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java index 3bbd08707..a9784d8e4 100644 --- a/src/main/org/apache/tools/ant/helper/ProjectHelper2.java +++ b/src/main/org/apache/tools/ant/helper/ProjectHelper2.java @@ -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 @@ public class ProjectHelper2 extends ProjectHelper { "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 @@ -834,6 +830,10 @@ public class ProjectHelper2 extends ProjectHelper { usedTarget = true; } + if (depends.length() > 0) { + target.setDepends(depends); + } + if (context.isIgnoringProjectTag() && context.getCurrentProjectName() != null && context.getCurrentProjectName().length() != 0) { // In an impored file (and not completely