@@ -48,6 +48,33 @@ val bcp47Locales = listOf(
4848)
4949val e2eBackendEnv = System .getenv(" E2E_BACKEND" ) ? : " local"
5050val e2eHomegateUrlEnv = System .getenv(" E2E_HOMEGATE_URL" ) ? : " http://127.0.0.1:6288"
51+ val coreServiceIntegrationTestAnnotation = " to.bitkit.test.annotations.CoreServiceIntegrationTest"
52+ val composeUiTestAnnotation = " to.bitkit.test.annotations.ComposeUiTest"
53+ val deviceIntegrationTestAnnotation = " to.bitkit.test.annotations.DeviceIntegrationTest"
54+ val deviceStorageIntegrationTestAnnotation = " to.bitkit.test.annotations.DeviceStorageIntegrationTest"
55+ val deviceUiIntegrationTestAnnotation = " to.bitkit.test.annotations.DeviceUiIntegrationTest"
56+ val requestedTaskNames = gradle.startParameter.taskNames.map { it.substringAfterLast(" :" ) }
57+ val bitkitAndroidTestSuite = providers.gradleProperty(" bitkitAndroidTestSuite" ).orNull
58+ val bitkitAndroidTestAnnotation = when {
59+ requestedTaskNames.any { it == " connectedDevDebugComposeAndroidTest" } -> composeUiTestAnnotation
60+ requestedTaskNames.any { it == " connectedDevDebugCoreServiceIntegrationAndroidTest" } -> {
61+ coreServiceIntegrationTestAnnotation
62+ }
63+ requestedTaskNames.any { it == " connectedDevDebugDeviceStorageIntegrationAndroidTest" } -> {
64+ deviceStorageIntegrationTestAnnotation
65+ }
66+ requestedTaskNames.any { it == " connectedDevDebugDeviceUiIntegrationAndroidTest" } -> {
67+ deviceUiIntegrationTestAnnotation
68+ }
69+ requestedTaskNames.any { it == " connectedDevDebugDeviceIntegrationAndroidTest" } -> deviceIntegrationTestAnnotation
70+ bitkitAndroidTestSuite == " compose" -> composeUiTestAnnotation
71+ bitkitAndroidTestSuite == " core-service" -> coreServiceIntegrationTestAnnotation
72+ bitkitAndroidTestSuite == " device-storage" -> deviceStorageIntegrationTestAnnotation
73+ bitkitAndroidTestSuite == " device-ui" -> deviceUiIntegrationTestAnnotation
74+ bitkitAndroidTestSuite == " integration" -> deviceIntegrationTestAnnotation
75+ bitkitAndroidTestSuite == null -> null
76+ else -> error(" Unsupported bitkitAndroidTestSuite '$bitkitAndroidTestSuite '" )
77+ }
5178
5279android {
5380 namespace = " to.bitkit"
@@ -59,6 +86,9 @@ android {
5986 versionCode = 181
6087 versionName = " 2.2.0"
6188 testInstrumentationRunner = " to.bitkit.test.HiltTestRunner"
89+ bitkitAndroidTestAnnotation?.let {
90+ testInstrumentationRunnerArguments[" annotation" ] = it
91+ }
6292 vectorDrawables {
6393 useSupportLibrary = true
6494 }
@@ -363,4 +393,34 @@ tasks.withType<Test>().configureEach {
363393 jvmArgs(" -XX:+EnableDynamicAgentLoading" )
364394}
365395
396+ tasks.register(" connectedDevDebugComposeAndroidTest" ) {
397+ group = " verification"
398+ description = " Runs devDebug Android tests annotated as Compose UI tests."
399+ dependsOn(" connectedDevDebugAndroidTest" )
400+ }
401+
402+ tasks.register(" connectedDevDebugDeviceIntegrationAndroidTest" ) {
403+ group = " verification"
404+ description = " Runs devDebug Android tests annotated as device integration tests."
405+ dependsOn(" connectedDevDebugAndroidTest" )
406+ }
407+
408+ tasks.register(" connectedDevDebugCoreServiceIntegrationAndroidTest" ) {
409+ group = " verification"
410+ description = " Runs devDebug Android tests annotated as core service integration tests."
411+ dependsOn(" connectedDevDebugAndroidTest" )
412+ }
413+
414+ tasks.register(" connectedDevDebugDeviceStorageIntegrationAndroidTest" ) {
415+ group = " verification"
416+ description = " Runs devDebug Android tests annotated as device storage integration tests."
417+ dependsOn(" connectedDevDebugAndroidTest" )
418+ }
419+
420+ tasks.register(" connectedDevDebugDeviceUiIntegrationAndroidTest" ) {
421+ group = " verification"
422+ description = " Runs devDebug Android tests annotated as device UI integration tests."
423+ dependsOn(" connectedDevDebugAndroidTest" )
424+ }
425+
366426// endregion
0 commit comments