ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tim Fennell" <>
Subject RE: [PATCH] Suggestion for new commandline switch -targets
Date Mon, 14 Aug 2000 12:42:02 GMT
While I understand your point Conor....I tend to disagree.  I've set ant up for
several projects now, and while some people are comfortable just opening up the
buildfile and looking, it just doen't occur to some people (go figure).

I actually really like Marcel's suggested patch, becuase it allows people to
quickly get the answer to their questions, which invariable seem to be, 'what
was the name of that pesky target again?'.

A thought I had at the time of the <help> conversation hooks up nicely here.
Why not simply have an optional nested element for <target> called <description>
or something like that, which provided verbiage of what the task does, who
should use it etc.  Then the proposed 'ant -targets' could print descriptions
along with the list of targets. For most people, I *hope*, this would simply be
an exercise of moving text from some XML comments into a defined element....


-----Original Message-----
From: Conor MacNeill []
Sent: Monday, August 14, 2000 07:37
Subject: RE: [PATCH] Suggestion for new commandline switch -targets


My own feeling about this patch is to ask why you don't just read the
build.xml file? Then again, not everyone thinks the way I do :-) I have seen
some people saying that they have big build files and need this facility.
If, however, a build file is big (and presumably complex), I wonder if
giving a list of targets might not be a little dangerous, as in "a little
knowledge is a dangeroud thing".

In the end, there is not much semantic content in a target name and users
may be tempted to guess what targets do, with surprising results. Do you
really want users to start executing targets when they aren't familiar with
the build file. Perhaps this sort of information may be better provided in
documentation accompanying the build file rather than trying to extract
meaningful documentation purely based on the target names.

We had another discussion once about including a <help> or <about> element
in a project which would display information about the build file. This
concept could be extended to include help about particular targets.
Something like

<target name="upgrade">
  <help>Don't use this target as it will erase your operating system</help>



> -----Original Message-----
> From: Marcel Schutte []
> Sent: Monday, 14 August 2000 7:34
> To:
> Subject: [PATCH] Suggestion for new commandline switch -targets
> Reposted with my suggestion in a diff file. Also, see comments below.
> > -----Original Message-----
> > From: Christopher Elkins []
> > Sent: zondag 13 augustus 2000 22:59
> > To:
> > Subject: Re: Suggestion for new commandline switch -targets
> >
> >
> > > Hi,
> > >
> > > In the attached version of there are some simple
> modifications
> > > which make ant recognize a -targets option.
> > >
> > > This will print out a list of all the targets available in
> the selected
> > > build-file. It is meant as some sort of documentation on what
> > the build-file
> > > can do. Execution is suppressed.
> > >
> > > Do you guys like this suggestion, and if so, how do I go about
> > incorporating
> > > it in ant?
> > >
> > First, you should submit your patch in diff form
> > <>. It makes it
> > much easier to
> > evaluate.
> >
> > Second, I think this would be a useful addition. Many ant-using
> > projects create
> > their own targets (e.g., "usage") to provide similar
> functionality as your
> > patch. Standardizing such behavior would be a very good thing.
> >
> > However, not all targets in a build file are suitable and/or
> relevant for
> > calling from the command-line. For example, calling the "prepare"
> > target in
> > jakarta-ant/build.xml from the command-line would have limited utility.
> > Therefore, it might be useful to add an attribute to the
> <target> tag that
> > allowed one to specify whether that target should be output in
> > Main.printTargets().
> Or perhaps a 'private' attribute, which can make a target
> invisible from the
> outside and only visible to 'depends' clauses.
> Another optional attribute could be 'description', to be printed
> as part of
> the target list.
> Let me know what you think of this,
> >
> > > Regards,
> > > Marcel Schutte
> > >
> >
> > --
> > Christopher Elkins
> >
> >
> Regards,
> Marcel Schutte

View raw message