Slackbot
09/08/2022, 1:50 PMCristianGM
09/08/2022, 1:51 PMimplementation(lib)
configurations.compileClasspath {
resolutionStrategy {
eachDependency {
if (requested.group == "io.ktor") {
throw RuntimeException("KTOR FOUND!")
}
}
}
}
CristianGM
09/08/2022, 1:53 PMThomas Broyer
09/08/2022, 2:33 PMimplementation(lib)
in B, then the compileClasspath
in A won't have lib
in it (that's the point of api
vs implementation
). Maybe just check runtimeClasspath
instead?CristianGM
09/08/2022, 2:34 PMThomas Broyer
09/08/2022, 2:52 PMversion { rejectAll() }
? (wouldn't work for a groupId only, requires an artifactId too)CristianGM
09/08/2022, 2:59 PMCristianGM
09/09/2022, 7:43 AMCristianGM
09/09/2022, 8:14 AMconfigurations.default {
resolutionStrategy {
eachDependency {
if (requested.group == "io.ktor") {
throw RuntimeException("KTOR FOUND!")
}
}
}
resolve()
}
but I'm terrifiedCristianGM
09/09/2022, 8:31 AMassemble
is not resolving itThomas Broyer
09/09/2022, 9:13 AMuseRuntimeClasspathVersions()
would resolve it whenever the compile classpath needs to be resolved; but that kind of resolution consistency might not be what you want…CristianGM
09/09/2022, 9:14 AMresolve()
Thomas Broyer
09/09/2022, 9:14 AMproject(B)
dependency in such a way that its runtimeElements
variant is always used (rather than the apiElements
variant)CristianGM
09/09/2022, 9:17 AMCristianGM
09/09/2022, 9:18 AMdependencies {
implementation(project("B"))
Thomas Broyer
09/09/2022, 9:29 AMimplementation(project("B")) {
attributes {
attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage.JAVA_RUNTIME))
}
}
(no idea if that would actually work though!)CristianGM
09/09/2022, 9:31 AM