Ant if the attribute does not work?

I do not have to understand the attribute correctly unless. I have a properties file that has a property as follows:

module.project.enabled=false
module.finance.enabled=true

And in my Ant build file, I have the following part

<echo message="Finance module enabled is ${module.finance.enabled}"/>
<echo message="Project module enabled is ${module.project.enabled}"/>
<javac srcdir="src" destdir="${classes}" debug="true">
    <classpath>
        <pathelement path="src"/>
        <fileset dir="web/WEB-INF/lib" includes="*.jar"/>
        <fileset dir="lib" includes="*.jar"/>
        <fileset dir="${GWT.HOME}" includes="gwt-user.jar,gwt-servlet.jar"/>
    </classpath>
    <exclude name="bla/finance/*.java" unless="${module.finance.enabled}"/>
    <exclude name="bla/project/*.java" unless="${module.project.enabled}"/>
</javac>

When you run my Ant target, the properties seem to read

 [echo] Finance module enabled is true
 [echo] Project module enabled is false

But when I look at the catalog ${classes}, I would expect to see no classes in the project package and classes in the financial package, but, alas, does this exclude both packages?

+5
source share
1 answer

Ant 1.7 if unless , . . , if false unless. , , false if true unless.

, if unless <exclude>.

+10

All Articles