Ant : MacroDef et Condition
Bonjour,
Je cherche à conditionner un appel de target ant depuis une trâche macrodef externe tel que :
Code:
1 2 3 4 5 6 7 8 9
|
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="glcore_buildcallbacks">
<macrodef name="glcore_before_build" description="retrieve dependencies with ivy">
<sequential>
<ant antfile="${ext.glcore.path}/buildcallbacks-ivy.xml" target="useIvy" />
</sequential>
</macrodef>
</project> |
Appelle la tache useIvy dans un composant extérieur
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="glcore_buildcallbacks_ivy">
<property file="${ext.glcore.path}/deploy.properties" />
<target name="useIvy" if="${build.with.ivy.repo}">
<echo message="Using Ivy glcore" />
<ivy:settings file="${ext.glcore.path}/ivysettings.xml" />
<ivy:resolve file="${ext.glcore.path}/ivy.xml" haltonfailure="false" />
<ivy:retrieve pattern="${ext.glcore.path}/lib/[artifact]-[revision].[ext]" haltonfailure="false" />
<property name="ext.glcore.additionalclasspath" value="lib/**.jar" />
<echo message="I do before compile with classpath: ${ext.glcore.additionalclasspath}" />
</target>
</project> |
Cependant je suis embêté car je ne souhaite pas que la condition soit sur l’exécution de la target "useIvy" du fichier 2 mais que ce soit l'appel à la tâche elle même qui soit conditionné.
Après différentes recherche, je n'ai pas réussi à faire cela.
Quelqu'un peut m'aider ?