Skip to content

Commit df40e59

Browse files
committed
fix junit bom impl in convention
1 parent 075753c commit df40e59

2 files changed

Lines changed: 27 additions & 14 deletions

File tree

build-logic/dependencies/src/main/kotlin/AppExt.kt

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,29 @@ object AppExt {
5252
dependencies {
5353
alias.forEach {
5454
add(
55-
"debugImplementation",
55+
"implementation",
56+
platform(libs.findLibrary(it).get())
57+
)
58+
}
59+
}
60+
}
61+
62+
fun Project.testImplementationPlatform(vararg alias: String) {
63+
dependencies {
64+
alias.forEach {
65+
add(
66+
"testImplementation",
67+
platform(libs.findLibrary(it).get())
68+
)
69+
}
70+
}
71+
}
72+
73+
fun Project.androidTestImplementationPlatform(vararg alias: String) {
74+
dependencies {
75+
alias.forEach {
76+
add(
77+
"androidTestImplementation",
5678
platform(libs.findLibrary(it).get())
5779
)
5880
}
@@ -92,17 +114,6 @@ object AppExt {
92114
}
93115
}
94116

95-
fun Project.androidTestImplementationPlatform(vararg alias: String) {
96-
dependencies {
97-
alias.forEach {
98-
add(
99-
"androidTestImplementation",
100-
dependencies.platform(libs.findLibrary(it).get())
101-
)
102-
}
103-
}
104-
}
105-
106117
/**
107118
* Find the library by alias
108119
*/

build-logic/dependencies/src/main/kotlin/com.stslex93.notes/KotlinAndroid.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@ package com.stslex93.notes
22

33
import AppExt.APP_PREFIX
44
import AppExt.androidTestImplementationBundle
5+
import AppExt.androidTestImplementationPlatform
56
import AppExt.coreLibraryDesugaring
67
import AppExt.findVersionInt
78
import AppExt.implementation
8-
import AppExt.implementationPlatform
99
import AppExt.ksp
1010
import AppExt.libs
1111
import AppExt.testImplementationBundle
12+
import AppExt.testImplementationPlatform
1213
import AppExt.testRuntimeOnly
1314
import com.android.build.api.dsl.CommonExtension
1415
import com.android.build.gradle.AppExtension
@@ -50,7 +51,8 @@ internal fun Project.configureKotlinAndroid(
5051
dependencies {
5152
coreLibraryDesugaring("android-desugarJdkLibs")
5253

53-
implementationPlatform("junit-bom")
54+
testImplementationPlatform("junit-bom")
55+
androidTestImplementationPlatform("junit-bom")
5456
testRuntimeOnly("junit-launcher")
5557
testImplementationBundle("test")
5658
androidTestImplementationBundle("android-test")

0 commit comments

Comments
 (0)