File tree Expand file tree Collapse file tree
src/test/kotlin/co/anitrend/support/query/builder/processor Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ dependencies {
1313 compileOnly(libs.google.devtools.ksp)
1414
1515 api(libs.squareup.kotlinpoet)
16- compileOnly (libs.androidx.room.common)
16+ implementation (libs.androidx.room.common)
1717
1818 testImplementation(project(" :annotations" ))
1919 testImplementation(libs.androidx.room.common)
@@ -26,5 +26,6 @@ dependencies {
2626}
2727
2828tasks.test {
29+ dependsOn(tasks.named(" generateMetadataFileForMavenPublication" ))
2930 useJUnitPlatform()
3031}
Original file line number Diff line number Diff line change 1+ package co.anitrend.support.query.builder.processor
2+
3+ import org.junit.jupiter.api.Assertions.assertEquals
4+ import org.junit.jupiter.api.Assertions.assertTrue
5+ import org.junit.jupiter.api.Test
6+ import java.io.File
7+
8+ class PublicationMetadataTest {
9+
10+ @Test
11+ fun `processor runtime metadata should include room common` () {
12+ val repoRoot =
13+ generateSequence(File (System .getProperty(" user.dir" )).absoluteFile) { it.parentFile }
14+ .firstOrNull { candidate ->
15+ File (candidate, " settings.gradle.kts" ).isFile && File (candidate, " gradlew" ).isFile
16+ }
17+ ? : error(" Unable to locate repository root from `${System .getProperty(" user.dir" )} `" )
18+
19+ val moduleFile = File (repoRoot, " processor/build/publications/maven/module.json" )
20+ assertTrue(moduleFile.isFile, " Expected `${moduleFile.absolutePath} ` to exist" )
21+
22+ val moduleText = moduleFile.readText()
23+ assertEquals(true , moduleText.contains(" \" runtimeElements\" " ))
24+ assertTrue(
25+ moduleText.contains(" \" group\" : \" androidx.room\" " ) && moduleText.contains(" \" module\" : \" room-common\" " ),
26+ " Expected processor runtime metadata to publish androidx.room room-common. See `${moduleFile.absolutePath} `" ,
27+ )
28+ }
29+ }
You can’t perform that action at this time.
0 commit comments