From 589af888eb8b6ea9c139272fac2bd69382e10ea0 Mon Sep 17 00:00:00 2001 From: "Jesse N. Glick" Date: Mon, 21 Nov 2011 19:06:47 +0000 Subject: [PATCH] -f/-file/-buildfile accepts a directory containing build.xml. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@1204655 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 2 ++ manual/running.html | 3 ++- src/main/org/apache/tools/ant/Main.java | 12 +++++++----- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 1c075d716..df4f23cec 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -107,6 +107,8 @@ Fixed bugs: Other changes: -------------- + * -f/-file/-buildfile accepts a directory containing build.xml. + * The , and now support a new maxmemory attribute. Bugzilla Report 50513. diff --git a/manual/running.html b/manual/running.html index 35837e3df..ebe173212 100644 --- a/manual/running.html +++ b/manual/running.html @@ -37,7 +37,8 @@ attribute of the <project> tag. To make Ant use a build file other than build.xml, use the command-line option -buildfile file, -where file is the name of the build file you want to use.

+where file is the name of the build file you want to use +(or a directory containing a build.xml file).

If you use the -find [file] option, Ant will search for a build file first in the current directory, then in the parent directory, and so on, until either a build file is found or the root diff --git a/src/main/org/apache/tools/ant/Main.java b/src/main/org/apache/tools/ant/Main.java index c03e69526..63a3009dd 100644 --- a/src/main/org/apache/tools/ant/Main.java +++ b/src/main/org/apache/tools/ant/Main.java @@ -451,12 +451,14 @@ public class Main implements AntMain { throw new BuildException("Build failed"); } - // make sure it's not a directory (this falls into the ultra - // paranoid lets check everything category - if (buildFile.isDirectory()) { - System.out.println("What? Buildfile: " + buildFile + " is a dir!"); - throw new BuildException("Build failed"); + File whatYouMeant = new File(buildFile, "build.xml"); + if (whatYouMeant.isFile()) { + buildFile = whatYouMeant; + } else { + System.out.println("What? Buildfile: " + buildFile + " is a dir!"); + throw new BuildException("Build failed"); + } } // Normalize buildFile for re-import detection