diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/cmdline/KSPJvmMain.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/cmdline/KSPJvmMain.kt index a3672f79bd..24a131aad2 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/cmdline/KSPJvmMain.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/cmdline/KSPJvmMain.kt @@ -9,6 +9,7 @@ import com.google.devtools.ksp.processing.kspJvmArgParserHelp import java.io.File import java.net.URLClassLoader import java.util.ServiceLoader +import kotlin.system.exitProcess class KSPJvmMain { companion object { @@ -45,5 +46,6 @@ internal fun runWithArgs(args: Array, parse: (Array) -> Pair - KotlinSymbolProcessing(config, processorProviders, logger).execute() + val exitCode = KotlinSymbolProcessing(config, processorProviders, logger).execute() + exitProcess(exitCode.code) } diff --git a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt index b226345d07..083d4fcda3 100644 --- a/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt +++ b/kotlin-analysis-api/src/main/kotlin/com/google/devtools/ksp/impl/KotlinSymbolProcessing.kt @@ -126,7 +126,7 @@ class KotlinSymbolProcessing( val logger: KSPLogger ) { enum class ExitCode( - @Suppress("UNUSED_PARAMETER") code: Int + val code: Int ) { OK(0),