Slackbot
11/11/2023, 1:35 AMRyan Schmitt
11/11/2023, 1:36 AMThe strings,rc,snapshot,final,gaandreleaseare considered higher than any other string part (sorted in this order):sp<1.0-zeta<1.0-rc<1.0-snapshot<1.0-final<1.0-ga<1.0-release<1.0-sp.1.0
Ryan Schmitt
11/11/2023, 1:36 AMresolverTest
+--- brazil:FooLib:1.0-release
+--- brazil:FooLib:1.0-debug -> 1.0-release
\--- brazil:FooLib:1.0-releaseProguarded -> 1.0-release
resolverTest
+--- brazil:FooLib:{prefer 1.0-release} -> 1.0-releaseProguarded
+--- brazil:FooLib:{prefer 1.0-debug} -> 1.0-releaseProguarded
\--- brazil:FooLib:{prefer 1.0-releaseProguarded} -> 1.0-releaseProguardedRyan Schmitt
11/11/2023, 2:40 AMprefer constraints, does Gradle pick the highest preferred version? Or does it arbitrarily pick a single constraint to use?Vampire
11/11/2023, 10:31 AMRyan Schmitt
11/11/2023, 5:30 PMprefer
This is a very soft version declaration. It applies only if there is no stronger non dynamic opinion on a version for the module. This term does not support dynamic versions.
Definition can complementorstrictly.require
When defined, this overrides any previousdeclaration and clears previousprefer.reject
Ryan Schmitt
11/11/2023, 5:31 PMreject? Kind of unsettlingVampire
11/11/2023, 11:26 PMversion {
reject("1")
reject("2")
prefer("3")
prefer("4")
reject("5")
reject("6")
}
Then the prefer("4") will override the prefer("3") and for whatever reason clear the rejects for 1 and 2.
So you end up with prefer 4 and reject 5 and 6.Vampire
11/11/2023, 11:26 PMRyan Schmitt
11/13/2023, 9:13 PMDependency instance, not to an entire ConfigurationVampire
11/14/2023, 12:52 AMVampire
11/14/2023, 12:52 AMVampire
11/14/2023, 12:53 AMSterling
1.0-zzz, you'd get that version instead.
Oddly, if you use a dynamic version anywhere in the graph (:brazil:FooLib:+), you get the 1.0-release version instead.
If instead of using a rich version, you use those same versions with the simple GAV notation, you also get 1.0-release, so I suspect there's a bug when there are no stronger constraints and we have to choose between the preferred versions.Sterling
Ryan Schmitt
11/15/2023, 7:55 PMOddly, if you use a dynamic version anywhere in the graph (That makes sense, since that resolves to the equivalent of), you get the:brazil:FooLib:+version instead.1.0-release
require("1.0-release"), right? And 1.0-release is ranked higher than almost any other qualifier. It's subject to those special rulesSterling
Ryan Schmitt
11/15/2023, 7:57 PMSterling
Sterling