Ara Abrahamian wrote:
What about this:

<import name="webapp-reusable-targets" file="commonwebappproject.xml"/>

<target name="jar" overrides-target-of="webapp-reusable-targets">

I also like the idea of pre/post targets for targets and tasks, behaves
like extensions points (aspectj style) rather than overriding this way:

<target name="webdoclet-war" pre="web-war">
        <webdoclet ... />

<target name="post-webdoclet-war" pre="web-war">
        <echo>it tooks x seconds to run web-war</echo>

Let us import other build files, point to and depend to targets defined
there, override targets and pre/post targets/tasks and you really can
write reusable reusable build file pieces.

...
From: "Nicola Ken Barozzi" <[EMAIL PROTECTED]>
it hides what is happening and can bring to subtle errors.

Currently the import patch makes you do the above like this (at least this is what makes sense to me):


 <target name="web-war">
   <webdoclet ... />
   <antcall target="super.web-war">
   <echo>it tooks x seconds to run web-war</echo>
  </target>

This is cleaner and gives you more control IMNSHO.

In fact, in your above code, it seems that you have made an error in defining the pres and posts ;-)

 <target name="post-webdoclet-war" pre="web-war">
        <echo>it tooks x seconds to run web-war</echo>

You are saying how much time it took to run web-war after webdoclet-war (post-webdoclet-war) but before web-war (pre="web-war").

 <target name="web-war">
   <webdoclet ... />
   <echo>it tooks x seconds to run web-war</echo>
   <antcall target="super.web-war">
  </target>

Or not?

Do you mean that both have to have web-war run before (pre="web-war") and post-webdoclet-war run after webdoclet-war?

ie:

 <target name="web-war" depends="super.web-war">
   <webdoclet ... />
   <echo>it tooks x seconds to run web-war</echo>
  </target>

See, pres and posts are really confusing, and overriding is much cleaner.

--
Nicola Ken Barozzi                   [EMAIL PROTECTED]
            - verba volant, scripta manent -
   (discussions get forgotten, just code remains)
---------------------------------------------------------------------


-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>



Reply via email to