Browse Source

-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
master
Jesse N. Glick 13 years ago
parent
commit
589af888eb
3 changed files with 11 additions and 6 deletions
  1. +2
    -0
      WHATSNEW
  2. +2
    -1
      manual/running.html
  3. +7
    -5
      src/main/org/apache/tools/ant/Main.java

+ 2
- 0
WHATSNEW View File

@@ -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.


+ 2
- 1
manual/running.html View File

@@ -37,7 +37,8 @@ attribute of the <code>&lt;project&gt;</code> tag.
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


+ 7
- 5
src/main/org/apache/tools/ant/Main.java View File

@@ -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


Loading…
Cancel
Save