ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nico Seessle" <>
Subject Re: "depends" gets executed before "if"
Date Sat, 02 Sep 2000 09:51:45 GMT
If I understand Ant's behaviour correctly all property-tasks are "executed"
while the build-file is read. regardless of where they are located.

Just tested this - Output of the following buildfile:

<?xml version="1.0"?>
<project name="test" default="default" basedir=".">

  <property name="prop1"   value="Property 1"/>

  <target name="init">
    <property name="prop2" value="Property 2"/>

  <target name="clean">
    <property name="prop3" value="Property 3"/>

  <target name="default">
    <echo message="Properties: ${prop1} ${prop2} ${prop3}"/>



Buildfile: test.xml

Properties: Property 1 Property 2 Property 3


Total time: 0 seconds

So the argument doesn't count based on property's :-)

----- Original Message -----
From: "Kevin Toomey" <>
To: <>
Sent: Friday, September 01, 2000 6:04 PM
Subject: Re: "depends" gets executed before "if"

> Yes, it is a little clumsy, but after thinking about it some more, I
> think I understand why it was done that way.
> If and unless are used to check if a property has been set. Usually
> properties are set during an "init" target. The init target would need
> to run prior to the "if" check.
> Thanks,
> Kevin.

View raw message