Always pass languageVersion explicitly to JPS compiler

When 'languageVersion' isn't passed explicitly, compiler will choose
'LATEST_STABLE'.

This may lead to spurious migration of a project to the next major
version after plugin update (e.g. when user had project of major
version X and then installed plugin of version X+1 -- in such case,
meaning of "no language version" suddenly changes).

So, we set it to RELEASED_VERSION, which is exactly the version
that is safe to use as the fallback.
This commit is contained in:
Dmitry Savvinov
2018-08-27 17:16:56 +03:00
committed by Ilya Gorbunov
parent 69a0fedd9f
commit b23bf371cf
@@ -40,9 +40,7 @@ import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.ERROR
import org.jetbrains.kotlin.cli.common.messages.CompilerMessageSeverity.INFO
import org.jetbrains.kotlin.cli.common.messages.MessageCollectorUtil
import org.jetbrains.kotlin.compilerRunner.*
import org.jetbrains.kotlin.config.IncrementalCompilation
import org.jetbrains.kotlin.config.KotlinModuleKind
import org.jetbrains.kotlin.config.Services
import org.jetbrains.kotlin.config.*
import org.jetbrains.kotlin.daemon.common.isDaemonEnabled
import org.jetbrains.kotlin.incremental.*
import org.jetbrains.kotlin.incremental.components.ExpectActualTracker
@@ -345,6 +343,7 @@ class KotlinBuilder : ModuleLevelBuilder(BuilderCategory.SOURCE_PROCESSOR) {
val commonArguments = representativeTarget.compilerArgumentsForChunk(chunk).apply {
reportOutputFiles = true
version = true // Always report the version to help diagnosing user issues if they submit the compiler output
if (languageVersion == null) languageVersion = VersionView.RELEASED_VERSION.versionString
}
if (LOG.isDebugEnabled) {