Hello,

I have a target that transforms files XCF into PNG by calling the "convert" 
command.
I would like that this target does not execute if source files (i.e., the XCF 
files ) have changed.
I have tried with the "uptodate" task but it does not work.
Each time I run ant, the "convert" command is called.

Any idea ?

Thank you.
Best regards.

This is my build.xml file:
<project name="xcf2png" default="png">
        <target name="png-check">
                <uptodate property="png-uptodate" targetfile="png/**.*.png">
                        <srcfiles dir= "xcf" includes="**/*.xcf"/>
                </uptodate>
        </target>
        <target name="png" depends="png-check" unless="png-uptodate">
                <mkdir dir="png"/>
                <exec executable="convert">
                        <arg value="-verbose"/>
                        <arg value="-alpha"/>
                        <arg value="on"/>
                        <arg value="-background"/>
                        <arg value="none"/>
                        <arg value="-layers"/>
                        <arg value="merge"/>
                        <arg value="xcf/icon.xcf"/>
                        <arg value="png/icon.png"/>
                </exec>
        </target>
        <target name="clean">
                <delete dir="png"/>
        </target>
</project>

This is the result in the console:
$ ant
Buildfile: /home/yugiohjcj/xcf2png/build.xml

png-check:

png:
     [exec] xcf/icon.xcf[0] XCF 32x32 32x32+0+0 8-bit sRGB 1.21KB 0.000u 
0:00.000
     [exec] xcf/icon.xcf[0] XCF 6x21 6x21+13+6 8-bit sRGB 0.000u 0:00.000
     [exec] xcf/icon.xcf=>png/icon-0.png[0] XCF 32x32 32x32+0+0 8-bit sRGB 1c 
255B 0.000u 0:00.089
     [exec] xcf/icon.xcf=>png/icon-1.png[1] XCF 6x21 6x21+13+6 8-bit sRGB 3c 
299B 0.000u 0:00.160

BUILD SUCCESSFUL
Total time: 0 seconds

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

Reply via email to