ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject Re: ANT semantics and power
Date Mon, 28 Feb 2000 21:02:43 GMT
>   As has now been noted a couple of times, there are two issues here.  One
> is ANT's basic semantics and the second is how powerful the language is
> made.

Ant is not a language. If you want a programming language - fine, you can
use Ant tasks. Just don't call it ant.

>   <target name="myInit">
>     <echo message="Init is running"/>
>     <property name="inited" value="I've been inited"/>
>   </target>

Wrong use of property and ant. You use it as a programming language, it's
not a variable, property is used to define constants. Since it's a
constant it can be set anytime.( and must be set before anything else is
executed )

> According to the properties at the time main is run, neverRun has been
> executed and myInit has not.  This is exactly the opposite of what I would
> expect given the dependancies and what has happened as far as the other
> messages are concerned.

Not if you treat property as a constant.

> Another possible solution is to move all property setting out of the
> targets.  This removes the expectation that it will be executed in 'target
> order'.  I gather from one of the recent posts that this is the way things
> once were and this might explain the current strange semantics.

True. Add a feature and people will start using it ( sometimes in a wrong

> If that is the case then I humbly submit that you've already gone too far.
> ANT is already turing complete if people can define their own tasks.  (I
> could define a few new tasks, namely fixedProperty, while and if.  By
> defining createIf, createWhile and createFixedproperty these can already
> take themselves as sub-tasks.  That's all I need.  It isn't very useful,
> but it demonstrates the turing completeness.)

Why don't you use Make then ? Or JMK or any other build tool ?

Ant was not designed as a programming language ( procedural or
functional), but as a tool. We want to keep it simple.

Keep in mind that ant is not the current XML format - the collection of  
tasks is far more important ! You can use the tasks from a different
framework ( without even using XML !) - you still get the full
functionality of ant. 


View raw message