Kotlin Facet: Do not auto-advance version in imported projects

#KT-21879 Fixed
This commit is contained in:
Alexey Sedunov
2017-12-18 20:43:33 +03:00
parent 88540360b4
commit b5bd5942e7
5 changed files with 26 additions and 0 deletions
@@ -207,6 +207,7 @@ class KotlinMavenImporter : MavenImporter(KOTLIN_PLUGIN_GROUP_ID, KOTLIN_PLUGIN_
}
MavenProjectImportHandler.getInstances(module.project).forEach { it(kotlinFacet, mavenProject) }
setImplementedModuleName(kotlinFacet, mavenProject, module)
kotlinFacet.noVersionAutoAdvance()
}
private fun detectPlatform(mavenProject: MavenProject) = detectPlatformByExecutions(mavenProject) ?:
@@ -460,6 +460,8 @@ class KotlinMavenImporterTest : MavenImportingTestCase() {
Assert.assertEquals("1.1", compilerArguments!!.languageVersion)
Assert.assertEquals("1.0", apiLevel!!.versionString)
Assert.assertEquals("1.0", compilerArguments!!.apiVersion)
Assert.assertFalse(compilerArguments!!.autoAdvanceLanguageVersion)
Assert.assertFalse(compilerArguments!!.autoAdvanceApiVersion)
Assert.assertEquals(true, compilerArguments!!.suppressWarnings)
Assert.assertEquals(LanguageFeature.State.ENABLED, coroutineSupport)
Assert.assertEquals("JVM 1.8", targetPlatformKind!!.description)
@@ -586,6 +588,8 @@ class KotlinMavenImporterTest : MavenImportingTestCase() {
Assert.assertEquals("1.1", compilerArguments!!.languageVersion)
Assert.assertEquals("1.0", apiLevel!!.versionString)
Assert.assertEquals("1.0", compilerArguments!!.apiVersion)
Assert.assertFalse(compilerArguments!!.autoAdvanceLanguageVersion)
Assert.assertFalse(compilerArguments!!.autoAdvanceApiVersion)
Assert.assertEquals(true, compilerArguments!!.suppressWarnings)
Assert.assertEquals(LanguageFeature.State.ENABLED, coroutineSupport)
Assert.assertTrue(targetPlatformKind is TargetPlatformKind.JavaScript)