Skip to content

Commit 14e0c66

Browse files
committed
build(architecture): support pure JVM modules
fixes: ``` null cannot be cast to non-null type com.android.build.api.dsl.CommonExtension<*, *, *, *, *, *> ``` These may be useful in future, but not yet: Anki-Android-Backend is an Android module so we can't depend on it from pure JVM code
1 parent ef5a7fa commit 14e0c66

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

build.gradle.kts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@ subprojects {
4141
}
4242

4343
afterEvaluate {
44-
if (hasProperty("android")) {
45-
val androidExtension =
46-
extensions.findByName("android") as CommonExtension<*, *, *, *, *, *>
44+
plugins.withType<com.android.build.gradle.BasePlugin> {
45+
val androidExtension = extensions.getByName("android") as CommonExtension<*, *, *, *, *, *>
4746
androidExtension.testOptions.unitTests {
4847
isIncludeAndroidResources = true
4948
}

0 commit comments

Comments
 (0)