Bug 28447

Summary: Add an "private" attribute to targets
Product: Ant Reporter: Matt Harrah <mharrah>
Component: CoreAssignee: Ant Notifications List <notifications>
Status: RESOLVED DUPLICATE    
Severity: enhancement    
Priority: P3    
Version: 1.6.1   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Matt Harrah 2004-04-17 02:42:47 UTC
Sometimes we have targets that are really only useful as a "subroutine" sort 
of thing.  For example, we might have target A that depends on target B, and 
has an unless attribute for property Foo.  Target B consists of an uptodate 
check and sets property Foo if things are up-to-date.  It makes no sense to 
call target B from the command line.

It would be nice if there were an optional attribute on targets that would 
allow you to mark a target as "for internal use only" and would not show up in 
ant -projecthelp (even if a description were specified), and would cause an 
error if called from the command line.

This would also make it easier when generating documentation from build 
scripts to know "public" or "main" targets from the subroutine type targets.
Comment 1 Rainer Noack 2004-04-17 10:00:14 UTC
You can use target names with a leading '-' (like "-myprivatetarget") to 
indicate "private" targets.
Those targets can not be called from the commandline.
(There is a hint somewhere in the documentation, but I can't remember where).

However, IMHO it's a good idea to skip targets with a leading '-' from
-projecthelp's processing.

Regards,
Rainer
Comment 2 Matt Benson 2004-04-17 19:53:23 UTC
It is simple enough to get -p/-projecthelp to ignore your "private" (starting 
with -) targets:  supply description attributes for all "public" targets.  
Beyond that, I am marking this bug as a duplicate of 20020.

*** This bug has been marked as a duplicate of 20020 ***
Comment 3 Matt Benson 2004-04-17 20:03:09 UTC
Grr... I mean 22020.
Comment 4 Matt Benson 2004-04-17 20:03:26 UTC

*** This bug has been marked as a duplicate of 22020 ***