MPP: Do not show -Xmultiplatform flag in facet settings

#KT-26484 Fixed
This commit is contained in:
Alexey Sedunov
2018-09-05 12:03:10 +03:00
parent 5c6193ddf3
commit dbd18ca27b
4 changed files with 20 additions and 5 deletions
@@ -121,6 +121,10 @@ class NewMultiplatformProjectImportingTest : GradleImportingTestCase() {
allModules {
languageVersion("1.2")
apiVersion("1.2")
when (module.name) {
"project", "app", "lib" -> additionalArguments(null)
else -> additionalArguments("-version")
}
}
module("project")
@@ -13,6 +13,7 @@ import com.intellij.openapi.roots.*
import com.intellij.openapi.util.io.FileUtil
import org.jetbrains.jps.model.module.JpsModuleSourceRootType
import org.jetbrains.jps.util.JpsPathUtil
import org.jetbrains.kotlin.idea.facet.KotlinFacet
import org.jetbrains.kotlin.idea.project.languageVersionSettings
import org.jetbrains.kotlin.idea.project.platform
import org.jetbrains.kotlin.platform.IdePlatform
@@ -69,7 +70,7 @@ class ProjectInfo(project: Project, private val projectPath: String) {
}
class ModuleInfo(
private val module: Module,
val module: Module,
private val messageCollector: MessageCollector,
private val projectPath: String
) {
@@ -109,6 +110,15 @@ class ModuleInfo(
}
}
fun additionalArguments(arguments: String?) {
val actualArguments = KotlinFacet.get(module)?.configuration?.settings?.compilerSettings?.additionalArguments
if (actualArguments != arguments) {
messageCollector.report(
"Module '${module.name}': expected additional arguments '$arguments' but found '$actualArguments'"
)
}
}
fun libraryDependency(libraryName: String, scope: DependencyScope) {
val libraryEntry = rootModel.orderEntries.filterIsInstance<LibraryOrderEntry>().singleOrNull { it.libraryName == libraryName }
if (libraryEntry == null) {
@@ -634,7 +634,7 @@ class KotlinMavenImporterTest : MavenImportingTestCase() {
Assert.assertEquals("1.8", (compilerArguments as K2JVMCompilerArguments).jvmTarget)
Assert.assertEquals("foobar.jar", (compilerArguments as K2JVMCompilerArguments).classpath)
Assert.assertEquals(
"-Xmulti-platform",
"-version",
compilerSettings!!.additionalArguments
)
}
@@ -832,7 +832,7 @@ class KotlinMavenImporterTest : MavenImportingTestCase() {
Assert.assertEquals("commonjs", moduleKind)
}
Assert.assertEquals(
"-meta-info -output test.js -Xmulti-platform",
"-meta-info -output test.js",
compilerSettings!!.additionalArguments
)
}
@@ -984,7 +984,7 @@ class KotlinMavenImporterTest : MavenImportingTestCase() {
Assert.assertEquals("JVM 1.8", platform!!.description)
Assert.assertEquals("1.8", (compilerArguments as K2JVMCompilerArguments).jvmTarget)
Assert.assertEquals("foobar.jar", (compilerArguments as K2JVMCompilerArguments).classpath)
Assert.assertEquals("-Xmulti-platform", compilerSettings!!.additionalArguments)
Assert.assertEquals("-version", compilerSettings!!.additionalArguments)
}
}
@@ -176,7 +176,8 @@ val commonUIExposedFields = listOf(
)
private val commonUIHiddenFields = listOf(
CommonCompilerArguments::pluginClasspaths.name,
CommonCompilerArguments::pluginOptions.name
CommonCompilerArguments::pluginOptions.name,
CommonCompilerArguments::multiPlatform.name
)
private val commonPrimaryFields = commonUIExposedFields + commonUIHiddenFields