[go: nahoru, domu]

Add project dependency constraint between lifecycle-common and lifecycle-livedata-core

Added bi-directional project version constraint between
lifecycle-common and lifecycle-livedata-core. If both
artifacts are in the dependency tree, their versions
should match. This will now be enforced by gradle
automatically bumping up either version to meet constraint.

Test: N/A
Bug: 242871265
Change-Id: I22e0fda00e22bc4fc56ac1bf5b7dcd2369ad533e
diff --git a/lifecycle/lifecycle-common/build.gradle b/lifecycle/lifecycle-common/build.gradle
index 2e59a5d..db353ca 100644
--- a/lifecycle/lifecycle-common/build.gradle
+++ b/lifecycle/lifecycle-common/build.gradle
@@ -30,6 +30,7 @@
     constraints {
         implementation(project(":lifecycle:lifecycle-common-java8"))
         implementation(projectOrArtifact(":lifecycle:lifecycle-runtime"))
+        implementation(project(":lifecycle:lifecycle-livedata-core"))
     }
 }
 
diff --git a/lifecycle/lifecycle-livedata-core/build.gradle b/lifecycle/lifecycle-livedata-core/build.gradle
index fffbb9f..036a387 100644
--- a/lifecycle/lifecycle-livedata-core/build.gradle
+++ b/lifecycle/lifecycle-livedata-core/build.gradle
@@ -44,6 +44,7 @@
         // i.e. COMPOSE + MAIN project sets
         // update syntax when b/239979823 is fixed
         implementation("androidx.lifecycle:lifecycle-livedata-core-ktx:{androidx.LibraryVersions.LIFECYCLE}")
+        implementation(project(":lifecycle:lifecycle-common"))
     }
 }