ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Elrod <Tom.El...@onlineinsight.com>
Subject RE: <uptodate> check that srcfile exists
Date Fri, 22 Dec 2000 16:28:51 GMT
The only problem with using the <available> tag is that I can only set one
property per <file>.  I would like to check a directory for several files
and only set the property to true if all files exist.  Is there any way to
nest the list of files (I tried, but didn't seem to work).  

  	<available property="pb.statestore.idl.exists"
file="statestore/NamedValue.java,statestore/StateStore.java" />

Also wondering if there is a way to do an 'or' in the conditionals within a
target?  For example:

<target name="statestore.idl" depends="statestore.exists" unless
="statestore.idl.exists" OR if="statestore.idl.uptodate" >     

I only want to run this target if statestore.idl.exists is false OR
statestore.idl.update is true.

Thanks for you help.

-Tom



>  -----Original Message-----
> From: 	Tom Elrod  
> Sent:	Thursday, December 21, 2000 2:17 PM
> To:	'ant-user@jakarta.apache.org'
> Subject:	<uptodate> check that srcfile exists
> 
> I would like to recompile an IDL file if the IDL file is newer than the
> source it generates, which the sample code below does.  I would also like
> to recompile the IDL file if the source it generates does not exist.
> Anyone have an idea how I would do this?
> 
> <target name="loader.exists" depends="prepare">
> 	<uptodate property="pb.loader.idl"
> 		  targetfile="${srcDir}\infrastructure\loader\Loader.idl" >
> 		  <srcfiles dir="${srcDir}\infrastructure\loader\"
> includes="*Loader*.java,stringArrayH*.java" />
> 	</uptodate>
>  </target>
> <target name="loader.idl" depends="prepare,loader.exists"
> if="pb.loader.idl"  >       
> <exec executable="${idlcmd}" 
> 	dir="source/infrastructure/loader" 
> 	output="idl.log" 
> 	failonerror="true"
> >
>   <arg value="-no_tie"/>
>   <arg value="-no_examples"/>
>   <arg value="-no_comments"/>
>   <arg value="-root_dir"/>
>   <arg value="${srcDir}"/>
>   <arg value="Loader.idl"/>
> </exec>

Mime
View raw message