Open Fuyukai opened 1 year ago
Actually, another option is (in a repository) disable Gradle module metadata with
metadataSources {
mavenPom()
ignoreGradleMetadataRedirection()
}
but this breaks dep resolution in a third way (RFG deps usually depend on the dev
classifier). This could be fixed on this side though by forcibly stripping the dev
classifier from transistive dependencies.
Adding a repository like this:
repositories {
maven {
url = uri("http://jenkins.usrv.eu:8081/nexus/content/groups/public/")
isAllowInsecureProtocol = true
metadataSources {
mavenPom()
ignoreGradleMetadataRedirection()
}
}
}
and then forcing dependency selection like this (buildscript syntax):
configurations.all {
resolutionStrategy.eachDependency {
artifactSelection {
if (this.hasSelectors() && requestedSelectors.any { it.classifier == "dev" }) {
withoutArtifactSelectors()
selectArtifact(DependencyArtifact.DEFAULT_TYPE, null, null)
}
}
}
}
will correctly force SRG dependencies instead.
If you try adding an dependency compiled using RFG with
modImplementation
and co, you'll get two wrong behaviours depending on version:7.6 (or lower, presumably): Gradle complains about variant mismatch. 8.3: Gradle brings in the wrong type of dependency automatically.
The solution for both is this incantation:
Unfortunately, this then breaks dependency resolution (thanks, RFG). Not sure what to do about this, but it's broken either way, so I guess pick the less broken option?