Skip to content

Commit

Permalink
Fixed finalizeDSL block preventing property changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gmazzo committed Oct 20, 2023
1 parent 7df194a commit 39bd974
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
2 changes: 2 additions & 0 deletions demo-project/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ android {
enableUnitTestCoverage = true
}
release {
aggregateTestCoverage = false

isMinifyEnabled = false
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
}
Expand Down
1 change: 1 addition & 0 deletions demo-project/ui-tests/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
plugins {
alias(libs.plugins.android.test)
alias(libs.plugins.android.baseline)
alias(libs.plugins.kotlin.android)
}

Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -13,7 +13,7 @@ import org.gradle.kotlin.dsl.typeOf

internal abstract class AndroidTestBaseAggregationPlugin : Plugin<Project> {

internal abstract val extendedProperties: ListProperty<Property<*>>
abstract val extendedProperties: DomainObjectSet<Property<*>>

override fun apply(target: Project): Unit = with(target) {
apply(plugin = "com.android.base")
Expand All @@ -34,8 +34,7 @@ internal abstract class AndroidTestBaseAggregationPlugin : Plugin<Project> {
}

androidComponents.finalizeDsl {
extendedProperties.finalizeValue()
extendedProperties.get().forEach { it.finalizeValue() }
extendedProperties.all { finalizeValue() }
}
}

Expand Down

0 comments on commit 39bd974

Please sign in to comment.