From bab6532e4101808a8aad01dda7f3cdafefecca26 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Fri, 14 Sep 2001 06:04:21 +0000 Subject: [PATCH] use FileUtils' resolution method for the dir/antfile logic committed in this branch to see whether it has broken something in next GUMP run. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@269708 13f79535-47bb-0310-9956-ffa450edef68 --- src/main/org/apache/tools/ant/taskdefs/Ant.java | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/main/org/apache/tools/ant/taskdefs/Ant.java b/src/main/org/apache/tools/ant/taskdefs/Ant.java index a989e0f90..ae83144bc 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Ant.java +++ b/src/main/org/apache/tools/ant/taskdefs/Ant.java @@ -55,6 +55,7 @@ package org.apache.tools.ant.taskdefs; import org.apache.tools.ant.*; +import org.apache.tools.ant.util.FileUtils; import java.io.*; import java.util.*; @@ -228,14 +229,8 @@ public class Ant extends Task { if (antFile == null) antFile = "build.xml"; - 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."); - } - } + File file = FileUtils.newFileUtils().resolveFile(dir, antFile); + antFile = file.getAbsolutePath(); p1.setUserProperty( "ant.file" , antFile ); ProjectHelper.configureProject(p1, new File(antFile));