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 ->