Bonjour,
J'ai une cible ant qui doit transformer des fichiers XCF en PNG en appelant la commande "convert".
Je souhaite que cette cible ne s'exécute que si les fichiers sources (c'est-à-dire les fichiers XCF) ont changé.
J'ai essayé avec la tâche ant "uptodate" mais ça ne fonctionne pas.
À chaque fois que je lance ant, la commande "convert" est appelée.
Une idée ?
Merci.
Voici mon fichier build.xml:
Voici le résultat dans la console :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24 <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>
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13 $ 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
Partager