Skip to content

Commit 8625a27

Browse files
committed
Cleanup/test fixes
1 parent 8453cb6 commit 8625a27

File tree

52 files changed

+154
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+154
-47
lines changed

build.gradle.kts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,8 @@ subprojects {
113113
"commonMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
114114
"androidMainImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-play-services:$coroutinesVersion")
115115
"androidMainImplementation"(platform("com.google.firebase:firebase-bom:$firebaseBoMVersion"))
116-
"commonTestImplementation"(kotlin("test"))
116+
"commonTestImplementation"(kotlin("test-common"))
117+
"commonTestImplementation"(kotlin("test-annotations-common"))
117118
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-core:$coroutinesVersion")
118119
"commonTestImplementation"("org.jetbrains.kotlinx:kotlinx-coroutines-test:$coroutinesVersion")
119120
if (this@afterEvaluate.name != "firebase-crashlytics") {
@@ -126,19 +127,14 @@ subprojects {
126127
"jvmTestImplementation"("junit:junit:4.13.2")
127128
}
128129
"androidInstrumentedTestImplementation"(kotlin("test-junit"))
130+
"androidUnitTestImplementation"(kotlin("test-junit"))
129131
"androidInstrumentedTestImplementation"("junit:junit:4.13.2")
130132
"androidInstrumentedTestImplementation"("androidx.test:core:1.5.0")
131133
"androidInstrumentedTestImplementation"("androidx.test.ext:junit:1.1.5")
132134
"androidInstrumentedTestImplementation"("androidx.test:runner:1.5.2")
133135
}
134136
}
135137

136-
// Workaround for setting kotlinOptions.jvmTarget
137-
// See https://youtrack.jetbrains.com/issue/KT-55947/Unable-to-set-kapt-jvm-target-version
138-
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
139-
kotlinOptions.jvmTarget = "11"
140-
}
141-
142138
if (skipPublishing) return@subprojects
143139

144140
apply(plugin = "maven-publish")

firebase-app/build.gradle.kts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,13 @@ val supportIosTarget = project.property("skipIosTarget") != "true"
4646

4747
kotlin {
4848

49-
androidTarget() {
49+
androidTarget {
5050
publishAllLibraryVariants()
51+
compilations.configureEach {
52+
kotlinOptions {
53+
jvmTarget = "11"
54+
}
55+
}
5156
}
5257

5358
jvm {

firebase-app/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,5 @@ import androidx.test.platform.app.InstrumentationRegistry
1010
actual val context: Any = InstrumentationRegistry.getInstrumentation().targetContext
1111

1212
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() }
13-
actual annotation class IgnoreForAndroidUnitTest()
13+
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
14+
actual annotation class IgnoreForAndroidUnitTest

firebase-app/src/commonTest/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import kotlin.test.Test
44

55
expect val context: Any
66
expect fun runTest(test: suspend () -> Unit)
7-
expect annotation class IgnoreForAndroidUnitTest constructor()
7+
expect annotation class IgnoreForAndroidUnitTest()
88

99
@IgnoreForAndroidUnitTest
1010
class FirebaseAppTest {

firebase-app/src/iosTest/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ actual fun runTest(test: suspend () -> Unit) = runBlocking {
2121
testRun.await()
2222
}
2323

24-
actual annotation class IgnoreForAndroidUnitTest()
24+
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
25+
actual annotation class IgnoreForAndroidUnitTest

firebase-app/src/jsTest/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ actual fun runTest(test: suspend () -> Unit) {
1212
runTest { test() }
1313
}
1414

15-
actual annotation class IgnoreForAndroidUnitTest()
15+
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
16+
actual annotation class IgnoreForAndroidUnitTest

firebase-app/src/jvmTest/kotlin/dev/gitlive/firebase/firebase.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ package dev.gitlive.firebase
88
actual val context: Any = Unit
99

1010
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() }
11+
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
12+
actual annotation class IgnoreForAndroidUnitTest

firebase-auth/build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,11 @@ kotlin {
6262

6363
androidTarget {
6464
publishAllLibraryVariants()
65+
compilations.configureEach {
66+
kotlinOptions {
67+
jvmTarget = "11"
68+
}
69+
}
6570
}
6671

6772
if (supportIosTarget) {
@@ -120,6 +125,7 @@ kotlin {
120125
optIn("kotlinx.coroutines.ExperimentalCoroutinesApi")
121126
if (name.lowercase().contains("ios")) {
122127
optIn("kotlinx.cinterop.ExperimentalForeignApi")
128+
optIn("kotlinx.cinterop.BetaInteropApi")
123129
}
124130
}
125131
}

firebase-auth/src/androidInstrumentedTest/kotlin/dev/gitlive/firebase/auth/auth.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ actual val context: Any = InstrumentationRegistry.getInstrumentation().targetCon
1313

1414
actual fun runTest(test: suspend () -> Unit) = kotlinx.coroutines.test.runTest { test() }
1515

16-
actual annotation class IgnoreForAndroidUnitTest()
16+
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
17+
actual annotation class IgnoreForAndroidUnitTest

firebase-auth/src/commonTest/kotlin/dev/gitlive/firebase/auth/auth.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import kotlin.test.*
1212
expect val emulatorHost: String
1313
expect val context: Any
1414
expect fun runTest(test: suspend () -> Unit): TestResult
15-
expect annotation class IgnoreForAndroidUnitTest constructor()
15+
expect annotation class IgnoreForAndroidUnitTest()
1616

1717
@IgnoreForAndroidUnitTest
1818
class FirebaseAuthTest {

0 commit comments

Comments
 (0)