Bug 28447 - Add an "private" attribute to targets
Summary: Add an "private" attribute to targets
Status: RESOLVED DUPLICATE of bug 22020
Alias: None
Product: Ant
Classification: Unclassified
Component: Core (show other bugs)
Version: 1.6.1
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Depends on:
Reported: 2004-04-17 02:42 UTC by Matt Harrah
Modified: 2008-02-22 12:18 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
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.

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