Le vendredi 12 décembre 2008, Ghadi Mahmoudi a écrit :
> Hello,
>
> Is there alread a Task, which is able to read values from manifest file
> (in a JAR)?
>
> I prefer to avoid the long way of 1. unzip the JAR and 2. read the
> value.
>
> thanks,
>
Not directly, but why not just make a macro? Like in (NOTE: this example makes
use of ant-contrib, for <var>):
<property name="tmpdir" location="some/where/under/basedir"/>
<var name="value-from-manifest"/>
<macrodef name="read-from-manifest">
<attribute name="jar"/>
<attribute name="attr"/>
<sequential>
<unjar src="@{jar}" dest="${tmpdir}">
<patternset includes="META-INF/MANIFEST.MF"/>
</unjar>
<!--
Then do what's necessary to fill $value-from-manifest
with the value of @attr; the manifest will be in
${tmpdir}/META-INF/MANIFEST.MF
-->
</sequential>
</macrodef>
--
Francis Galiegue
ONE2TEAM
Ingénieur système
Mob : +33 (0) 6 83 87 78 75
Tel : +33 (0) 1 78 94 55 52
[email protected]
40 avenue Raymond Poincaré
75116 Paris
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]