> From: Yves Martin [mailto:[EMAIL PROTECTED] > > > Stefan Bodewig <[EMAIL PROTECTED]> writes: > > > On Mon, 13 Dec 2004, Yves Martin <[EMAIL PROTECTED]> wrote: > > > >> To clean it, I decided to use project references but it does not > >> work with 'antcall': > > > > This is because you set the reference in a different > Project instance > > than you try to read it in. > > > >> target A > >> antcall B > >> MyTask{getReference X} > >> > >> target B > >> MyTask{setReference X} > >> > >> Is there a better way to implement a global storage ? > > > > Option (1) don't use antcall at all. > > I think it is impossible. My target A looks like to: > > target A > Job before > Loop { antcall B } > MyTask{getReference X} >
You may want to take a look at the <for/> task in antcontrib which uses a <macro> for the content of the loop. > What I may do is to create my own 'call' task that calls a > target in the same project (as depends attribute does I > guess). Is it a good idea ? > > > Option (2) use a Map as your global storage and set this one as > > reference before invoking antcall (with inheritrefs=true) and have > > MyTask not set the reference in the project, but add it to > your global > > storage. > > I will try that also. > > > This also requires you Map to be not Cloneable since > otherwise B will > > only see a copy of your global storage and be unable to > write to it. > > Ant tries its best to make it hard for "subbuilds" to affect their > > "parent build". > > Yes, I understand that perfectly. > > Regards > -- > Yves Martin > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]