mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Fix KotlinSerializationImportHandler invalid plugin jar path
* Migrate plugin jar path finding logics from compiler's one to KotlinArtifacts * Add integration test to check correct path in pluginClasspath GitOrigin-RevId: c0ed32f4099be0c916fef6844457c9d6f870d3e3
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f5ef36ef15
commit
eb5601e28b
@@ -25,4 +25,5 @@ object KotlinArtifactNames {
|
||||
const val ALLOPEN_COMPILER_PLUGIN = "allopen-compiler-plugin.jar"
|
||||
const val NOARG_COMPILER_PLUGIN = "noarg-compiler-plugin.jar"
|
||||
const val SAM_WITH_RECEIVER_COMPILER_PLUGIN = "sam-with-receiver-compiler-plugin.jar"
|
||||
const val KOTLINX_SERIALIZATION_COMPILER_PLUGIN = "kotlinx-serialization-compiler-plugin.jar"
|
||||
}
|
||||
@@ -47,6 +47,7 @@ abstract class KotlinArtifacts(val kotlincDistDir: File) {
|
||||
val allopenCompilerPlugin = File(kotlincLibDirectory, KotlinArtifactNames.ALLOPEN_COMPILER_PLUGIN)
|
||||
val noargCompilerPlugin = File(kotlincLibDirectory, KotlinArtifactNames.NOARG_COMPILER_PLUGIN)
|
||||
val samWithReceiverCompilerPlugin = File(kotlincLibDirectory, KotlinArtifactNames.SAM_WITH_RECEIVER_COMPILER_PLUGIN)
|
||||
val kotlinxSerializationCompilerPlugin = File(kotlincLibDirectory, KotlinArtifactNames.KOTLINX_SERIALIZATION_COMPILER_PLUGIN)
|
||||
}
|
||||
|
||||
private object ProductionKotlinArtifacts : KotlinArtifacts(run {
|
||||
|
||||
+1
@@ -15,5 +15,6 @@
|
||||
<orderEntry type="module" module-name="kotlin.core" />
|
||||
<orderEntry type="module" module-name="kotlin.jps-common" />
|
||||
<orderEntry type="module" module-name="kotlin.idea" />
|
||||
<orderEntry type="module" module-name="kotlin.common" />
|
||||
</component>
|
||||
</module>
|
||||
+4
-6
@@ -3,18 +3,16 @@
|
||||
package org.jetbrains.kotlin.idea.compilerPlugin.kotlinxSerialization
|
||||
|
||||
import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments
|
||||
import org.jetbrains.kotlin.idea.artifacts.KotlinArtifactNames
|
||||
import org.jetbrains.kotlin.idea.artifacts.KotlinArtifacts
|
||||
import org.jetbrains.kotlin.idea.facet.KotlinFacet
|
||||
import org.jetbrains.kotlin.utils.PathUtil
|
||||
import java.io.File
|
||||
|
||||
object KotlinSerializationImportHandler {
|
||||
private const val pluginJpsJarName = "kotlinx-serialization-compiler-plugin.jar"
|
||||
|
||||
val PLUGIN_JPS_JAR: String
|
||||
get() = File(PathUtil.kotlinPathsForIdeaPlugin.libPath, pluginJpsJarName).absolutePath
|
||||
val PLUGIN_JPS_JAR: String by lazy { KotlinArtifacts.instance.kotlinxSerializationCompilerPlugin.absolutePath }
|
||||
|
||||
fun isPluginJarPath(path: String): Boolean {
|
||||
return path.endsWith(pluginJpsJarName)
|
||||
return path.endsWith(KotlinArtifactNames.KOTLINX_SERIALIZATION_COMPILER_PLUGIN)
|
||||
}
|
||||
|
||||
fun modifyCompilerArguments(facet: KotlinFacet, buildSystemPluginJar: String) {
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
plugins {
|
||||
kotlin("jvm") version "{{kotlin_plugin_version}}"
|
||||
kotlin("plugin.serialization") version "{{kotlin_plugin_version}}"
|
||||
}
|
||||
|
||||
repositories {
|
||||
{ { kts_kotlin_plugin_repositories } }
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.3.1")
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
pluginManagement {
|
||||
repositories {
|
||||
{ { kts_kotlin_plugin_repositories } }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user