From 5578e17251d3b06aac686ed4e1fa77d5f9f0d812 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Fri, 28 Jul 2023 20:20:39 +0000 Subject: [PATCH] Update dependency dev.zacsweers.kctfork:core to v0.3.1 (#1070) * Update dependency dev.zacsweers.kctfork:core to v0.3.1 * Fix compilation. --------- Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Colin White --- gradle/libs.versions.toml | 2 +- .../zipline/kotlin/ZiplineKotlinPluginTest.kt | 16 +++++----------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 4001c6fd63..0d20e14cfc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -40,7 +40,7 @@ http4k-core = { module = "org.http4k:http4k-core", version.ref = "http4k" } http4k-server-jetty = { module = "org.http4k:http4k-server-jetty", version.ref = "http4k" } http4k-client-websocket = { module = "org.http4k:http4k-client-websocket", version.ref = "http4k" } junit = { module = "junit:junit", version = "4.13.2" } -kotlin-compile-testing = { module = "dev.zacsweers.kctfork:core", version = "0.2.1" } +kotlin-compile-testing = { module = "dev.zacsweers.kctfork:core", version = "0.3.1" } kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" } kotlin-reflect = { module = "org.jetbrains.kotlin:kotlin-reflect" } kotlin-serialization = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" } diff --git a/zipline-kotlin-plugin-tests/src/test/kotlin/app/cash/zipline/kotlin/ZiplineKotlinPluginTest.kt b/zipline-kotlin-plugin-tests/src/test/kotlin/app/cash/zipline/kotlin/ZiplineKotlinPluginTest.kt index b574c0002a..52ec221eca 100644 --- a/zipline-kotlin-plugin-tests/src/test/kotlin/app/cash/zipline/kotlin/ZiplineKotlinPluginTest.kt +++ b/zipline-kotlin-plugin-tests/src/test/kotlin/app/cash/zipline/kotlin/ZiplineKotlinPluginTest.kt @@ -27,12 +27,11 @@ import assertk.assertions.containsExactly import assertk.assertions.isEqualTo import assertk.assertions.isInstanceOf import assertk.assertions.isNotNull +import com.tschuchort.compiletesting.JvmCompilationResult import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.SourceFile import kotlin.test.assertEquals import kotlinx.serialization.KSerializer -import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption -import org.jetbrains.kotlin.compiler.plugin.CommandLineProcessor import org.jetbrains.kotlin.compiler.plugin.CompilerPluginRegistrar import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.Test @@ -419,28 +418,23 @@ class ZiplineKotlinPluginTest { } } -@OptIn(ExperimentalCompilerApi::class) +@ExperimentalCompilerApi fun compile( sourceFiles: List, plugin: CompilerPluginRegistrar = ZiplineCompilerPluginRegistrar(), -): KotlinCompilation.Result { +): JvmCompilationResult { return KotlinCompilation().apply { sources = sourceFiles useIR = true - // https://github.com/ZacSweers/kotlin-compile-testing/pull/124 - commandLineProcessors = listOf(object : CommandLineProcessor { - override val pluginId get() = "" - override val pluginOptions get() = emptySet() - }) compilerPluginRegistrars = listOf(plugin) inheritClassPath = true }.compile() } -@OptIn(ExperimentalCompilerApi::class) +@ExperimentalCompilerApi fun compile( sourceFile: SourceFile, plugin: CompilerPluginRegistrar = ZiplineCompilerPluginRegistrar(), -): KotlinCompilation.Result { +): JvmCompilationResult { return compile(listOf(sourceFile), plugin) }