mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
Kotlin: Claim to support Kotlin 2
We don't fully support it yet, but if we don't claim to support it then Kotlin fails early.
This commit is contained in:
@@ -8,9 +8,9 @@ import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
|
||||
import com.intellij.mock.MockProject
|
||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||
import org.jetbrains.kotlin.config.CompilerConfiguration
|
||||
import com.github.codeql.Kotlin2ComponentRegistrar
|
||||
|
||||
@OptIn(ExperimentalCompilerApi::class)
|
||||
class KotlinExtractorComponentRegistrar : ComponentRegistrar {
|
||||
class KotlinExtractorComponentRegistrar : Kotlin2ComponentRegistrar() {
|
||||
override fun registerProjectComponents(
|
||||
project: MockProject,
|
||||
configuration: CompilerConfiguration
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
// For ComponentRegistrar
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.github.codeql
|
||||
|
||||
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
|
||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||
|
||||
@OptIn(ExperimentalCompilerApi::class)
|
||||
abstract class Kotlin2ComponentRegistrar : ComponentRegistrar {
|
||||
/* Nothing to do; supportsK2 doesn't exist yet. */
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// For ComponentRegistrar
|
||||
@file:Suppress("DEPRECATION")
|
||||
|
||||
package com.github.codeql
|
||||
|
||||
import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi
|
||||
import org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar
|
||||
|
||||
@OptIn(ExperimentalCompilerApi::class)
|
||||
abstract class Kotlin2ComponentRegistrar : ComponentRegistrar {
|
||||
override val supportsK2: Boolean
|
||||
get() = true
|
||||
}
|
||||
Reference in New Issue
Block a user