Skip to content

Commit

Permalink
Update dependency dev.zacsweers.kctfork:core to v0.3.1 (#1070)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
renovate[bot] and colinrtwhite authored Jul 28, 2023
1 parent a75a07c commit 5578e17
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -419,28 +418,23 @@ class ZiplineKotlinPluginTest {
}
}

@OptIn(ExperimentalCompilerApi::class)
@ExperimentalCompilerApi
fun compile(
sourceFiles: List<SourceFile>,
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<AbstractCliOption>()
})
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)
}

0 comments on commit 5578e17

Please sign in to comment.