Slackbot
12/06/2022, 1:45 AMRyan Schmitt
12/06/2022, 2:22 AMRyan Schmitt
12/06/2022, 2:22 AMRyan Schmitt
12/06/2022, 2:37 AMproject.group
switcheroo actually does work, but my Gradle experience teaches me that using hacks is an extremely bad ideaVampire
12/06/2022, 5:47 AMRyan Schmitt
12/06/2022, 6:17 AMVampire
12/06/2022, 7:08 AMRyan Schmitt
12/06/2022, 5:06 PMVampire
12/06/2022, 5:46 PMRyan Schmitt
12/06/2022, 6:41 PMRyan Schmitt
12/06/2022, 6:45 PMRyan Schmitt
12/06/2022, 6:46 PMVampire
12/06/2022, 7:08 PMRyan Schmitt
12/06/2022, 8:08 PMMaybe a clean solution could be too have an included build that uses two configurations to get each of the jarsHow would I do this from a plugin?
Vampire
12/06/2022, 10:47 PMRyan Schmitt
12/07/2022, 12:16 AMRyan Schmitt
12/07/2022, 12:24 AMgetUseGlobalDependencySubstitutionRules
appears to target this use caseRyan Schmitt
12/07/2022, 12:26 AMRyan Schmitt
12/07/2022, 12:58 AMVampire
12/07/2022, 2:21 AMJendrik Johannes
12/07/2022, 11:54 AMgetUseGlobalDependencySubstitutionRules
may still be helpful then, but is only needed if you also use included builds.)Vampire
12/07/2022, 5:48 PMRyan Schmitt
12/07/2022, 6:55 PMBecause the current module (the root) has such a special handling in dependency resolutionThis is what I was wondering: does the root module even have a dependency substitution rule, or is it special-cased somewhere?
Jendrik Johannes
12/07/2022, 7:18 PMJendrik Johannes
12/07/2022, 7:20 PMCan you do it somehow without a composite buildIn a single build you don't necessarily have substitutions for the subprojects. But I keep forgetting the details. I think if you don't add any substitution rules, projects and published versions can both be selected and the normal version conflict resolution (higher version wins) is used.
Ryan Schmitt
12/07/2022, 7:21 PMmy-group:my-project
will always resolve to the current module, irrespective of version (and irrespective of resolutionStrategy
)Jendrik Johannes
12/07/2022, 7:21 PMresolutionStrategy.preferProjectModules()
to always select the local projectJendrik Johannes
12/07/2022, 7:22 PMJendrik Johannes
12/07/2022, 7:24 PMRyan Schmitt
12/07/2022, 7:24 PM!!
syntax, right? It still resolves to the current moduleJendrik Johannes
12/07/2022, 7:26 PMRyan Schmitt
12/07/2022, 7:26 PMproject.group
to some other value, perform the dependency resolution (eagerly), and then restore the old value; that works fine!Jendrik Johannes
12/07/2022, 7:27 PMpreferProjectModules
was introduced)Ryan Schmitt
12/07/2022, 7:27 PMforce
a dependency edgeJendrik Johannes
12/07/2022, 7:28 PMgetUseGlobalDependencySubstitutionRules
to make a clear decisions.
But maybe that's overkill for your setup...Ryan Schmitt
12/07/2022, 7:30 PMRyan Schmitt
12/07/2022, 7:31 PMRyan Schmitt
12/07/2022, 7:31 PMJendrik Johannes
12/07/2022, 7:33 PMThe hilarious thing is that you can setMaybe this "hack" isn't too bad then. If it works. Change the group, fetch the previous version, set the group back.....project.group
Jendrik Johannes
12/07/2022, 7:34 PMRyan Schmitt
12/07/2022, 7:35 PMRyan Schmitt
12/07/2022, 7:35 PMdependencies.create(
group = "com.plexxi",
name = "PlexxiCore",
version = "${project.property(DbProps.REFERENCE_VERSION_PROP)}",
ext = "war").apply {
isForce = true
}
Ryan Schmitt
12/07/2022, 7:36 PMisForce = true
is a fresh idea I haven't tried yetJendrik Johannes
12/07/2022, 7:42 PMpreferProjectModules
back in the day. I don't know if this helps, but maybe:
⢠https://github.com/gradle/gradle/blob/82d482df8192dba085dd6f8b06bad4f41e805753/design-docs/dependency-management-projectpriority.md
⢠https://discuss.gradle.org/t/project-dependencies-participate-in-conflict-resolution/18875Ryan Schmitt
12/07/2022, 9:16 PMExternalDependency
is garbled:
@deprecated Use {@link MutableVersionConstraint#strictly(String) instead.}
It renders as:Ryan Schmitt
12/07/2022, 9:32 PMisForce
has no effect, it's just another form of version syntax. I'm currently looking at using ArtifactResolutionQuery
Ryan Schmitt
12/07/2022, 9:51 PMRyan Schmitt
12/07/2022, 11:54 PMModuleResolveState#select
). This all happens early during the process of graph resolution, before artifact resolution can run, and it's a fixed behavior that is unaffected by any public APIs I'm aware of.Ryan Schmitt
12/08/2022, 12:06 AMgroovy-4-compile-problem
, but that's all I knowRyan Schmitt
12/21/2022, 2:32 PMproject.group
hack. I figured the code in question was unlikely to change in a way that would suddenly break this approach, given its age, complexity, and overall design