Michael J McGonagle wrote: > > Hello all, > > I am working with trying get target execution based on the files > timestamp. According to what I read about 'uptodate', this is what I > should need.
I moved all of the properties and the 'uptodate' task into an 'init' target, and that part seems to work now, I get the proper results from running the file twice. The first time it tells me that the "TargetFile" is not there to it does not set the property. The second time it tells me that the file IS there so it sets the attribute to 'true'. Ok, now the rub, I put an 'unless' clause in my target that created the file I am testing for, but it still executes both times. Am I reading something wrong? Should I be using an 'if' instead? I attached my updated file again, Thanks, Mike
<project name="test" default="audio"> <target name="init"> <property name="sfront" value="sfront" /> <property name="filename" value="bach" /> <property name="saolfile" value="${filename}.saol" /> <property name="saslfile" value="${filename}.sasl" /> <property name="midifile" value="${filename}.mid" /> <property name="mp4file" value="${filename}.mp4" /> <property name="aoutfile" value="${filename}.wav" /> <property name="aoutmode" value="-aout ${aoutfile}" /> <property name="ainmode" value="" /> <property name="cc" value="gcc" /> <property name="c_exec" value="${filename}" /> <property name="c_optim" value="-O3" /> <property name="cflags" value="${c_optim}" /> <property name="iolink" value="" /> <property name="redirect" value="" /> <uptodate property="aoutfile_exsists" targetfile="${aoutfile}"> <srcfiles dir="." includes="${saolfile}, ${saslfile}, ${midifile}" /> </uptodate> </target> <target name="audio" depends="init" unless="${aoutfile_exsists}"> <exec executable="${sfront}"> <arg line="${aoutmode} ${ainmode} -orc ${saolfile} -sco ${saslfile} -midi ${midifile} -o ${c_exec}.c" /> </exec> <exec executable="${cc}"> <arg line="${cflags} ${c_exec}.c -lm ${iolink} -o ${c_exec}" /> </exec> <exec executable="./${c_exec}"> <arg line="${redirect}" /> </exec> </target> </project>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>