From 1ca8ca1793afdea491d9afebd12a27388c500874 Mon Sep 17 00:00:00 2001 From: Ting-Yuan Huang Date: Tue, 22 Oct 2024 12:25:49 -0700 Subject: [PATCH] Refine error message --- .../src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt | 2 +- .../main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt | 2 +- .../com/google/devtools/ksp/gradle/GradleCompilationTest.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt index be5e8c4043..1d3684b70d 100644 --- a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt +++ b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt @@ -218,7 +218,7 @@ abstract class KspAATask @Inject constructor( provider.asArguments().forEach { argument -> val kv = Regex("(\\S+)=(\\S+)").matchEntire(argument)?.groupValues require(kv != null && kv.size == 3) { - "KSP apoption does not match (\\S+)=(\\S+): $argument" + "Processor arguments not in the format \\S+=\\S+: $argument" } put(kv[1], kv[2]) } diff --git a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt index 3efdfc65c9..4a0220cf46 100644 --- a/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt +++ b/gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt @@ -194,7 +194,7 @@ class KspGradleSubplugin @Inject internal constructor(private val registry: Tool providers.flatMap { provider -> provider.asArguments().map { argument -> require(argument.matches(Regex("\\S+=\\S+"))) { - "KSP apoption does not match \\S+=\\S+: $argument" + "Processor arguments not in the format \\S+=\\S+: $argument" } InternalSubpluginOption("apoption", argument) } diff --git a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt index 63d63b9e0b..27ccd4cd47 100644 --- a/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt +++ b/gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt @@ -306,7 +306,7 @@ class GradleCompilationTest { ) val result = testRule.runner().withArguments(":app:assemble").buildAndFail() - assertThat(result.output).contains("KSP apoption does not match \\S+=\\S+: invalid") + assertThat(result.output).contains("Processor arguments not in the format \\S+=\\S+: invalid") } @Test