How to update
Version in Ivy xml generated in Gradle ?
Solution:
In Gradle it
uses groovy scripting API.
So think like groovy
guy .
To update this Ivy
XML::
- Go to Interface IvyPublication
- Go to Method > IvyPublication>descriptor
- Where descriptor takes IvyModuleDescriptorSpec
- Go to above interface, u will find wihXML which returns XMLProvider
- XMLProvider has asNode() method which returns Root node.
Usage :
publishing {
publications
{
Ivy(IvyPublication)
{
organisation
"$project.group"
module
"$project.name"
revision
"$project.version"
from
components.java
descriptor.withXml
{
asNode().info[0].appendNode("description",
project.name)
asNode().dependencies.dependency.findAll{
it.@org.startsWith("com.group")}.each{ it.@rev =
"$project.version" }
}
}
}
repositories {
mavenLocal()
}
}
No comments:
Post a Comment
Please comment here