Browse Source

Removed ignoremissingbuildfile, following a remark of DD (Dominique Devienne)

in bugzilla.
fileset(s) should be used in the case where some directories do not contain a build file.
PR: 18715


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274606 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 22 years ago
parent
commit
944ad04200
3 changed files with 15 additions and 37 deletions
  1. +13
    -15
      docs/manual/CoreTasks/subant.html
  2. +1
    -1
      proposal/xdocs/src/org/apache/tools/ant/taskdefs/SubAnt.xml
  3. +1
    -21
      src/main/org/apache/tools/ant/taskdefs/SubAnt.java

+ 13
- 15
docs/manual/CoreTasks/subant.html View File

@@ -123,7 +123,7 @@
<td bgcolor="#eeeeee" valign="top" align="left"> <td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font> <font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td> </td>
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="10">
<td bgcolor="#eeeeee" valign="top" align="left" rowspan="9">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font> <font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td> </td>
</tr> </tr>
@@ -176,18 +176,6 @@
</td> </td>
</tr> </tr>
<!-- Attribute --> <!-- Attribute -->
<tr>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">ignoremissingbuildfile</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Sets whether to continue or fail with a build exception if the build file is missing, false by default.</font>
</td>
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
</td>
</tr>
<!-- Attribute -->
<tr> <tr>
<td bgcolor="#eeeeee" valign="top" align="left"> <td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">inheritall</font> <font color="#000000" size="-1" face="arial,helvetica,sanserif">inheritall</font>
@@ -299,7 +287,7 @@
Adds a file set to the implicit build path. <p> <em>Note that the directories will be added to the build path in no particular order, so if order is significant, one should use a file list instead!</em> Adds a file set to the implicit build path. <p> <em>Note that the directories will be added to the build path in no particular order, so if order is significant, one should use a file list instead!</em>
<short-description><![CDATA[Adds a file set to the implicit build path.]]></short-description> <short-description><![CDATA[Adds a file set to the implicit build path.]]></short-description>
<description> <description>
<![CDATA[Adds a file set to the implicit build path. <p> <em>Note that the directories will be added to the build path in no particular order, so if order is significant, one should use a file list instead!</em>]]>
<![CDATA[Adds a file set to the implicit]]><![CDATA[ build path. <p> <em>Note that the directories will be added to the build path in no particular order, so if order is significant, one should use a file list instead!</em>]]>
</description> </description>


</blockquote></td></tr> </blockquote></td></tr>
@@ -402,7 +390,7 @@
<tr><td bgcolor="#525D76"> <tr><td bgcolor="#525D76">
<font color="#ffffff" face="arial,helvetica.sanserif"> <font color="#ffffff" face="arial,helvetica.sanserif">
<a name="examples"> <a name="examples">
<strong>Example</strong></a></font>
<strong>Examples</strong></a></font>
</td></tr> </td></tr>


<tr><td><blockquote> <tr><td><blockquote>
@@ -437,6 +425,16 @@
where a file called build.xml can be found. where a file called build.xml can be found.
All properties whose name starts with "foo" are passed, their names are changed to start with "bar" instead All properties whose name starts with "foo" are passed, their names are changed to start with "bar" instead
</p> </p>
<pre>
&lt;subant target="compile" genericantfile="/opt/project/build1.xml"&gt;
&lt;dirset dir="." includes="projects*"/&gt;
&lt;/subant&gt;
</pre>
<p>
assuming the subdirs of the project dir are called projects1, projects2, projects3
this snippet will execute the compile target of /opt/project/build1.xml,
setting the basedir to projects1, projects2, projects3
</p>


</blockquote></td></tr> </blockquote></td></tr>




+ 1
- 1
proposal/xdocs/src/org/apache/tools/ant/taskdefs/SubAnt.xml View File

@@ -24,7 +24,7 @@
</ul> </ul>
</subsection> </subsection>
</description> </description>
<section anchor="examples" name="Example">
<section anchor="examples" name="Examples">
<pre> <pre>
&lt;project name="subant" default="subant1"&gt; &lt;project name="subant" default="subant1"&gt;
&lt;property name="build.dir" value="subant.build"/&gt; &lt;property name="build.dir" value="subant.build"/&gt;


+ 1
- 21
src/main/org/apache/tools/ant/taskdefs/SubAnt.java View File

@@ -112,7 +112,6 @@ public class SubAnt
private boolean inheritAll = false; private boolean inheritAll = false;
private boolean inheritRefs = false; private boolean inheritRefs = false;
private boolean failOnError = true; private boolean failOnError = true;
private boolean ignoreMissingBuildFile = false;
private String output = null; private String output = null;


private Vector properties = new Vector(); private Vector properties = new Vector();
@@ -140,7 +139,6 @@ public class SubAnt
} }
*/ */
for (int i=0; i<count; ++i) { for (int i=0; i<count; ++i) {
boolean doit=true;
File directory=null; File directory=null;
File file = new File(filenames[i]); File file = new File(filenames[i]);
if (file.isDirectory()) { if (file.isDirectory()) {
@@ -150,17 +148,9 @@ public class SubAnt
} }
else { else {
file = new File(file, antfile); file = new File(file, antfile);
boolean fileFound=file.exists();
if(ignoreMissingBuildFile && !fileFound) {
log("Build file '" + file + "' not found.", Project.MSG_INFO);
doit=false;
}

} }
} }
if (doit) {
execute(file, directory);
}
execute(file, directory);
} }
} }


@@ -237,16 +227,6 @@ public class SubAnt
this.failOnError = failOnError; this.failOnError = failOnError;
} }


/**
* Sets whether to continue or fail with a build exception if the build
* file is missing, false by default.
*
* @param ignoreMissingBuildFile the new value for this boolean flag.
*/
public void setIgnoreMissingBuildFile(boolean ignoreMissingBuildFile) {
this.ignoreMissingBuildFile = ignoreMissingBuildFile;
}

/** /**
* The target to call on the different sub-builds. Set to "" to execute * The target to call on the different sub-builds. Set to "" to execute
* the default target. * the default target.


Loading…
Cancel
Save