Niels Doucet
08/30/2024, 2:43 PMimplementation(variantOf(libs.myLib) { classifier("myClassifier") })
How can I do the same inside the dependencies block of a JvmTestSuite?Vampire
08/30/2024, 3:43 PMimplementation(project.dependencies.variantOf(libs.myLib) { classifier("myClassifier") })Vampire
08/30/2024, 3:45 PMimplementation(libs.myLib) {
artifact {
classifier = "myClassifier"
}
}
?Vampire
08/30/2024, 3:46 PMNiels Doucet
09/01/2024, 10:52 AMVampire
09/01/2024, 8:34 PMvariantOf conveniently in there.Justin Van Dort
09/06/2024, 7:17 PMVampire
09/06/2024, 7:20 PMvariantOf should be deprecated then?
Or is it able to do other things you cannot achieve otherwise right now?
If the latter, then how would you do those things in the new dependencies blocks?Justin Van Dort
09/06/2024, 7:22 PMJustin Van Dort
09/06/2024, 7:23 PMJustin Van Dort
09/06/2024, 7:23 PMVampire
09/06/2024, 7:27 PMJustin Van Dort
09/06/2024, 7:28 PMJustin Van Dort
09/06/2024, 7:28 PMNiels Doucet
09/07/2024, 5:29 PMimplementation(libs.myLib) {
artifact {
classifier = "myClassifier"
}
}
correct?Vampire
09/07/2024, 5:33 PMorg.wildfly:wildfly-dist this might be what you want (besides that there it is the extension you need to change not the classifier, but principle stays the same).
But if it really is a feature variant that is represented by that classified artifact it would be cleaner to model it as feature variant, either in the original project, or ad-hoc.Niels Doucet
09/09/2024, 7:09 AMVampire
09/09/2024, 7:32 AMjavax, that variant is for working with jakarta.
Best would be to make the library properly publish their feature variants, but for that you need to make them publish Gradle Module Metadata. (Does not necessarily mean building with Gradle, that's just the easiest).
But while not having that, yes, imho modeling the feature variant ad-hoc is the cleaner solution where you then also do not loose dependency information.
Actually, you could also create some plugin that does it, so that everyone using jakarta can just apply that plugin and get all the feature variants defined for all libraries the plugin already supports, much like the https://github.com/gradlex-org/jvm-dependency-conflict-resolution plugin does it for adding capabilities to detect and fix conflicting libraries.Vampire
09/09/2024, 7:40 AMartifact { extension = "..." } does not loose dependency information.
Just the @... suffix looses dependency information like "org.apache.shiro:shiro-core:2.0.1@jar".Vampire
09/09/2024, 7:41 AMmelix
09/09/2024, 7:42 AMvariantOf exists for a reason, it seems weird to deprecate it when it was created to solve a problemmelix
09/09/2024, 7:43 AMVampire
09/09/2024, 7:47 AM