ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: [DISCUSS] EasyAnt: Ant based pre packaged build system for java projects
Date Tue, 15 Jan 2008 05:25:47 GMT
Wolfgang Häfelinger <whaefelinger@epo.org> writes:

> Why not simply:
>
> <!-- === framework === -->
> <target name="foo" depends="bar,baz" description="public foo target">
>   <foo /> 
> </target>
>
> <macrodef name="foo" >
>   <sequential>
>     <!-- to the foo thing -->
>   </sequential>
> </macrodef>
>
>
> If a user then really need to override "foo", he or she would simply
> write in build.xml something like
>
>
> <macrodef name="foo">
>   <sequential>
>     <echo> before original foo ..</echo>
>  
>     <c:foo />       <!-- assume framework in NS "c" />
>
>     <echo> after original foo .. </echo>
>   </sequential>
> </macrodef> 

Can you do <c:foo/> without changes to Ant?

The problems I see with this:

* not idiomatic (no real problem, though)

* requires all targets to consist of a single macro definition

* becomes repetetive with little chance for reuse

  Say I'd like to perform the same action before more than one target

  <target name="my-before" before="foo,bar,baz">
    <do-something/>
  </target>

  instead of

  <macrodef name="foo">
    <sequential>
      <do-something/>
      <c:foo/>
    </sequential>
  </macrodef>
  <macrodef name="bar">
    <sequential>
      <do-something/>
      <c:bar/>
    </sequential>
  </macrodef>
  <macrodef name="baz">
    <sequential>
      <do-something/>
      <c:baz/>
    </sequential>
  </macrodef>

* doesn't factor into the dependency calculation

  taking the example from above, if all three targets foo, bar and baz
  were executed in the same build, the dependencies of my-before would
  only be executed once.

Stefan

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message