sbailliez 01/08/08 12:34:20
Modified: src/main/org/apache/tools/ant/types defaults.properties
src/main/org/apache/tools/ant Main.java Project.java
docs/manual running.html using.html
Log:
Convenient description task that allows a multiple line description of a
buildfile
with a <description> elment.
Submitted by Craeg K. Strong <[EMAIL PROTECTED]>
Revision Changes Path
1.5 +1 -0
jakarta-ant/src/main/org/apache/tools/ant/types/defaults.properties
Index: defaults.properties
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/types/defaults.properties,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- defaults.properties 2001/08/06 14:32:46 1.4
+++ defaults.properties 2001/08/08 19:34:20 1.5
@@ -4,4 +4,5 @@
patternset=org.apache.tools.ant.types.PatternSet
mapper=org.apache.tools.ant.types.Mapper
filterset=org.apache.tools.ant.types.FilterSet
+description=org.apache.tools.ant.types.Description
1.44 +10 -0 jakarta-ant/src/main/org/apache/tools/ant/Main.java
Index: Main.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Main.java,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- Main.java 2001/08/03 14:21:00 1.43
+++ Main.java 2001/08/08 19:34:20 1.44
@@ -458,6 +458,7 @@
System.setErr(err);
}
if (projectHelp) {
+ printDescription(project);
printTargets(project);
}
}
@@ -579,6 +580,15 @@
}
}
return antVersion;
+ }
+
+ /**
+ * Print the project description, if any
+ */
+ private static void printDescription(Project project) {
+ if (project.getDescription() != null) {
+ System.out.println(project.getDescription());
+ }
}
/**
1.74 +10 -0 jakarta-ant/src/main/org/apache/tools/ant/Project.java
Index: Project.java
===================================================================
RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/Project.java,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- Project.java 2001/08/08 16:13:08 1.73
+++ Project.java 2001/08/08 19:34:20 1.74
@@ -98,6 +98,7 @@
public static final String TOKEN_END = FilterSet.DEFAULT_TOKEN_END;
private String name;
+ private String description;
private Hashtable properties = new Hashtable();
private Hashtable userProperties = new Hashtable();
@@ -316,6 +317,15 @@
public String getName() {
return name;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ // Will return null if no description has been set
+ public String getDescription() {
+ return description;
}
/** @deprecated */
1.3 +4 -3 jakarta-ant/docs/manual/running.html
Index: running.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/running.html,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- running.html 2001/06/13 15:29:40 1.2
+++ running.html 2001/08/08 19:34:20 1.3
@@ -46,9 +46,10 @@
<code>default</code> attribute of the <code><project></code> tag is
used.</p>
-<p>The <nobr><code>-projecthelp</code></nobr>
-option gives a list of this project's
-targets. First those with a description, then those without one.</p>
+<p>The <nobr><code>-projecthelp</code></nobr> option prints out the
+description of the project, if it exists, followed by a list of this
+project's targets. First those with a description, then those without
+one.</p>
<p>Command-line option summary:</p>
<pre>ant [options] [target [target2 [target3] ...]]
1.7 +4 -0 jakarta-ant/docs/manual/using.html
Index: using.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/using.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- using.html 2001/06/08 10:31:02 1.6
+++ using.html 2001/08/08 19:34:20 1.7
@@ -42,6 +42,10 @@
<td align="center" valign="top">No</td>
</tr>
</table>
+<p>Optionally, a description for the project can be provided as a
+top-level <description> element (see the <a
+href="CoreTypes/description.html">description</a> type).</p>
+
<p>Each project defines one or more <i>targets</i>.
A target is a set of <i>tasks</i> you want
to be executed. When starting Ant, you can select which target(s) you