From 368c898daf5e568c3c056789594a8b224ea60f26 Mon Sep 17 00:00:00 2001 From: Geoff Powell Date: Tue, 21 Feb 2023 11:00:33 -0500 Subject: [PATCH] Add variant to task inputs to ensure that the task caching works for the appropriate variant --- .../src/main/java/app/cash/paparazzi/gradle/PaparazziPlugin.kt | 1 + .../java/app/cash/paparazzi/gradle/PrepareResourcesTask.kt | 3 +++ 2 files changed, 4 insertions(+) diff --git a/paparazzi/paparazzi-gradle-plugin/src/main/java/app/cash/paparazzi/gradle/PaparazziPlugin.kt b/paparazzi/paparazzi-gradle-plugin/src/main/java/app/cash/paparazzi/gradle/PaparazziPlugin.kt index 5721cb120e..70b9f62023 100644 --- a/paparazzi/paparazzi-gradle-plugin/src/main/java/app/cash/paparazzi/gradle/PaparazziPlugin.kt +++ b/paparazzi/paparazzi-gradle-plugin/src/main/java/app/cash/paparazzi/gradle/PaparazziPlugin.kt @@ -98,6 +98,7 @@ class PaparazziPlugin : Plugin { val nonTransitiveRClassEnabled = (project.findProperty("android.nonTransitiveRClass") as? String).toBoolean() + task.variantName.set(variant.name) task.packageName.set(android.packageName()) task.artifactFiles.from(packageAwareArtifacts.artifactFiles) task.nonTransitiveRClassEnabled.set(nonTransitiveRClassEnabled) diff --git a/paparazzi/paparazzi-gradle-plugin/src/main/java/app/cash/paparazzi/gradle/PrepareResourcesTask.kt b/paparazzi/paparazzi-gradle-plugin/src/main/java/app/cash/paparazzi/gradle/PrepareResourcesTask.kt index 6006dd2a04..5f23f597d6 100644 --- a/paparazzi/paparazzi-gradle-plugin/src/main/java/app/cash/paparazzi/gradle/PrepareResourcesTask.kt +++ b/paparazzi/paparazzi-gradle-plugin/src/main/java/app/cash/paparazzi/gradle/PrepareResourcesTask.kt @@ -32,6 +32,9 @@ import org.gradle.api.tasks.TaskAction @CacheableTask abstract class PrepareResourcesTask : DefaultTask() { + @get:Input + abstract val variantName: Property + @get:Input abstract val packageName: Property