You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by bu...@apache.org on 2002/02/01 17:57:14 UTC

DO NOT REPLY [Bug 6186] New: - Provide 'if' task to handle multiple targets

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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>