Increase metadata version to 1.1, hardcode incompatibility with 1.0
Add a temporary option to suppress incompatibility errors when compiling Kotlin against current IDEA libraries until they are migrated
This commit is contained in:
Generated
+1
-1
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="KotlinCompilerSettings">
|
||||
<option name="additionalArguments" value="-version -Xallow-kotlin-package" />
|
||||
<option name="additionalArguments" value="-version -Xallow-kotlin-package -Xskip-metadata-version-check" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -35,6 +35,7 @@ import org.jetbrains.kotlin.compiler.plugin.PluginCliOptionProcessingException
|
||||
import org.jetbrains.kotlin.compiler.plugin.cliPluginUsageString
|
||||
import org.jetbrains.kotlin.config.*
|
||||
import org.jetbrains.kotlin.load.java.JvmAbi
|
||||
import org.jetbrains.kotlin.load.kotlin.JvmMetadataVersion
|
||||
import org.jetbrains.kotlin.load.kotlin.incremental.components.IncrementalCompilationComponents
|
||||
import org.jetbrains.kotlin.script.StandardScriptDefinition
|
||||
import org.jetbrains.kotlin.util.PerformanceCounter
|
||||
@@ -128,6 +129,10 @@ open class K2JVMCompiler : CLICompiler<K2JVMCompilerArguments>() {
|
||||
shouldReportPerf = false
|
||||
}
|
||||
|
||||
if (arguments.skipMetadataVersionCheck) {
|
||||
JvmMetadataVersion.skipCheck = true
|
||||
}
|
||||
|
||||
putAdvancedOptions(configuration, arguments)
|
||||
|
||||
messageSeverityCollector.report(CompilerMessageSeverity.LOGGING, "Configuring the compilation environment", CompilerMessageLocation.NO_LOCATION)
|
||||
|
||||
+7
-2
@@ -23,11 +23,16 @@ import org.jetbrains.kotlin.serialization.deserialization.BinaryVersion
|
||||
* This version includes the version of the core protobuf messages (descriptors.proto) as well as JVM extensions (jvm_descriptors.proto).
|
||||
*/
|
||||
class JvmMetadataVersion(vararg numbers: Int) : BinaryVersion(*numbers) {
|
||||
override fun isCompatible() = this.isCompatibleTo(INSTANCE)
|
||||
// NOTE: 1.1 is incompatible with 1.0 and hence with any other version except 1.1.*
|
||||
override fun isCompatible() =
|
||||
skipCheck || (this.major == 1 && this.minor == 1)
|
||||
|
||||
companion object {
|
||||
// TODO: this is a temporary hack which can be removed once we migrate the IDEA code from 1.0 to 1.1
|
||||
var skipCheck: Boolean = false
|
||||
|
||||
@JvmField
|
||||
val INSTANCE = JvmMetadataVersion(1, 0, 2)
|
||||
val INSTANCE = JvmMetadataVersion(1, 1, 0)
|
||||
|
||||
@JvmField
|
||||
val INVALID_VERSION = JvmMetadataVersion()
|
||||
|
||||
Reference in New Issue
Block a user