You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Marcel Schutte <ma...@schutte.com> on 2000/08/13 23:34:06 UTC

[PATCH] Suggestion for new commandline switch -targets

Reposted with my suggestion in a diff file. Also, see comments below.

> -----Original Message-----
> From: Christopher Elkins [mailto:celkins@scardini.com]
> Sent: zondag 13 augustus 2000 22:59
> To: ant-dev@jakarta.apache.org
> Subject: Re: Suggestion for new commandline switch -targets
>
>
> > Hi,
> >
> > In the attached version of Main.java 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
> <http://jakarta.apache.org/guidelines/source.html>. 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

Re: [PATCH] Suggestion for new commandline switch -targets

Posted by Christopher Elkins <ce...@scardini.com>.
> Reposted with my suggestion in a diff file. Also, see comments below.
>
Much better. But what are those "MS:begin" and "MS:end" lines? Is your editor
inserting those?

> > > Hi,
> > >
> > > In the attached version of Main.java 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
> > <http://jakarta.apache.org/guidelines/source.html>. 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.
+1  (Although my vote doesn't count for much, because I'm not a committer. ;-)

> Another optional attribute could be 'description', to be printed as part of
> the target list.
+1

> Let me know what you think of this,
>
> Regards,
> Marcel Schutte
>

--
Christopher Elkins


RE: [PATCH] Suggestion for new commandline switch -targets

Posted by Marcel Schutte <ma...@schutte.com>.
Thanks for your reaction. I completely agree that it might be undesirable to
get a list of all the targets in a build.xml file.

But this is why I also suggested (it's not in the patch I submitted) to add
a 'private' attribute to targets. This should prevent the target from being
used as a primary target in your ant invocation, but restrict its use to
'depends' clauses.

The list that '-targets' generates should then contain only the targets
where 'private' is 'false' or unset.

The 'help' element you mention provides exactly the kind of information I
was looking for to add to the list of targets.

Would it be useful if I tried to implement my ideas?

Regards,
Marcel Schutte

> -----Original Message-----
> From: Conor MacNeill [mailto:conor@m64.com]
> Sent: maandag 14 augustus 2000 13:37
> To: ant-dev@jakarta.apache.org
> Subject: RE: [PATCH] Suggestion for new commandline switch -targets
>
>
> Marcel,
>
> 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>
>   <erase_os>
> </target>
>
> Thoughts?
>
> Conor
>
>
> > -----Original Message-----
> > From: Marcel Schutte [mailto:marcel@schutte.com]
> > Sent: Monday, 14 August 2000 7:34
> > To: ant-dev@jakarta.apache.org
> > 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 [mailto:celkins@scardini.com]
> > > Sent: zondag 13 augustus 2000 22:59
> > > To: ant-dev@jakarta.apache.org
> > > Subject: Re: Suggestion for new commandline switch -targets
> > >
> > >
> > > > Hi,
> > > >
> > > > In the attached version of Main.java 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
> > > <http://jakarta.apache.org/guidelines/source.html>. 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
> >
>
>


RE: [PATCH] Suggestion for new commandline switch -targets

Posted by Conor MacNeill <co...@m64.com>.
Tim,

> 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....

Agreed. Pretty much agrees with what I suggested, I think. My point was that
a list of targets, on its own lacks enough information to be useful but
enough to be dangerous.

I would prefer -targets therefore to be changed to support printing this
help information. Perhaps -targets is no longer an appropriate option label.
It should become a general project information dump, printing project level
help, a list of targets, with their associated help. Perhaps -info or -docs?

I am not too keen on the "private" flag for targets, though.

thoughts? Marcel?


RE: [PATCH] Suggestion for new commandline switch -targets

Posted by Tim Fennell <tf...@rcn.com>.
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....
Thoughts?

-t

-----Original Message-----
From: Conor MacNeill [mailto:conor@m64.com]
Sent: Monday, August 14, 2000 07:37
To: ant-dev@jakarta.apache.org
Subject: RE: [PATCH] Suggestion for new commandline switch -targets


Marcel,

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>
  <erase_os>
</target>

Thoughts?

Conor


> -----Original Message-----
> From: Marcel Schutte [mailto:marcel@schutte.com]
> Sent: Monday, 14 August 2000 7:34
> To: ant-dev@jakarta.apache.org
> 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 [mailto:celkins@scardini.com]
> > Sent: zondag 13 augustus 2000 22:59
> > To: ant-dev@jakarta.apache.org
> > Subject: Re: Suggestion for new commandline switch -targets
> >
> >
> > > Hi,
> > >
> > > In the attached version of Main.java 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
> > <http://jakarta.apache.org/guidelines/source.html>. 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
>



RE: [PATCH] Suggestion for new commandline switch -targets

Posted by Conor MacNeill <co...@m64.com>.
Marcel,

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>
  <erase_os>
</target>

Thoughts?

Conor


> -----Original Message-----
> From: Marcel Schutte [mailto:marcel@schutte.com]
> Sent: Monday, 14 August 2000 7:34
> To: ant-dev@jakarta.apache.org
> 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 [mailto:celkins@scardini.com]
> > Sent: zondag 13 augustus 2000 22:59
> > To: ant-dev@jakarta.apache.org
> > Subject: Re: Suggestion for new commandline switch -targets
> >
> >
> > > Hi,
> > >
> > > In the attached version of Main.java 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
> > <http://jakarta.apache.org/guidelines/source.html>. 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
>