Skip to content

Commit b27396c

Browse files
ting-yuanKSP Auto Pick
authored andcommitted
Refine error message
(cherry picked from commit 1ca8ca1)
1 parent 36252be commit b27396c

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspAATask.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ abstract class KspAATask @Inject constructor(
218218
provider.asArguments().forEach { argument ->
219219
val kv = Regex("(\\S+)=(\\S+)").matchEntire(argument)?.groupValues
220220
require(kv != null && kv.size == 3) {
221-
"KSP apoption does not match (\\S+)=(\\S+): $argument"
221+
"Processor arguments not in the format \\S+=\\S+: $argument"
222222
}
223223
put(kv[1], kv[2])
224224
}

gradle-plugin/src/main/kotlin/com/google/devtools/ksp/gradle/KspSubplugin.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ class KspGradleSubplugin @Inject internal constructor(private val registry: Tool
194194
providers.flatMap { provider ->
195195
provider.asArguments().map { argument ->
196196
require(argument.matches(Regex("\\S+=\\S+"))) {
197-
"KSP apoption does not match \\S+=\\S+: $argument"
197+
"Processor arguments not in the format \\S+=\\S+: $argument"
198198
}
199199
InternalSubpluginOption("apoption", argument)
200200
}

gradle-plugin/src/test/kotlin/com/google/devtools/ksp/gradle/GradleCompilationTest.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ class GradleCompilationTest {
306306
)
307307

308308
val result = testRule.runner().withArguments(":app:assemble").buildAndFail()
309-
assertThat(result.output).contains("KSP apoption does not match \\S+=\\S+: invalid")
309+
assertThat(result.output).contains("Processor arguments not in the format \\S+=\\S+: invalid")
310310
}
311311

312312
@Test

0 commit comments

Comments
 (0)