diff --git a/build-logic/src/main/kotlin/Dependencies.kt b/build-logic/src/main/kotlin/Dependencies.kt index 5afae149..0b257572 100644 --- a/build-logic/src/main/kotlin/Dependencies.kt +++ b/build-logic/src/main/kotlin/Dependencies.kt @@ -7,7 +7,7 @@ object libs { const val junitVintage = "5.14.0" const val junitPlatform = "1.14.0" - const val composeBom = "2025.03.00" + const val compose = "1.7.8" const val androidXMultidex = "2.0.1" const val androidXTestAnnotation = "1.0.1" const val androidXTestCore = "1.6.1" @@ -60,11 +60,10 @@ object libs { const val junitPlatformRunner = "org.junit.platform:junit-platform-runner:${versions.junitPlatform}" const val apiguardianApi = "org.apiguardian:apiguardian-api:${versions.apiGuardian}" - const val composeBom = "androidx.compose:compose-bom:${versions.composeBom}" - const val composeUi = "androidx.compose.ui:ui" - const val composeUiTooling = "androidx.compose.ui:ui-tooling" - const val composeFoundation = "androidx.compose.foundation:foundation" - const val composeMaterial = "androidx.compose.material:material" + const val composeUi = "androidx.compose.ui:ui:${versions.compose}" + const val composeUiTooling = "androidx.compose.ui:ui-tooling:${versions.compose}" + const val composeFoundation = "androidx.compose.foundation:foundation:${versions.compose}" + const val composeMaterial = "androidx.compose.material:material:${versions.compose}" const val composeActivity = "androidx.activity:activity-compose:${versions.activityCompose}" // Testing @@ -84,9 +83,9 @@ object libs { const val androidXTestRunner = "androidx.test:runner:${versions.androidXTestRunner}" const val espressoCore = "androidx.test.espresso:espresso-core:${versions.espresso}" - const val composeUiTest = "androidx.compose.ui:ui-test" - const val composeUiTestJUnit4 = "androidx.compose.ui:ui-test-junit4" - const val composeUiTestManifest = "androidx.compose.ui:ui-test-manifest" + const val composeUiTest = "androidx.compose.ui:ui-test:${versions.compose}" + const val composeUiTestJUnit4 = "androidx.compose.ui:ui-test-junit4:${versions.compose}" + const val composeUiTestManifest = "androidx.compose.ui:ui-test-manifest:${versions.compose}" // Documentation // For the latest version refer to GitHub repo neboskreb/instant-task-executor-extension diff --git a/build-logic/src/main/kotlin/Deployment.kt b/build-logic/src/main/kotlin/Deployment.kt index 46b48323..5fa0f154 100644 --- a/build-logic/src/main/kotlin/Deployment.kt +++ b/build-logic/src/main/kotlin/Deployment.kt @@ -204,6 +204,17 @@ private fun MavenPublication.applyPublicationDetails( .mapValues { entry -> entry.value.filter { it.name != "unspecified" } } .forEach { (scope, dependencies) -> dependencies.forEach { dep -> + // Do not allow BOM dependencies for our own packaged libraries, + // instead its artifact versions should be unrolled explicitly + if ("-bom" in dep.name) { + throw IllegalArgumentException( + "Found a BOM declaration in the dependencies of project" + + "${project.path}: $dep. Prefer declaring its " + + "transitive artifacts explicitly by " + + "adding a version contraint to them." + ) + } + with(dependenciesNode.appendNode("dependency")) { if (dep is ProjectDependency) { appendProjectDependencyCoordinates(dep) @@ -211,9 +222,7 @@ private fun MavenPublication.applyPublicationDetails( appendExternalDependencyCoordinates(dep) } - // Rewrite scope definition for BOM dependencies - val isBom = "-bom" in dep.name - appendNode("scope", if (isBom) "import" else scope) + appendNode("scope", scope) } } } diff --git a/instrumentation/compose/build.gradle.kts b/instrumentation/compose/build.gradle.kts index 673a3144..908ee360 100644 --- a/instrumentation/compose/build.gradle.kts +++ b/instrumentation/compose/build.gradle.kts @@ -74,7 +74,6 @@ dependencies { implementation(libs.junit4) implementation(libs.espressoCore) - implementation(platform(libs.composeBom)) implementation(libs.composeActivity) implementation(libs.composeUi) implementation(libs.composeUiTooling)