On Mon, 7 Apr 2008, Xavier Hanin <[EMAIL PROTECTED]> wrote: >On Mon, Apr 7, 2008 at 4:48 PM, Stefan Bodewig <[EMAIL PROTECTED]> wrote: > >> On Mon, 7 Apr 2008, Xavier Hanin <[EMAIL PROTECTED]> wrote: >> >> > On Mon, Apr 7, 2008 at 2:22 PM, Stefan Bodewig <[EMAIL PROTECTED]> >> wrote: >> >> >> Extends and Use >> >> =============== >> >> >> >> I'm not sure I fully grasp the difference. Currently we prefix >> >> target names as well, just in addition, don't we? >> > >> > Yes, but this is not enough. Imagine you have two files like this: >> > moduleA.xml: >> > <target name="init" /> >> > <target name="run" depends="init" /> >> > >> > moduleB.xml: >> > <target name="init" /> >> > <target name="test" depends="init" /> >> > >> > Then if you import both, and execute the "test" target, you can't be >> > sure the init target of the same build file will be executed. It >> > depends on the order in which the files are included. >> >> in moduleB.xml you'd rather say <target name="test" >> depends="moduleB:init"/> should work with import today. > > Yes, but then you have to always think about prefixing your target > dependencies in B.
Well, sometimes you really need to be sure that it is "your" target that gets executed and in other cases you really want others to be able to override that target. OK, I think I now start to see where you are heading. <use> would preclude the "I want to allow overriding" completely, you'd have to use <extend> in that case. Makes sense. >> >> Does phase mapping come from a specific use-case? >> > >> > Not really, it's inspired by configuration mapping in Ivy, which is >> > a key of integration of modules developped by different people at >> > different time. >> >> Right now it is confusing me and I'd rather want to understand when it >> would be useful. >> >> > The same can apply to build modules development, and phase mapping >> > can help to integrate pretty different build modules. >> >> Do you have an example for dumb me 8-) > > Let's say that I have a module A which has been designed to be used > with 2 phases: generate, compile module B from another organization > has been designed to be used with 5 phases: generate-src, > compile-src, generate-test, compile-test and test > > If I want to integrate both modules in one build, I may choose to define 5 > phases (the same as for module B), and map generate to generate-src and > compile to compile-src when using module A. > > Does it make sense? It does, thanks. >> > It's also useful if you want to execute some targets at a different >> > than what they were designed to be, giving more control to the build >> > integrating the build modules. >> >> Where do you expect this flexibility to be required? > > I think one of the key aspect of the build system I'm thinking about > is flexibility. If you don't need something flexible, you should > better use maven, because it exists. Ouch, point taken 8-) There certainly are two sides to that coin, though. If it is too flexible it becomes unusable. As long as our defaults are OK that might work. I'm just a bit careful of flexibility for flexibilties sake. If you can explain to me why it is needed (and you did), I'll no longer challenge it. Stefan --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]