DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44315>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44315

           Summary: if and unless don't work
           Product: Ant
           Version: 1.7.0RC1
          Platform: All
        OS/Version: Windows XP
            Status: NEW
          Severity: major
          Priority: P2
         Component: Core
        AssignedTo: [email protected]
        ReportedBy: [EMAIL PROTECTED]


Here's a build.xml file.  I have two targets, only one of which should be
executed depending on whether the project is named "thin".  The same target gets
executed regardless of what the project is:

<?xml version="1.0"?>

<project name="apps" default="all" basedir=".">

        <property name="vendor.lib" value="${basedir}/../vendor/vendor-lib" />
        <property name="common.lib" value="${basedir}/../components/common-lib" 
/>
        <property name="build.file" value="build.xml" />
        <property name="thin" value="thin" />

        <target name="all">
                <antcall target="check-project">
                        <param name="project" value="${thin}" />
                </antcall>
                <antcall target="check-project">
                        <param name="project" value="not-thin" />
                </antcall>
        </target>

        <target name="clean">
                <antcall target="clean-project">
                        <param name="project" value="${thin}" />
                </antcall>
        </target>

        <target name="check-project">
                <echo message="CHECKING ${project}" />
                <uptodate property="${project}.buildNotRequired"
targetfile="${project}/dist/${project}.jar">
                        <srcfiles dir="${project}/src" includes="**/*.java" />
                </uptodate>
                <antcall target="build-project">
                        <param name="project" value="${project}" />
                </antcall>
        </target>

        <target name="build-project" unless="${project}.buildNotRequired">
                <echo message="BUILDING ${project}" />
                <echo message="thin = ${thin}, project = ${project}" />
                <condition property="buildingThin">
                        <equals arg1="${thin}" arg2="${project}" />
                </condition>

                <echo message="buildingThin = ${buildingThin}" />
                <antcall target="build-project-not-thin">
                        <param name="project" value="${project}" />
                </antcall>
                <antcall target="build-project-thin">
                        <param name="project" value="${project}" />
                </antcall>
        </target>

        <target name="build-project-thin" if="${buildingThin}">
                <echo message="Building thin" />
                <!--
                <ant antfile="${project}/${build.file}" target="ear" 
inheritall="false" >
                        <property name="vendor.lib" value="${vendor.lib}"/>
                        <property name="common.lib" value="${common.lib}"/>
                </ant>
                -->
        </target>

        <target name="build-project-not-thin" unless="${buildingThin}">
                <echo message="Building not thin" />
                <!--
                <ant antfile="${project}/${build.file}" target="ear" 
inheritall="false" >
                        <property name="vendor.lib" value="${vendor.lib}"/>
                        <property name="common.lib" value="${common.lib}"/>
                </ant>
                -->
        </target>

        <target name="clean-project">
                <echo message="CLEANING ${project}" />
                <ant antfile="${project}/${build.file}" target="clean" 
inheritall="false" />
        </target>

</project>

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

Reply via email to