From d66d510ef46f6b5480de02b0775293e99880fc47 Mon Sep 17 00:00:00 2001 From: Vinay Gaba Date: Wed, 11 Dec 2024 17:06:45 +0530 Subject: [PATCH] Change name of option config --- .../showkase_processor_testing/ShowkaseProcessorTest.kt | 2 +- .../airbnb/android/showkase/processor/ShowkaseProcessor.kt | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/showkase-processor-testing/src/test/java/com/airbnb/android/showkase_processor_testing/ShowkaseProcessorTest.kt b/showkase-processor-testing/src/test/java/com/airbnb/android/showkase_processor_testing/ShowkaseProcessorTest.kt index 1bec0e3c..2db2ac38 100644 --- a/showkase-processor-testing/src/test/java/com/airbnb/android/showkase_processor_testing/ShowkaseProcessorTest.kt +++ b/showkase-processor-testing/src/test/java/com/airbnb/android/showkase_processor_testing/ShowkaseProcessorTest.kt @@ -616,7 +616,7 @@ class ShowkaseProcessorTest : BaseProcessorTest() { @Test fun `composable functions with preview annotation are skipped`() { val options = mutableMapOf() - options["skipComposePreviews"] = "true" + options["skipFunctionsWithPreviewAnnotation"] = "true" compileInputsAndVerifyOutputs(options = options) } } diff --git a/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/ShowkaseProcessor.kt b/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/ShowkaseProcessor.kt index 09b89814..2d2a8d95 100644 --- a/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/ShowkaseProcessor.kt +++ b/showkase-processor/src/main/java/com/airbnb/android/showkase/processor/ShowkaseProcessor.kt @@ -78,7 +78,7 @@ class ShowkaseProcessor @JvmOverloads constructor( ?.toSet()?.let { set.addAll(it) } return set } - override fun getSupportedOptions() = mutableSetOf("skipPrivatePreviews", "skipComposePreviews", "multiPreviewType") + override fun getSupportedOptions() = mutableSetOf("skipPrivatePreviews", "skipFunctionsWithPreviewAnnotation", "multiPreviewType") override fun process(environment: XProcessingEnv, round: XRoundEnv) { val componentMetadata = processComponentAnnotation(round) @@ -128,9 +128,9 @@ class ShowkaseProcessor @JvmOverloads constructor( private fun processPreviewAnnotation(roundEnvironment: XRoundEnv): Set { val skipPrivatePreviews = environment.options["skipPrivatePreviews"] == "true" - val skipComposePreviews = environment.options["skipComposePreviews"] == "true" + val skipFunctionsWithPreviewAnnotation = environment.options["skipFunctionsWithPreviewAnnotation"] == "true" - if (skipComposePreviews) return emptySet() + if (skipFunctionsWithPreviewAnnotation) return emptySet() return roundEnvironment.getElementsAnnotatedWith(PREVIEW_CLASS_NAME) .mapNotNull { element ->