[GRADLE-940] Provide support for ivy extra attributes Created: 15/May/10  Updated: 02/Apr/14  Resolved: 02/Apr/14

Status: Resolved
Project: Gradle
Affects Version/s: None
Fix Version/s: None

Type: Improvement
Reporter: Kurt Harriger Assignee: Unassigned
Resolution: Duplicate Votes: 8

Issue Links:
Supercedes
Superceded by GRADLE-3060 Cannot resolve artifacts from an ivy ... Resolved

 Description   

http://ant.apache.org/ivy/history/trunk/concept.html#extra

I using extra attributes in .net project for resource artifact culture code.
For example:

<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
<info organisation="com.dts-global" module="Castle-Components-Validator" />
<publications>
<artifact name="Castle.Components.Validator" type="dll" />
<artifact name="Castle.Components.Validator" type="pdb" />
<artifact name="Castle.Components.Validator" type="xml" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="es" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="fr" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="it" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="lt" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="lv" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="mk" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="nl" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="pl" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="pt" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="ru" />
<artifact name="Castle.Components.Validator.resources" type="dll" e:culture="sv" />
</publications>
</ivy-module>



 Comments   
Comment by Hans Dockter [ 07/Jun/10 ]

We will provide hooks where you can manipulate the generated native Ivy module descriptor.

Comment by Detelin Yordanov [ 15/Jun/11 ]

Hi guys,
We are also using extra attributes and it will very useful to us if we can access those on the resolved artifacts as well. At the moment the DefaultResolvedArtifact holds an Ivy Artifact as a private field and exposes only its name, type and extension. Is it possible to extend the ResolvedArtifact to also support accessing the extra attributes?

Comment by Pablo Munoz [ 07/Sep/11 ]

We also use extra attributes and would love this ticket to be implemented. However, we found that anytime you use extra attributes you need to also change the cache pattern to incorporate the additional attributes in order to avoid namespace collisions in cache and thus retrieval of the wrong artifacts. This needs to be a requirement for implementation of ivy extra attributes in gradle.

Here is a sample ivy.xml
<ivy-module version="2.0" xmlns:e="http://ant.apache.org/ivy/extra">
<info organisation="gs" module="sample-project" revision="1.0.0" status="release" />

<dependencies>
<dependency org="com.gs.apgps.test" name="cbk-make-cpp-lib" rev="0.0.1" e:label="SNAPSHOT" e:platform="Linuxx86_64RHEL4" e:variant="Compiler=gcc3" changing="true" >
<artifact name="libhello" ext="so"/>
<artifact name="libhelloHeaders" ext="zip"/>
</dependency>
</dependencies>
</ivy-module>

Here is the ivysettings.xml
<ivysettings>
<caches>
<cache name="areacache" basedir="${ivy.home}/customcache"
ivyPattern="[organisation]/[module]/[platform]/[variant]/ivy-[revision]-[label].xml"
artifactPattern="[organisation]/[module]/[platform]/[variant]/[type]s/[artifact][revision][label].[ext]"/>
</caches>

<settings defaultResolver="chainresolver" overwriteMode="true" />
<resolvers>
<chain name="chainresolver">
<url name="custom_rest_url" changingPattern=".*" m2compatible="false" checksums="" >
<ivy pattern="${repo.root}/producers/[organisation]/packages/[module]/releases/[revision]/builds/[label]/[platform]/[variant]/assets/[module]-ivy.xml" />
<artifact pattern="${repo.root}/producers/[organisation]/packages/[module]/releases/[revision]/builds/[label]/[platform]/[variant]/assets/[artifact].[ext]" />
</url>
</chain>
</resolvers>
</ivysettings>

Comment by Szczepan Faber [ 29/Nov/11 ]

We want to solve it in some way. For example, by enabling manipulation of the output ivy.xml

This issue has been also raised in zendesk by Thomas.

Comment by Stephane Gallès [ 30/Nov/11 ]

To be able to manipulate the ivy.xml could also be a way to handle the missing 'branch' attribute of Ivy, at least for publication of the artifacts.

Comment by Peter Horvath [ 22/Nov/12 ]

We also use Ivy extra attributes, would it be possible to add support for Ivy extra attributes in the DSL as well? We have a requirement where we need to store information in extra attributes in the DSL and have to expose this information in the generated ivy.xml files as well.

Generated at Wed Jun 30 11:42:49 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.