Skip to content

Commit

Permalink
Merge pull request #32 from amzn/rwo/downgrade
Browse files Browse the repository at this point in the history
Downgrade Kotlin Compile Testing
  • Loading branch information
vRallev authored Sep 12, 2024
2 parents db9ae48 + 72f3e2e commit 390114a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 9 deletions.
8 changes: 6 additions & 2 deletions compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ dependencies {
testRuntimeOnly libs.junit.jupiter.launcher

// Added so that the SymbolProcessor is picked up in tests.
testImplementation libs.kotlin.inject.ksp
testImplementation(libs.kotlin.inject.ksp.bugfix) {
// TODO: Remove this when upgrading to Kotlin 2.0
exclude group: 'com.google.devtools.ksp', module: 'symbol-processing-api'
}

// Bump transitive dependency.
testImplementation libs.ksp
// TODO: Enable with KSP2 and Kotlin 2.0 again.
// testImplementation libs.ksp
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ import com.tschuchort.compiletesting.JvmCompilationResult
import com.tschuchort.compiletesting.KotlinCompilation
import com.tschuchort.compiletesting.SourceFile
import com.tschuchort.compiletesting.addPreviousResultToClasspath
import com.tschuchort.compiletesting.configureKsp
import com.tschuchort.compiletesting.kspArgs
import com.tschuchort.compiletesting.kspIncremental
import com.tschuchort.compiletesting.kspWithCompilation
import com.tschuchort.compiletesting.symbolProcessorProviders
import org.intellij.lang.annotations.Language
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
import org.jetbrains.kotlin.config.JvmTarget
Expand Down Expand Up @@ -40,18 +43,17 @@ class Compilation internal constructor(

processorsConfigured = true

kotlinCompilation.configureKsp(useKsp2 = true) {
with(kotlinCompilation) {
this.symbolProcessorProviders += ServiceLoader.load(
SymbolProcessorProvider::class.java,
SymbolProcessorProvider::class.java.classLoader,
)
this.symbolProcessorProviders += symbolProcessorProviders

this.processorOptions.putAll(processorOptions)
this.kspArgs.putAll(processorOptions)

// Run KSP embedded directly within this kotlinc invocation
withCompilation = true
incremental = true
kspWithCompilation = true
kspIncremental = true
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ auto-service-ksp = "1.2.0"
detekt = "1.23.6"
junit-jupiter = "5.10.3"
kotlin = "1.9.24"
kotlin-compile-testing = "0.5.1"
kotlin-compile-testing = "0.4.1"
kotlin-hierarchy = "1.1"
kotlin-inject = "0.7.1"
# This is a snapshot build with the latest fixes. We need that in the sample app.
Expand Down

0 comments on commit 390114a

Please sign in to comment.