Skip to content

Commit

Permalink
Kotlin 2.0.21
Browse files Browse the repository at this point in the history
  • Loading branch information
eygraber committed Nov 20, 2024
1 parent ba386e5 commit fa0e718
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 11 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import org.gradle.accessors.dm.LibrariesForLibs
import org.gradle.kotlin.dsl.assign
import org.jetbrains.kotlin.gradle.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithTests
import org.jetbrains.kotlin.gradle.targets.js.dsl.ExperimentalWasmDsl
import org.jetbrains.kotlin.gradle.targets.js.npm.tasks.KotlinNpmInstallTask
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
import org.jetbrains.kotlin.gradle.tasks.KotlinJvmCompile
Expand Down
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[versions]
kotlin-inject = "0.7.3-SNAPSHOT"
kotlin = "2.0.10"
ksp = "2.0.10-1.0.24"
kotlin = "2.0.21"
ksp = "2.0.21-1.0.28"
kotlinpoet = "2.0.0"
junit5 = "5.9.3"
jvmTarget = "11"
Expand All @@ -13,7 +13,7 @@ detekt-formatting = { module = "io.gitlab.arturbosch.detekt:detekt-formatting",
ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect", version.ref = "kotlin" }
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
kotlin-compile-testing = { module = "dev.zacsweers.kctfork:ksp", version = "0.5.1" }
kotlin-compile-testing = { module = "dev.zacsweers.kctfork:ksp", version = "0.6.0" }
kotlin-metadata-jvm = { module = "org.jetbrains.kotlin:kotlin-metadata-jvm", version.ref = "kotlin" }
kotlinx-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version = "1.8.0" }
kotlinx-atomicfu = { module = "org.jetbrains.kotlinx:atomicfu", version = "0.23.2" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import com.tschuchort.compiletesting.CompilationResult
import com.tschuchort.compiletesting.DiagnosticSeverity
import com.tschuchort.compiletesting.KotlinCompilation
import com.tschuchort.compiletesting.SourceFile
import com.tschuchort.compiletesting.configureKsp
import com.tschuchort.compiletesting.kspProcessorOptions
import com.tschuchort.compiletesting.kspWithCompilation
import com.tschuchort.compiletesting.symbolProcessorProviders
import me.tatarka.inject.compiler.Options
import me.tatarka.inject.compiler.ksp.InjectProcessorProvider
import org.intellij.lang.annotations.Language
Expand Down Expand Up @@ -47,10 +47,10 @@ class ProjectCompiler(
sources = sourceFiles
when (target) {
Target.KSP -> {
options?.toMap()?.let { kspProcessorOptions.putAll(it) }
symbolProcessorProviders = mutableListOf<SymbolProcessorProvider>().apply {
add(InjectProcessorProvider())
addAll(symbolProcessors)
configureKsp(useKsp2 = true) {
options?.toMap()?.let { kspProcessorOptions.putAll(it) }
symbolProcessorProviders.add(InjectProcessorProvider())
symbolProcessorProviders.addAll(symbolProcessors)
}
}
}
Expand All @@ -77,7 +77,6 @@ class TestCompilationResult(private val result: CompilationResult) {
val success: Boolean
get() = result.exitCode == KotlinCompilation.ExitCode.OK

@OptIn(ExperimentalCompilerApi::class)
fun output(vararg severities: DiagnosticSeverity): String = when {
severities.isEmpty() -> result.messages
else -> result.messagesWithSeverity(*severities)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1495,7 +1495,7 @@ class FailureTest {
""".trimIndent()
).compile()
}.output().all {
contains("e: [ksp] Cannot find an @Inject constructor or provider for: Foo")
contains("Cannot find an @Inject constructor or provider for: Foo")
}
}

Expand Down

0 comments on commit fa0e718

Please sign in to comment.