Skip to content

Commit

Permalink
Change name of option config
Browse files Browse the repository at this point in the history
  • Loading branch information
vinaygaba committed Dec 11, 2024
1 parent c710d64 commit d66d510
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ class ShowkaseProcessorTest : BaseProcessorTest() {
@Test
fun `composable functions with preview annotation are skipped`() {
val options = mutableMapOf<String, String>()
options["skipComposePreviews"] = "true"
options["skipFunctionsWithPreviewAnnotation"] = "true"
compileInputsAndVerifyOutputs(options = options)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -128,9 +128,9 @@ class ShowkaseProcessor @JvmOverloads constructor(

private fun processPreviewAnnotation(roundEnvironment: XRoundEnv): Set<ShowkaseMetadata.Component> {
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 ->
Expand Down

0 comments on commit d66d510

Please sign in to comment.