Skip to content
This repository has been archived by the owner on Jul 16, 2024. It is now read-only.

Commit

Permalink
Allow to override task properties (#28)
Browse files Browse the repository at this point in the history
As the tasks are configured quite late, I need to use .convention instead of .set so the consumers can override values.
  • Loading branch information
CristianGM authored Jun 3, 2022
1 parent 18796e8 commit 03762a5
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions src/main/kotlin/io/github/flank/gradle/simple-flank.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ fun registerFlankYamlWriter(
devices.convention(
simpleFlankExtension.devices.orElse(
provider { listOf(NexusLowRes.deviceForMinSdk(variant.minSdkVersion.apiLevel)) }))
this.appApk.set(appApk)
this.appApk.convention(appApk)
this.testApk.convention(testApk)

testTimeout.convention(simpleFlankExtension.testTimeout)
Expand Down Expand Up @@ -126,16 +126,16 @@ fun registerFlankRun(
tasks.register<FlankRunTask>("flankRun${variant.name.capitalize()}") {
flankJarClasspath.from(flankExecutable)

serviceAccountCredentials.set(simpleFlankExtension.credentialsFile)
this@register.variant.set(variant.name)
hermeticTests.set(simpleFlankExtension.hermeticTests)
this.appApk.set(appApk)
this.testApk.set(testApk)
serviceAccountCredentials.convention(simpleFlankExtension.credentialsFile)
this@register.variant.convention(variant.name)
hermeticTests.convention(simpleFlankExtension.hermeticTests)
this.appApk.convention(appApk)
this.testApk.convention(testApk)
val dumpShards: String? by project
this@register.dumpShards.set(dumpShards.toBoolean())
this@register.dumpShards.convention(dumpShards.toBoolean())
val dry: String? by project
this@register.dry.set(dry.toBoolean())
this.flankYaml.set(flankYaml)
this@register.dry.convention(dry.toBoolean())
this.flankYaml.convention(flankYaml)
}

fun registerFlankDoctor(
Expand All @@ -146,10 +146,10 @@ fun registerFlankDoctor(
): TaskProvider<FlankDoctorTask> =
tasks.register<FlankDoctorTask>("flankDoctor${variant.name.capitalize()}") {
flankJarClasspath.from(flankExecutable)
this@register.variant.set(variant.name)
this.appApk.set(appApk)
this.testApk.set(testApk)
this.flankYaml.set(flankYaml)
this@register.variant.convention(variant.name)
this.appApk.convention(appApk)
this.testApk.convention(testApk)
this.flankYaml.convention(flankYaml)
}

fun configureTasks(
Expand Down

0 comments on commit 03762a5

Please sign in to comment.