ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicola Ken Barozzi <nicola...@apache.org>
Subject Re: Import basedir
Date Fri, 24 Jan 2003 08:01:02 GMT

Costin Manolache wrote:
> Nicola Ken Barozzi wrote:
> 
> 
>>One thing that we would appreciate is the possibility of prefixing all
>>imported properties-tasks-classpaths-etc (all things created in the
>>import) with something to prevent clashes. Maybe namespace?
> 
> 
> If we want to keep it simple - no :-)
> 
> It seems most people believe import will be used only with files
> specifically written for import - if this is the case, and they are able
> to deal with the importing file basename, they should also use prefixes in
> their own properties and tasks. 

It's about having it simple. It's much easier to just tell import to 
prefix all than to have to do it yourself. It's done in other Ant tasks, 
ans it's a common use case.

> Even the current target rewritting seems wrong - instead of coding with
> the mangled names, it would be simpler to just rename the imported targets ( 
> or use prefixed names in the build fragments).
> 
> If this is the conclusion ( and I have to admit - I now agree with Conor and 
> all other that simpler is better, at least for the first iteration of 
> import ) - probably it would make sense to remove the mangling code, we can
> add it in ant1.7 if it proves it is really needed.

I can tell you it is. Fundamental.
I use this import every day. For me, this is Ant 1.7 ;-)

The fact is that import has two functionalities:

  - import targets
  - import *dependencies*

Let me try to explain what this second point means.

If you think that you will be importing targets that don't have a 
depends="", I agree with you, mangling is not needed.

But what I do, is to import a file that has not much functionality, but 
targets that have dependencies.
So I can /redefine/ a target that is already called by other targets, 
since the name is the same!

If I import

  - target compile
  - target package depends=compile

now I can simply redefine

  - target compile

And if I call the target package, it uses the /redefined/ target "compile".

This is a common use-case, and I'd like to retain this functionality.

IMHO *minimal* import functionality is Ok now.

That said, sugar can be added on top of it. Prefixes for example are 
nice sugar (as basedir is for normal ant files, or prefixes in property 
files load).

 From the active usage we've been doing in these months, I can say that 
(VUS= very useful sugar;
  US = useful sugar;
  MUS = marginally useful sugar):

  - (MUS) resolving to basedir for imported tasks
  - (US)  basedir.importedprojectname property
  - (VUS) prefixing imported stuff names

You can take my word for it or use import for three months, you choose ;-)

-- 
Nicola Ken Barozzi                   nicolaken@apache.org
             - verba volant, scripta manent -
    (discussions get forgotten, just code remains)
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message