From 48428f7b4cb5b81885d372cc5297e77039ab9375 Mon Sep 17 00:00:00 2001
From: Stephane Bailliez default
attribute of the <project>
tag is
used.
The -projecthelp
The -projecthelp
Command-line option summary:
ant [options] [target [target2 [target3] ...]] diff --git a/docs/manual/using.html b/docs/manual/using.html index a67c693b5..7c635ae74 100644 --- a/docs/manual/using.html +++ b/docs/manual/using.html @@ -42,6 +42,10 @@ to be unique. (For additional information, see theNo +Optionally, a description for the project can be provided as a +top-level <description> element (see the description type).
+Each project defines one or more targets. A target is a set of tasks you want to be executed. When starting Ant, you can select which target(s) you diff --git a/src/main/org/apache/tools/ant/Main.java b/src/main/org/apache/tools/ant/Main.java index 8b295d9bd..e12581b76 100644 --- a/src/main/org/apache/tools/ant/Main.java +++ b/src/main/org/apache/tools/ant/Main.java @@ -458,6 +458,7 @@ public class Main { System.setErr(err); } if (projectHelp) { + printDescription(project); printTargets(project); } } @@ -581,6 +582,15 @@ public class Main { return antVersion; } + /** + * Print the project description, if any + */ + private static void printDescription(Project project) { + if (project.getDescription() != null) { + System.out.println(project.getDescription()); + } + } + /** * Print out a list of all targets in the current buildfile */ diff --git a/src/main/org/apache/tools/ant/Project.java b/src/main/org/apache/tools/ant/Project.java index e6f759326..745a501ae 100644 --- a/src/main/org/apache/tools/ant/Project.java +++ b/src/main/org/apache/tools/ant/Project.java @@ -98,6 +98,7 @@ public class Project { 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(); @@ -318,6 +319,15 @@ public class Project { 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 */ public void addFilter(String token, String value) { if (token == null) { diff --git a/src/main/org/apache/tools/ant/types/defaults.properties b/src/main/org/apache/tools/ant/types/defaults.properties index 020d21c17..d268128ae 100644 --- a/src/main/org/apache/tools/ant/types/defaults.properties +++ b/src/main/org/apache/tools/ant/types/defaults.properties @@ -4,4 +4,5 @@ filelist=org.apache.tools.ant.types.FileList 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