I plan on using extra attributes in the ivy.xml files in an attempt to be able to get access to the revision number parts, which I need to do so that I can then use those values for the resolver pattern in the ivysettings.xml file:
<ivy-module version="2.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:e="http://ant.apache.org/ivy/extra" xsi:noNamespaceSchemaLocation="http://ant.apache.org/ivy/schemas/ivy.xsd">
<info organisation="MyCompany" module="MyModule" revision="1.2.3.4" e:shortrev="1.2.3" e:buildnum="4" publication="20120207140052" />
...
</ivy-module>
I want to dynamically update the shortrev and buildnum extra attribute during the build so that when this module gets published their values will be saved with it and also so that I can use those extra attributes in the ivysettings.xml file for the resolver pattern.
<resolvers>
<filesystem name="fs.resolver">
<ivy pattern="${my.dir}/[organisation]/[module]/[shortrev]/[buildnum]/ivy.xml" />
<artifact pattern="${my.dir}/[organisation]/[module]/[shortrev]/[buildnum]/[artifact].[ext]" />
</filesystem>
</resolvers>
It was suggested that I could try to use properties within the Ivy file to dynamically set their values, but I'm not clear on how to go about doing that.
This example uses the standard buildnumber task from ANT. Unfortunately the ivy buildnumber task will not resolve properly for modules with extra attributes in the resolver definition :-(
Example
ivy.xml
Notes:
build.xml
Notes:
ivysettings.xml
Notes: