Commit 43dea631 authored by Ben Joyce's avatar Ben Joyce Committed by Commit Bot

Adjust gradle version dependency resolution.

This will take the higher version rather than the lower.
Add ability to exclude libraries from taking the higher version.
Want to take the lower for guava_listenable_future as the higher version
is an empty set that was added as a workaround.

Bug: 1040958
Change-Id: I01e554e7e764686d01fdf724bd18653cfb7808c1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067646Reviewed-by: default avatarPeter Wen <wnwen@chromium.org>
Commit-Queue: benjamin joyce <bjoyce@google.com>
Cr-Commit-Position: refs/heads/master@{#744771}
parent 02b48dd0
...@@ -20,6 +20,11 @@ import org.gradle.maven.MavenPomArtifact ...@@ -20,6 +20,11 @@ import org.gradle.maven.MavenPomArtifact
class ChromiumDepGraph { class ChromiumDepGraph {
final def dependencies = new HashMap<String, DependencyDescription>() final def dependencies = new HashMap<String, DependencyDescription>()
// Override to use the lower version of the library when
// resolving which library version to use.
final def LOWER_VERSION_OVERRIDE = [
'com_google_guava_listenablefuture',
]
// Some libraries don't properly fill their POM with the appropriate licensing information. // Some libraries don't properly fill their POM with the appropriate licensing information.
// It is provided here from manual lookups. Note that licenseUrl must provide textual content // It is provided here from manual lookups. Note that licenseUrl must provide textual content
// rather than be an html page. // rather than be an html page.
...@@ -195,7 +200,13 @@ class ChromiumDepGraph { ...@@ -195,7 +200,13 @@ class ChromiumDepGraph {
private void collectDependenciesInternal(ResolvedDependency dependency) { private void collectDependenciesInternal(ResolvedDependency dependency) {
def id = makeModuleId(dependency.module) def id = makeModuleId(dependency.module)
if (dependencies.containsKey(id)) { if (dependencies.containsKey(id)) {
if (dependencies.get(id).version <= dependency.module.id.version) return if (id in LOWER_VERSION_OVERRIDE &&
dependencies.get(id).version <= dependency.module.id.version) {
return
}
// Use largest version for version conflict resolution. See crbug.com/1040958
// https://docs.gradle.org/current/userguide/dependency_resolution.html#sec:version-conflict
if (dependencies.get(id).version >= dependency.module.id.version) return
} }
def childModules = [] def childModules = []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment