Browse Source

Better error reporting when <ant> cannot find the build file, grammar

correction.

Submitted by:	Diane Holt <holtdl@yahoo.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268089 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
4673e840dc
1 changed files with 5 additions and 1 deletions
  1. +5
    -1
      src/main/org/apache/tools/ant/taskdefs/Ant.java

+ 5
- 1
src/main/org/apache/tools/ant/taskdefs/Ant.java View File

@@ -189,6 +189,10 @@ public class Ant extends Task {
File file = new File(antFile);
if (!file.isAbsolute()) {
antFile = (new File(dir, antFile)).getAbsolutePath();
file = (new File(antFile)) ;
if( ! file.isFile() ) {
throw new BuildException("Build file " + file + " not found.");
}
}

p1.setUserProperty( "ant.file" , antFile );
@@ -203,7 +207,7 @@ public class Ant extends Task {
p1.getProperty("ant.file").equals(project.getProperty("ant.file")) &&
target.equals(this.getOwningTarget().getName())) {

throw new BuildException("ant task calling it's own parent target");
throw new BuildException("ant task calling its own parent target");
}

p1.executeTarget(target);


Loading…
Cancel
Save