Skip to content

Commit

Permalink
Disable KSP2
Browse files Browse the repository at this point in the history
Disable KSP2 again as there are still subtle bugs such as: evant/kotlin-inject#447
  • Loading branch information
vRallev committed Oct 25, 2024
1 parent 7f050d0 commit 37329d8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,19 @@ class Compilation internal constructor(
fun configureKotlinInjectAnvilProcessor(
processorOptions: Map<String, String> = emptyMap(),
symbolProcessorProviders: Set<SymbolProcessorProvider> = emptySet(),
useKsp2: Boolean = true,
): Compilation = apply {
checkNotCompiled()
check(!processorsConfigured) { "Processor should not be configured twice." }

processorsConfigured = true

with(kotlinCompilation) {
configureKsp(useKsp2 = true) {
if (!useKsp2) {
languageVersion = "1.9"
}

configureKsp(useKsp2 = useKsp2) {
this.symbolProcessorProviders += ServiceLoader.load(
SymbolProcessorProvider::class.java,
SymbolProcessorProvider::class.java.classLoader,
Expand Down Expand Up @@ -138,6 +143,7 @@ fun compile(
workingDir: File? = null,
previousCompilationResult: JvmCompilationResult? = null,
moduleName: String? = null,
useKsp2: Boolean = true,
exitCode: KotlinCompilation.ExitCode = KotlinCompilation.ExitCode.OK,
block: JvmCompilationResult.() -> Unit = { },
): JvmCompilationResult {
Expand All @@ -158,7 +164,7 @@ fun compile(
addPreviousCompilationResult(previousCompilationResult)
}
}
.configureKotlinInjectAnvilProcessor()
.configureKotlinInjectAnvilProcessor(useKsp2 = useKsp2)
.compile(*sources)
.also {
if (exitCode == KotlinCompilation.ExitCode.OK) {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ org.gradle.caching=true

kotlin.code.style=official
kotlin.mpp.stability.nowarn=true
ksp.useKSP2=true
ksp.useKSP2=false

# This property does not work when setting up publishing through the DSL as we do.
# SONATYPE_AUTOMATIC_RELEASE=true
Expand Down

0 comments on commit 37329d8

Please sign in to comment.