ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lopez, William" <william.lo...@eds.com>
Subject Conditional (compound) Help Please
Date Thu, 31 Jul 2003 04:57:32 GMT
I have a need for a task that compares a jar to it's "list" of class files
(found uptodate to work fine for the first part of the compare). 

I expect the second compare to never be true when the first is (*to meet the
target execute condition*). The <not> part is not working like I thought (as
a negator)...I tried the <outofdate> task but it always ends up executing
the target...see below, 2nd example.

My scenario:
-There is another task that executes unless="noprefix_uptodate"....this
generates/deploys the ejb jar for the non-jndi prefix ejb
-Then ejb.jar is called (via <antcall> 3x - 1 per other jndi prefixes)...the
only difference between these jars is the jndi prefix

I'm sure there is a clean, simpler way but I can not figure it out. Thanks!
  
  <target name="chk-ejbjndi-notuptodate">
    <condition property="${jndiPrefix}_notuptodate">
       <and>
          <uptodate targetfile="${app.module.dir}\NO_Prefix\${ejb.jar.name}"
>
              <srcfiles dir= "${this.ejb.build.dir}" includes="**/*.class"/>
          </uptodate>
          <not>
            <uptodate
targetfile="${app.module.dir}\${jndiPrefix}\${ejb.jar.name}" >
               <srcfiles dir= "${this.ejb.build.dir}"
includes="**/*.class"/>
            </uptodate>
          </not>
       </and>
    </condition>
    <propertycopy name="jndi_outofdate" from="${jndiPrefix}_notuptodate"
silent="true">
    <echo>${jndiPrefix} notuptodate: ${jndi_property}</echo>
  </target>

 <target name="ejb.jar" depends="chk-ejbjndi-notuptodate"
if="jndi_outofdate">
  ...
 </target>


 ==================== <outofdate> ==============================
<target name="chk-ejbjndi-notuptodate">
     <uptodate property="ejb_uptodate"
targetfile="${app.module.dir}\NO_Prefix\${ejb.jar.name}" >
       <srcfiles dir="${this.ejb.build.dir}" includes="**/*.class"/>
     </uptodate>
     <outofdate property="jndi_notuptodate">
       <sourcefiles>
         <fileset dir="${this.ejb.build.dir}" includes="**/*.class"/>
       </sourcefiles>
       <targetfiles>
         <pathelement
path="${app.module.dir}\${jndiPrefix}\${ejb.jar.name}"/>
       </targetfiles>
     </outofdate>
     <if>
       <and>
         <isset property="ejb_uptodate"/>
         <isset property="jndi_notuptodate"/>
       </and>
      <then>
       <property name="jndi_outofdate" value="true"/>
      </then>
     </if>
     <echo>${jndiPrefix} notuptodate: ${jndi_outofdate}</echo>
  </target>

  <target name="ejb.jar" depends="chk-ejbjndi-notuptodate"
if="jndi_outofdate">
  ...
  </target>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message