Skip to content

Commit

Permalink
Running debug variant tests
Browse files Browse the repository at this point in the history
  • Loading branch information
LikeTheSalad committed Feb 17, 2025
1 parent 3fd2673 commit 2f8262f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import com.android.build.api.variant.HasHostTestsBuilder
import com.android.build.api.variant.HostTestBuilder

plugins {
id("com.android.library")
id("org.jetbrains.kotlin.android")
Expand Down Expand Up @@ -27,6 +30,12 @@ android {
}
}

androidComponents.beforeVariants {
if (it.buildType?.equals("debug") == false) {
(it as HasHostTestsBuilder).hostTests.get(HostTestBuilder.UNIT_TEST_TYPE)?.enable = false
}
}

tasks.withType(Test::class).configureEach {
useJUnitPlatform()
}
Expand Down

0 comments on commit 2f8262f

Please sign in to comment.