Peter Donald <[EMAIL PROTECTED]> wrote:
> At 02:47 27/3/01 +0200, Stefan Bodewig wrote:
>>> or enhance antcall to work with current list of executed targets
>>
>>This is to avoid running targets twice, right? I've no good idea how
>>to solve this ATM.
>
I thought this point was about
<target name="a" depends="shared" />
<target name="b" depends="shared" />
<target name="c">
<antcall target="a" />
<antcall target="b" />
</target>
where shared would be run twice and a simple depends="a,b" in target c
would not guarantee that a has been run before b.
>From your description
> I was thinking that we could use frANTics approach. We store a task
> "stack" [...] . When we climb back into last context (ie antcall
> finishes) the original is still in pristine condition.
It seems the second antcall doesn't know that share has been run by
the first one.
> gah - thats not very clear but do you get the picture?
Of your idea and frANTic's approach, yes. How this would solve the
problem, no ;-)
>>> * define task contexts that define various common aspects
>>> * (logging, failure handling ...) and assign them to tasks.
>>
>>Need more input - on the "and assign" part.
>
> I was thinking something as simple as the following for logging.
>
> interface Task
> {
> void setTaskContext( TaskContext context );
> {
>
> class MyTask
> {
> TaskContext context;
>
> void setTaskContext( TaskContext context )
> {
> this.context = context;
> }
>
> Logger getLogger()
> {
> return context.getLogger();
> }
[...]
wouldn't setTaskContext and getLogger better by part of an abstract
Task (and why should Task be an interface)? But we are getting into
details here.
I thought the request was more something inse build files, along the
lines of
<context id="normal" loglevel="verbose" />
<context id="does.not.work" loglevel="debug" />
<target>
<sometask context="normal" ... />
<someothertask context="does.not.work" ... />
</target>
Stefan