Hi everybody,

first of all I want to appologize to those who might consider this email as
a spam.

Lately I have been thinking on the future of Ant, and I would like to share
with you my vision on
the matter (maybe about Ant 2.0). The way I see targets is like methods. And
the way I see
build.xmls is like classes. So could it be possible that it looks like some
of the following:

=================================================================
<project name="Test" default="main" inherits="../../base-build.xml">

<target name="init" depends="">
   <!--The init target overrides the init from the base-build.xml and
changes the value of the property -->
  <property name="version" value="1.0"/>
</target>

<target name="print" accepts="version, args...">
   <echo message="version"/>
   <loop over="$.{args}" id="i">
      <echo message="$.{args}[i]"/>
   </loop>
</target>

<target name="print" depends="init">
   <!-- First execution -->
   <ant antfile="" target="init('version', {'first', 'second'})"/>

   <!-- Second execution-->
   <target name="init (${version}, NIL)"/>
</target>

</project>
=================================================================

Now I know that one can achieve this with the current status of Ant, but
this is just a hint how it
can be done more flexible. There are a couple of things I would like to
highlight here:
0) The inheritance of build.xmls, and mutability of properties from the
inheritance.
1) The way one target calls the other one and passes certain values, not all
the values by setting inheritAll="true"
2) The new target task, which is flexble enough for target invocation.

Once again, I know that one can use some code implemented in Groovy or
JavaScript (for instance) to achieve
this, but this is one of my visions for the future of Ant.

What are yours?

-- 
Regards, Petar!
Karlovo, Bulgaria.
- - - - - - - -
| Author @ Manning Publications.
| Technical Consultant @ HP
| BGJUG-Bulgarian Java User Group Leader.
| Apache Jakarta PMC member.
| Jakarta Cactus Lead Developer.
| Blogger: http://weblogs.java.net/blog/paranoiabla/
- - - - - - - -
Public PGP Key at:
https://keyserver1.pgp.com/vkd/DownloadKey.event?keyid=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

Reply via email to