ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Milan Kubec <milan.ku...@netbeans.com>
Subject Re: public vs. private targets
Date Fri, 23 Feb 2001 10:55:44 GMT
Siberski, Wolf wrote:

> There has been a discussion about that a
> long while ago. IIRC the result was that
> the attribute 'description' was introduced.
> Targets which have a value for that attribute 
> set are supposed to be 'main' targets which
> may be called by end users, while the other
> are regarded as 'subtarget's which should not 
> be called directly.
> The Ant engine doesn't check this however,
> because the typical Ant user knows
> what he is doing when calling a subtarget,
> so there seemed no good reason to enforce
> a restriction.


It depends what do you mean by "Ant user", if you mean programmer who 
created ant script, he is supposed to know what is he/she doing, that's 
OK. But it you create bunch of build scripts for developers just to use 
them, they are virtually without any ant knowledge and it's becomming to 
be a problem that they discover scripts and report that scripts are not 
working and so on. If there is way how to expose only public targets, it 
could help IMHO. BTW why OO prg. languages has private and public 
methods, developers could know that some methods are not supposed to be 
used as public ;-)

  Milan

> 
> I think the only effect of this discussion
> is seen when You use the Ant option
> '-projecthelp'. For our VAJ Plugin we
> also show only main targets.
> 
> I'm not sure if anyone (except me) still
> cares about that distinction. It isn't
> mentioned in the docs, and the Ant
> buildfile itself has only one target
> with description (javadoc). This is also
> a sign that a new 'access' attribute,
> although an appealing idea, seems not
> to be needed by the Ant users.
> 
> Wolf
> 
> 
>> Jacob Martin wrote:
>> Yes!  I was just thinking the same thing a couple of hours ago! 
>> Wouldn't be too hard to put in either!
>> 
>> Jake
>> 
>> Milan Kubec wrote:
>> 
>>> Hello,
>>> I don't know if there was already discussion about this topic, but ...
>>> 
>>> It seems to me that could be usefull to be able to define what targets
>>> in build script can be called (let's say public targets) and which
>>> targets are only private to that script and can be called only form
>>> inside the script from another targets. Let's say:
>>> 
>>> <target name="t1" depends="t2" access="public">
>>> ...
>>> </target>
>>> 
>>> <target name="t1" depends="t2" access="private">
>>> ...
>>> </target>
>>> 
>>> Does it make sense? I know it can be done by defining e.g. unless for
>>> that target, but this is more straightforward and it doesn't need any
>>> other properties.
>>> 
>>>   Milan
>>> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ant-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: ant-dev-help@jakarta.apache.org



Mime
View raw message