ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 6186] New: - Provide 'if' task to handle multiple targets
Date Fri, 01 Feb 2002 16:57:14 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6186>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6186

Provide 'if' task to handle multiple targets

           Summary: Provide 'if' task to handle multiple targets
           Product: Ant
           Version: 1.4.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: dstolz@eclipsenetworks.com


I want to use the same build.xml to build for either JBoss for Sun's J2EE RI.
Currently, I do the following to achieve the effect I want.

    <target name="pick-j2ee">
        <condition property="use.jboss24">
              <equals arg1="${j2ee.type.env}" arg2="JBOSS24" />
        </condition>
        <condition property="use.sunref">
              <equals arg1="${j2ee.type.env}" arg2="SUNREF" />
        </condition>
    </target>

    <target name="construct-classpath" depends="pick-j2ee,use-jboss24,use-sunref">
    </target>
    <target name="use-jboss24" if="use.jboss24" depends="build-jboss24">
        <available property="classpath_id" value="base.path_jboss24"
file="${jboss.dist}/client/jboss-j2ee.jar" />
        <property name="j2ee.dist" value="${jboss.dist}" />
    </target>

    <target name="use-sunref" if="use.sunref" depends="build-sunref">
        <available property="classpath_id" value="base.path_sunref"
file="${sunref.dist}/lib/j2ee.jar" />
        <property name="j2ee.dist" value="${sunref.dist}" />
    </target>

I would very much like to be able to do the following:
    <target name="construct-classpath">
        <condition>
              <equals arg1="${j2ee.type.env}" arg2="JBOSS24" />
              <available property="classpath_id" value="base.path_jboss24"
file="${jboss.dist}/client/jboss-j2ee.jar" />
              <property name="j2ee.dist" value="${jboss.dist}" />
        </condition>
        <condition property="use.sunref">
              <equals arg1="${j2ee.type.env}" arg2="SUNREF" />
              <available property="classpath_id" value="base.path_sunref"
file="${sunref.dist}/lib/j2ee.jar" />
              <property name="j2ee.dist" value="${sunref.dist}" />
        </condition>
    </target>

In a general sense, I'd like the Condition task to do more than set one
property.  It would be nice if you could perform any task just like target. 
Alternatively, target could be controlled by condition instead of just if and
unless.

--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message