Le 9 nov. 2010 à 17:39, Dominique Devienne a écrit : > On Tue, Nov 9, 2010 at 10:34 AM, Dominique Devienne <ddevie...@gmail.com> > wrote: >> The reason I'm a little reluctant on <bindtargets> is that it's a task >> that affects the dependency graph of targets, but bypassing the normal >> means to do that, via <target>. Since it's a task, it can be run at >> any time, conditionally or not, inside a target or not, and especially >> after the dependency graph was computed, when it does/can change the >> dependency graph. Maybe that's OK, but it just make me a little >> uncomfortable and I'm not sure we see all the possible ramifications. > > From the doc you just checked in, I now read: > > +<p>The bindtargets task may only be used as a top-level task. This means that > +it may not be used in a target.</p> > > So maybe I was wrong. I didn't see the code enforcing that though? > What prevents this task from being inside a target?
I have to admit I have blindly trusted the existing code in ImportTask.java. In the execute there is: if (getOwningTarget() == null || !"".equals(getOwningTarget().getName())) { throw new BuildException("import only allowed as a top-level task"); } > PS: Checking the doc with the code might have avoided some confusion ;) I know I am quite slow, probably doing to much multitasking. Further more when I am dumb enough to forgot to commit them... :p Nicolas, learning to be an actual ant committer --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org For additional commands, e-mail: dev-h...@ant.apache.org