Patch all eclipse deps to use a strict version

dev/0.11
modmuss50 2021-06-16 23:16:44 +01:00
parent b4cd38a287
commit 147af48879
1 changed files with 21 additions and 0 deletions

View File

@ -97,6 +97,7 @@ dependencies {
// Mercury pulls all of these deps in, however eclipse does not specify the exact version to use so they can get updated without us knowing. // Mercury pulls all of these deps in, however eclipse does not specify the exact version to use so they can get updated without us knowing.
// Depend specifically on these versions to prevent them from being updated under our feet. // Depend specifically on these versions to prevent them from being updated under our feet.
// The POM is also patched later on to as this strict versioning does not make it through.
implementation ('org.eclipse.jdt:org.eclipse.jdt.core:[3.21.0]') implementation ('org.eclipse.jdt:org.eclipse.jdt.core:[3.21.0]')
implementation ('org.eclipse.platform:org.eclipse.compare.core:[3.6.1000]') implementation ('org.eclipse.platform:org.eclipse.compare.core:[3.6.1000]')
implementation ('org.eclipse.platform:org.eclipse.core.commands:[3.9.800]') implementation ('org.eclipse.platform:org.eclipse.core.commands:[3.9.800]')
@ -196,6 +197,18 @@ import org.w3c.dom.Document
import org.w3c.dom.Element import org.w3c.dom.Element
import org.w3c.dom.Node import org.w3c.dom.Node
def patchPom(groovy.util.Node node) {
node.dependencies.first().each {
def groupId = it.get("groupId").first().value().first()
// Patch all eclipse deps to use a strict version
if (groupId.startsWith("org.eclipse.")) {
def version = it.get("version").first().value().first()
it.get("version").first().value = new groovy.util.NodeList(["[$version]"])
}
}
}
publishing { publishing {
publications { publications {
plugin(MavenPublication) { publication -> plugin(MavenPublication) { publication ->
@ -207,6 +220,10 @@ publishing {
artifact sourcesJar artifact sourcesJar
artifact javadocJar artifact javadocJar
pom.withXml {
patchPom(asNode())
}
} }
// Also publish a snapshot so people can use the latest version if they wish // Also publish a snapshot so people can use the latest version if they wish
@ -219,6 +236,10 @@ publishing {
artifact sourcesJar artifact sourcesJar
artifact javadocJar artifact javadocJar
pom.withXml {
patchPom(asNode())
}
} }
// Manually crate the plugin marker for snapshot versions // Manually crate the plugin marker for snapshot versions