diff --git a/gordon-plugin/src/main/kotlin/com/banno/gordon/GordonPlugin.kt b/gordon-plugin/src/main/kotlin/com/banno/gordon/GordonPlugin.kt index 7d7f04e..a2a181f 100644 --- a/gordon-plugin/src/main/kotlin/com/banno/gordon/GordonPlugin.kt +++ b/gordon-plugin/src/main/kotlin/com/banno/gordon/GordonPlugin.kt @@ -21,7 +21,7 @@ class GordonPlugin : Plugin { val androidPluginType = project.androidPluginType() ?: error("Gordon plugin must be applied after applying the application, library, or dynamic-feature Android plugin") - project.extensions.create("gordon") + val gordonExtension = project.extensions.create("gordon") val androidExtension = project.extensions.getByType() @@ -82,6 +82,16 @@ class GordonPlugin : Plugin { this.instrumentationApk.apply { set(testVariant.apkOutputFile()) }.finalizeValue() this.instrumentationPackage.apply { set(testVariant.applicationId) }.finalizeValue() + + this.poolingStrategy.apply { set(gordonExtension.poolingStrategy) }.finalizeValue() + this.tabletShortestWidthDp.apply { set(gordonExtension.tabletShortestWidthDp) }.finalizeValue() + this.retryQuota.apply { set(gordonExtension.retryQuota) }.finalizeValue() + this.installTimeoutMillis.apply { set(gordonExtension.installTimeoutMillis) }.finalizeValue() + this.testTimeoutMillis.apply { set(gordonExtension.testTimeoutMillis) }.finalizeValue() + this.extensionTestFilter.apply { set(gordonExtension.testFilter) }.finalizeValue() + this.extensionTestInstrumentationRunner.apply { set(gordonExtension.testInstrumentationRunner) } + .finalizeValue() + this.androidInstrumentationRunnerOptions.apply { set(instrumentationRunnerOptions) }.finalizeValue() } } diff --git a/gordon-plugin/src/main/kotlin/com/banno/gordon/GordonTestTask.kt b/gordon-plugin/src/main/kotlin/com/banno/gordon/GordonTestTask.kt index 7440c7a..7b781b0 100644 --- a/gordon-plugin/src/main/kotlin/com/banno/gordon/GordonTestTask.kt +++ b/gordon-plugin/src/main/kotlin/com/banno/gordon/GordonTestTask.kt @@ -19,7 +19,6 @@ import org.gradle.api.tasks.PathSensitive import org.gradle.api.tasks.PathSensitivity import org.gradle.api.tasks.TaskAction import org.gradle.api.tasks.options.Option -import org.gradle.kotlin.dsl.getByType import org.gradle.kotlin.dsl.property import se.vidstige.jadb.JadbConnection import java.io.File @@ -73,25 +72,23 @@ internal abstract class GordonTestTask @Inject constructor( .map { it.replace('#', '.') } @get:Input - internal val poolingStrategy = project.extensions.getByType().poolingStrategy + internal val poolingStrategy: Property = objects.property() @get:Input - internal val tabletShortestWidthDp = project.extensions.getByType().tabletShortestWidthDp + internal val tabletShortestWidthDp: Property = objects.property() - private val retryQuota = project.extensions.getByType().retryQuota - private val installTimeoutMillis = project.extensions.getByType().installTimeoutMillis - private val testTimeoutMillis = project.extensions.getByType().testTimeoutMillis + internal val retryQuota: Property = objects.property() + internal val installTimeoutMillis: Property = objects.property() + internal val testTimeoutMillis: Property = objects.property() + + internal val extensionTestFilter: Property = objects.property() + internal val extensionTestInstrumentationRunner: Property = objects.property() @Option(option = "tests", description = "Comma-separated packages, classes, methods, or annotations.") val commandlineTestFilter: Property = objects.property() - private val extensionTestFilter = project.extensions.getByType().testFilter - internal val androidInstrumentationRunnerOptions: Property = objects.property() - private val extensionTestInstrumentationRunner = - project.extensions.getByType().testInstrumentationRunner - @OutputDirectory val testResultsDirectory: Provider = projectLayout.buildDirectory.dir("test-results/$name")