diff --git a/demo-project/app/build.gradle.kts b/demo-project/app/build.gradle.kts index 6f00d1c..1bebde8 100644 --- a/demo-project/app/build.gradle.kts +++ b/demo-project/app/build.gradle.kts @@ -22,6 +22,8 @@ android { enableUnitTestCoverage = true } release { + aggregateTestCoverage = false + isMinifyEnabled = false proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro") } diff --git a/demo-project/ui-tests/build.gradle.kts b/demo-project/ui-tests/build.gradle.kts index 3c3012b..e46ee6b 100644 --- a/demo-project/ui-tests/build.gradle.kts +++ b/demo-project/ui-tests/build.gradle.kts @@ -1,5 +1,6 @@ plugins { alias(libs.plugins.android.test) + alias(libs.plugins.android.baseline) alias(libs.plugins.kotlin.android) } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 72b97f1..93d1bc0 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -24,6 +24,7 @@ robolectric = "org.robolectric:robolectric:4.10.3" android = { id = "com.android.application", version.ref = "agp" } android-lib = { id = "com.android.library", version.ref = "agp" } android-test = { id = "com.android.test", version.ref = "agp" } +android-baseline = { id = "androidx.baselineprofile", version = "1.2.0" } kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } kotlin-samReceiver = { id = "org.jetbrains.kotlin.plugin.sam.with.receiver", version.ref = "kotlin" } diff --git a/plugin/src/main/kotlin/io/github/gmazzo/android/test/aggregation/AndroidTestBaseAggregationPlugin.kt b/plugin/src/main/kotlin/io/github/gmazzo/android/test/aggregation/AndroidTestBaseAggregationPlugin.kt index 81d62a7..2662a0f 100644 --- a/plugin/src/main/kotlin/io/github/gmazzo/android/test/aggregation/AndroidTestBaseAggregationPlugin.kt +++ b/plugin/src/main/kotlin/io/github/gmazzo/android/test/aggregation/AndroidTestBaseAggregationPlugin.kt @@ -2,9 +2,9 @@ package io.github.gmazzo.android.test.aggregation +import org.gradle.api.DomainObjectSet import org.gradle.api.Plugin import org.gradle.api.Project -import org.gradle.api.provider.ListProperty import org.gradle.api.provider.Property import org.gradle.kotlin.dsl.aggregateTestCoverage import org.gradle.kotlin.dsl.apply @@ -13,7 +13,7 @@ import org.gradle.kotlin.dsl.typeOf internal abstract class AndroidTestBaseAggregationPlugin : Plugin { - internal abstract val extendedProperties: ListProperty> + abstract val extendedProperties: DomainObjectSet> override fun apply(target: Project): Unit = with(target) { apply(plugin = "com.android.base") @@ -34,8 +34,7 @@ internal abstract class AndroidTestBaseAggregationPlugin : Plugin { } androidComponents.finalizeDsl { - extendedProperties.finalizeValue() - extendedProperties.get().forEach { it.finalizeValue() } + extendedProperties.all { finalizeValue() } } }