ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lopez, William" <william.lo...@eds.com>
Subject Uptodate-if-unless question
Date Thu, 17 Jul 2003 14:35:08 GMT
  My question...If a property is set via an <uptodate> in a target isn't it
available to the entire build [file]?

We have the same EJB jars used with 4 different jndi names for 4 clients (4
jndi names x 18 EJB projects x 4 clients = 288 calls to the deploy tool).
Since the only difference is the ibm-ejb-jar-bnd.xmi file I want to reduce
the deploy tool call for each client to 1 and just manipulate the xmi file
for the other jndi names then update the jar with the new xmi file.

1. Desired target call path if there are new classes/xml/xmi files in the
EJB directories (the ejb_uptodate property *would* be set):
  [start] generate.ejb.jars -> compile -> ejb.jar.noprefix (jndi1) ->
deploy.ejb.jar -> chk-ejb-uptodate
           -> ejb.jar (jndi2) -> prep.ejb.jar
             -> ejb.jar (jndi3) -> prep.ejb.jar
              -> ejb.jar (jndi4) -> prep.ejb.jar [finish]

2. Desired target call path if there are NO new classes/xml/xmi files in the
EJB directories (the ejb_uptodate property *would not* exist):
  [start] generate.ejb.jars -> compile -> ejb.jar.noprefix (jndi1) ->
deploy.ejb.jar
           -> chk-ejb-uptodate (ejb_uptodate property would not be set)
            -> ejb.jar (jndi2)(skips target, if="ejb_uptodate")
             -> ejb.jar (jndi3)(skips target, if="ejb_uptodate")
              -> ejb.jar (jndi4)(skips target, if="ejb_uptodate")

...BUT the nested <antcall> in ejb.jar,prep.ejb.jar, is still called. I'm
sure it is something silly but I can't figure it out. The pertinent target
shells are below:

  <target name="ejb.jar.noprefix">
    ...
  	<antcall target="deploy.ejb.jar">  
       <param name="PrefixType" value="NO_Prefix" />
    </antcall>
  </target>

  <target name="prep.ejb.jar">
      ...
  </target>

  <target name="ejb.jar" if="ejb_uptodate">
      <antcall target="prep.ejb.jar">
       <param name="jndiPrefix" value="NO_Prefix" />
      </antcall>
      ...
  </target>

  <target name="chk-ejb-uptodate">
    <uptodate property="ejb_uptodate"
targetfile="${app.module.dir}\${PrefixType}\${ejb.jar.name}" >
      <srcfiles dir= "${this.ejb.build.dir}"
includes="**/*.class,**/*.xml,**/*.xmi"/>
    </uptodate>
  </target>

  <target name="deploy.ejb.jar" depends="chk-ejb-uptodate"
unless="ejb_uptodate">
    <echo>...Generating deploy code for ${ant.project.name}</echo>
    <mkdir dir="${app.module.dir}\${PrefixType}" />
    ...
  </target>

  <target name="generate.ejb.jars"  depends="compile">
     <!-- Generate different ejb jar base on jndi prefix. -->
     <antcall target="ejb.jar.noprefix"/>
     
     <antcall target="ejb.jar">
       <param name="jndiPrefix" value="aux" />
     </antcall>
     <antcall target="ejb.jar">
      <param name="jndiPrefix" value="rules" />
     </antcall>
     <antcall target="ejb.jar">
      <param name="jndiPrefix" value="complexRules" />
     </antcall>     
  </target>

Thanks,
-Will

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


Mime
View raw message