Bug 23397 - Need attribute for target tag to indicate hidden/internal target
Summary: Need attribute for target tag to indicate hidden/internal target
Status: RESOLVED DUPLICATE of bug 22020
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.5.4
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-24 22:31 UTC by Chris Janicki
Modified: 2008-02-22 12:18 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Janicki 2003-09-24 22:31:46 UTC
I use my IDE (NetBeans) for most ant work.  There are times when I need to create intermediate 
targets for the sake of modularity and code reuse.  Unfortunately, all these extra targets show up 
as first-rate targets to be executed in my IDE.  I've tried various target naming conventions to help 
highlight/lowlight primary/intermediate targets, but it's not great.

If there were an attribute flag to indicate intermediate/private targets, then IDEs could optionally 
hide these targets. 

For example:

<target name="foo" private="true">

This might also be useful if you ever add a "list targets" feature to the ant CLI.  For example:

ant -list [file]   (list all primary targets)
ant -list -all [file]   (list private targets too)
Comment 1 Jan Mat 2003-09-25 07:52:36 UTC

*** This bug has been marked as a duplicate of 22020 ***
Comment 2 Steve Loughran 2003-09-25 16:41:36 UTC
Actually this is a simpler defect than proper public/private attrs; the user
just wants the IDE to differentiate entry points from internal ones. 

Chris -the <target> element has a description attribute. Once you set the
description on a target, you are saying that this is public and others are
private. Ant on the command line, and in some IDEs (IntelliJ for example) use
presence/absence of a description as a cue for visibility in listing targets. I
dont know about netbeans -I would assume it does, but if it doesnt, well, you
could fix it :)

Also, we do have an 'ant list targets' feature. 
Type "ant -projecthelp" at the command line. 
Comment 3 Gus Heck 2003-09-25 16:59:48 UTC
Yes thogh this is an overloading of the meaning of the description tag by the
ide's. It seems wrong to put 2 meanings on one tag.

Net beans does not hide any targets. 

They display all top level elements, including properties, and taskdefs, and I
suspect with the advent of top level tasks (which I never use because of the
access control pattern I describe in bug 22020) this will become even more messy
in net beans. If someone here is active in netbeans some additional special
handling of antfiles would be good. Heaven only knows if I will ever have the
time to start developing for net beans too :)

What the IDE's are doing is guessing. It would be nice if we could tell them so
they don't have to guess :)
Comment 4 Chris Janicki 2003-09-25 17:08:32 UTC
Thanks Steve... I see your point, but I agree with Gus: I think that making the description attribute 
perform dual duties is not the optimal design.  Private targets may still benefit from descriptions.  
For example, I'd hope that my IDE could turn on/off visibility of private targets for editing vs. 
running.  When visible (e.g. during editing) I think the private task descriptions have merit, for 
example, it could be displayed in a status label.  (At least that's the way I'd code NetBeans ;-)

Regarding the -projecthelp argument, you're 100% right... thanks.  But I may open a future 
enhancement request to deprecate that name... kinda long, and not intuitive enough (for me at 
least) to understand it when I was quickly looking for it.
Comment 5 Steve Loughran 2003-09-25 21:02:56 UTC
dont open an new enh req till you've looked at ant1.6, due in beta next week,
OK? you may find ant -p does what you want