Skip to content

Commit

Permalink
Make <project>'s default attribute required to stop the sky from fall…
Browse files Browse the repository at this point in the history
…ing.

git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@273163 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
bodewig committed Jul 24, 2002
1 parent bd25a82 commit a3f65da
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion docs/manual/using.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ <h3><a name="projects">Projects</a></h3>
<tr>
<td valign="top">default</td>
<td valign="top">the default target to use when no target is supplied.</td>
<td align="center" valign="top">No. No target will be run if omitted.</td>
<td align="center" valign="top"><!-- No. No target will be run if omitted.--> Yes.</td>
</tr>
<tr>
<td valign="top">basedir</td>
Expand Down
3 changes: 2 additions & 1 deletion src/etc/testcases/core/topleveltasks/notarget.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<project>
<project default="foo">
<echo message="Called" />
<target name="foo" />
</project>
3 changes: 2 additions & 1 deletion src/etc/testcases/core/topleveltasks/toplevelant.xml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<project basedir=".">
<project basedir="." default="foo">
<ant antfile="notarget.xml" />
<target name="foo" />
</project>
3 changes: 2 additions & 1 deletion src/etc/testcases/taskdefs/java.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0"?>

<project name="java-test" basedir="." default="">
<project name="java-test" basedir="." default="foo">

<property name="app"
value="org.apache.tools.ant.taskdefs.JavaTest$$EntryPoint" />
Expand Down Expand Up @@ -89,4 +89,5 @@
</java>
</target>

<target name="foo" />
</project>
2 changes: 2 additions & 0 deletions src/main/org/apache/tools/ant/helper/ProjectHelperImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,8 @@ public void init(String tag, AttributeList attrs) throws SAXParseException {

if (def != null && !def.equals("")) {
helperImpl.project.setDefaultTarget(def);
} else {
throw new BuildException("The default attribute is required");
}

if (name != null) {
Expand Down

0 comments on commit a3f65da

Please sign in to comment.