diff --git a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/DependencyNotations.kt b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/DependencyNotations.kt index a67e4d0ad..0158322d5 100644 --- a/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/DependencyNotations.kt +++ b/plugins/core/src/main/kotlin/de/fayard/refreshVersions/core/DependencyNotations.kt @@ -243,6 +243,18 @@ sealed class AbstractDependencyGroup( name: String, isBom: Boolean = false, usePlatformConstraints: Boolean? = if (isBom) false else null + ) = module( + group = group, + name = name, + isBom = isBom, + usePlatformConstraints = usePlatformConstraints + ) + + fun module( + group: String, + name: String, + isBom: Boolean = false, + usePlatformConstraints: Boolean? = if (isBom) false else null ): DependencyNotation { assert(name.trimStart() == name) { "module($name) has superfluous leading whitespace" } assert(name.trimEnd() == name) { "module($name) has superfluous trailing whitespace" } diff --git a/plugins/dependencies/src/main/kotlin/dependencies/AndroidX.kt b/plugins/dependencies/src/main/kotlin/dependencies/AndroidX.kt index 453e6d2ae..69e5b7652 100644 --- a/plugins/dependencies/src/main/kotlin/dependencies/AndroidX.kt +++ b/plugins/dependencies/src/main/kotlin/dependencies/AndroidX.kt @@ -495,14 +495,20 @@ object AndroidX : IsNotADependency { */ val compose = Compose - object Compose : IsNotADependency { + object Compose : DependencyGroup(group = "androidx.compose") { + + val bom = module("compose-bom", isBom = true) /** * Transform @Composable functions and enable optimizations with a Kotlin compiler plugin. * * [Release notes](https://developer.android.com/jetpack/androidx/releases/compose-compiler) */ - val compiler = DependencyNotation("androidx.compose.compiler", "compiler") + val compiler = module( + group = "androidx.compose.compiler", + name = "compiler", + usePlatformConstraints = false // Not included in the BoM, and not used as a regular dependency. + ) /** * Fundamental building blocks of Compose's programming model and state management, @@ -520,7 +526,11 @@ object AndroidX : IsNotADependency { */ val runtime = Runtime - object Runtime : DependencyNotationAndGroup(group = "androidx.compose.runtime", name = "runtime") { + object Runtime : DependencyNotationAndGroup( + platformConstrainsDelegateGroup = Compose, + group = "androidx.compose.runtime", + name = "runtime" + ) { val dispatch = module("runtime-dispatch") @@ -578,7 +588,11 @@ object AndroidX : IsNotADependency { */ val animation = Animation - object Animation : DependencyNotationAndGroup(group = "androidx.compose.animation", name = "animation") { + object Animation : DependencyNotationAndGroup( + platformConstrainsDelegateGroup = Compose, + group = "androidx.compose.animation", + name = "animation" + ) { /** * Animation engine and animation primitives that are the building blocks of the Compose animation library. @@ -648,7 +662,11 @@ object AndroidX : IsNotADependency { */ val ui = Ui - object Ui : DependencyNotationAndGroup(group = "androidx.compose.ui", name = "ui") { + object Ui : DependencyNotationAndGroup( + platformConstrainsDelegateGroup = Compose, + group = "androidx.compose.ui", + name = "ui" + ) { /** * Compose classes related to dimensions without units @@ -707,7 +725,11 @@ object AndroidX : IsNotADependency { */ val text = Text - object Text : DependencyNotationAndGroup(group = group, name = "ui-text") { + object Text : DependencyNotationAndGroup( + platformConstrainsDelegateGroup = Compose, + group = group, + name = "ui-text" + ) { /** * Compose Downloadable Fonts integration for Google Fonts. @@ -787,7 +809,11 @@ object AndroidX : IsNotADependency { */ val foundation = Foundation - object Foundation : DependencyNotationAndGroup(group = "androidx.compose.foundation", name = "foundation") { + object Foundation : DependencyNotationAndGroup( + platformConstrainsDelegateGroup = Compose, + group = "androidx.compose.foundation", + name = "foundation" + ) { /** * Compose layout implementations @@ -814,7 +840,11 @@ object AndroidX : IsNotADependency { */ val material = Material - object Material : DependencyNotationAndGroup(group = "androidx.compose.material", name = "material") { + object Material : DependencyNotationAndGroup( + platformConstrainsDelegateGroup = Compose, + group = "androidx.compose.material", + name = "material" + ) { /** * Material icons @@ -867,7 +897,11 @@ object AndroidX : IsNotADependency { */ val material3 = Material3 - object Material3 : DependencyNotationAndGroup(group = "androidx.compose.material3", name = "material3") { + object Material3 : DependencyNotationAndGroup( + platformConstrainsDelegateGroup = Compose, + group = "androidx.compose.material3", + name = "material3" + ) { /** * Provides window size classes for building responsive UIs diff --git a/plugins/dependencies/src/test/resources/bundled-dependencies-validated.txt b/plugins/dependencies/src/test/resources/bundled-dependencies-validated.txt index 23719a172..ae981625e 100644 --- a/plugins/dependencies/src/test/resources/bundled-dependencies-validated.txt +++ b/plugins/dependencies/src/test/resources/bundled-dependencies-validated.txt @@ -72,6 +72,7 @@ androidx.compose.ui:ui-tooling-preview androidx.compose.ui:ui-unit androidx.compose.ui:ui-util androidx.compose.ui:ui-viewbinding +androidx.compose:compose-bom androidx.concurrent:concurrent-futures androidx.concurrent:concurrent-futures-ktx androidx.constraintlayout:constraintlayout diff --git a/plugins/dependencies/src/test/resources/dependencies-mapping-validated.txt b/plugins/dependencies/src/test/resources/dependencies-mapping-validated.txt index 2d16b21e8..25097532a 100644 --- a/plugins/dependencies/src/test/resources/dependencies-mapping-validated.txt +++ b/plugins/dependencies/src/test/resources/dependencies-mapping-validated.txt @@ -40,6 +40,7 @@ androidx.car.app..app=AndroidX.carApp androidx.cardview..cardview=AndroidX.cardView androidx.collection..collection-ktx=AndroidX.collection.ktx androidx.collection..collection=AndroidX.collection +androidx.compose..compose-bom=AndroidX.compose.bom androidx.compose.animation..animation-core=AndroidX.compose.animation.core androidx.compose.animation..animation-graphics=AndroidX.compose.animation.graphics androidx.compose.animation..animation=AndroidX.compose.animation diff --git a/plugins/dependencies/src/test/resources/dependencies-versions-key-validated.txt b/plugins/dependencies/src/test/resources/dependencies-versions-key-validated.txt index 20fb9187b..7f5264768 100644 --- a/plugins/dependencies/src/test/resources/dependencies-versions-key-validated.txt +++ b/plugins/dependencies/src/test/resources/dependencies-versions-key-validated.txt @@ -39,6 +39,7 @@ androidx.car.app..app=version.androidx.car.app androidx.cardview..cardview=version.androidx.cardview androidx.collection..collection-ktx=version.androidx.collection androidx.collection..collection=version.androidx.collection +androidx.compose..compose-bom=version.androidx.compose androidx.compose.animation..animation-core=version.androidx.compose.animation androidx.compose.animation..animation-graphics=version.androidx.compose.animation androidx.compose.animation..animation=version.androidx.compose.animation