ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jgl...@apache.org
Subject svn commit: r1204655 - in /ant/core/trunk: WHATSNEW manual/running.html src/main/org/apache/tools/ant/Main.java
Date Mon, 21 Nov 2011 19:06:48 GMT
Author: jglick
Date: Mon Nov 21 19:06:47 2011
New Revision: 1204655

URL: http://svn.apache.org/viewvc?rev=1204655&view=rev
Log:
-f/-file/-buildfile accepts a directory containing build.xml.

Modified:
    ant/core/trunk/WHATSNEW
    ant/core/trunk/manual/running.html
    ant/core/trunk/src/main/org/apache/tools/ant/Main.java

Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=1204655&r1=1204654&r2=1204655&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Mon Nov 21 19:06:47 2011
@@ -107,6 +107,8 @@ Fixed bugs:
 Other changes:
 --------------
 
+ * -f/-file/-buildfile accepts a directory containing build.xml.
+
  * The <javacc>, <jjtree> and <jjdoc> now support a new maxmemory
    attribute.
    Bugzilla Report 50513.

Modified: ant/core/trunk/manual/running.html
URL: http://svn.apache.org/viewvc/ant/core/trunk/manual/running.html?rev=1204655&r1=1204654&r2=1204655&view=diff
==============================================================================
--- ant/core/trunk/manual/running.html (original)
+++ ant/core/trunk/manual/running.html Mon Nov 21 19:06:47 2011
@@ -37,7 +37,8 @@ attribute of the <code>&lt;project&gt;</
 To make Ant use
 a build file other than <code>build.xml</code>, use the command-line
 option <nobr><code>-buildfile <i>file</i></code></nobr>,
-where <i>file</i> is the name of the build file you want to use.</p>
+where <i>file</i> is the name of the build file you want to use
+(or a directory containing a <code>build.xml</code> file).</p>
 If you use the <nobr><code>-find [<i>file</i>]</code></nobr>
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

Modified: ant/core/trunk/src/main/org/apache/tools/ant/Main.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/Main.java?rev=1204655&r1=1204654&r2=1204655&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/Main.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/Main.java Mon Nov 21 19:06:47 2011
@@ -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



Mime
View raw message