ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ingmar Stein" <>
Subject Logic crossed with fail's if attribute
Date Tue, 18 Dec 2001 14:27:26 GMT
Hi all,

the following target

 <target name="check" description="Checks if property file is present">
  <available file="" property=""/>
  <echo message="${}"/>
  <fail message="**** Error: the file is not present ****"

gives this output:


/home/tester/build.xml:21: **** Error: the file is not
present ****

As you can see, the file is present, but the build fails.
It doesn't fail if I replace the "unless" with an "if".
Shouldn't that be the other way around?

I guess one logic is reversed, either mine or it's the following snippet of

    private boolean testIfCondition() {
        if (ifCondition == null || "".equals(ifCondition)) {
            return true;

        return project.getProperty(ifCondition) != null;

    private boolean testUnlessCondition() {
        if (unlessCondition == null || "".equals(unlessCondition)) {
            return true;
        return project.getProperty(unlessCondition) == null;



To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message