diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.java index ce6bf7889a5..250599f93fd 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/CommonCompilerArguments.java @@ -20,6 +20,7 @@ import com.intellij.util.SmartList; import com.sampullara.cli.Argument; import org.jetbrains.annotations.NotNull; +import java.util.Arrays; import java.util.List; public abstract class CommonCompilerArguments { @@ -72,11 +73,44 @@ public abstract class CommonCompilerArguments { public List unknownExtraFlags = new SmartList(); + public CommonCompilerArguments() { + } + + protected CommonCompilerArguments(CommonCompilerArguments arguments) { + this.languageVersion = arguments.languageVersion; + this.apiVersion = arguments.apiVersion; + this.suppressWarnings = arguments.suppressWarnings; + this.verbose = arguments.verbose; + this.version = arguments.version; + this.help = arguments.help; + this.extraHelp = arguments.extraHelp; + this.noInline = arguments.noInline; + this.repeat = arguments.repeat; + this.pluginClasspaths = arguments.pluginClasspaths != null ? Arrays.copyOf(arguments.pluginClasspaths, arguments.pluginClasspaths.length) : null; + this.pluginOptions = arguments.pluginOptions != null ? Arrays.copyOf(arguments.pluginOptions, arguments.pluginOptions.length) : null; + this.freeArgs.addAll(arguments.freeArgs); + this.unknownExtraFlags.addAll(arguments.unknownExtraFlags); + } + + public abstract CommonCompilerArguments copy(); + @NotNull public String executableScriptFileName() { return "kotlinc"; } // Used only for serialize and deserialize settings. Don't use in other places! - public static final class DummyImpl extends CommonCompilerArguments {} + public static final class DummyImpl extends CommonCompilerArguments { + public DummyImpl() { + } + + public DummyImpl(DummyImpl arguments) { + super(arguments); + } + + @Override + public CommonCompilerArguments copy() { + return new DummyImpl(this); + } + } } diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.java index 23041665bca..cbf86a70e0f 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JSCompilerArguments.java @@ -20,6 +20,8 @@ import com.sampullara.cli.Argument; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.util.Arrays; + import static org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.CALL; import static org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants.NO_CALL; @@ -73,6 +75,29 @@ public class K2JSCompilerArguments extends CommonCompilerArguments { @ValueDescription("") public String outputPostfix; + public K2JSCompilerArguments() { + } + + private K2JSCompilerArguments(K2JSCompilerArguments arguments) { + super(arguments); + this.outputFile = arguments.outputFile; + this.noStdlib = arguments.noStdlib; + this.libraryFiles = arguments.libraryFiles != null ? Arrays.copyOf(arguments.libraryFiles, arguments.libraryFiles.length) : null; + this.sourceMap = arguments.sourceMap; + this.metaInfo = arguments.metaInfo; + this.kjsm = arguments.kjsm; + this.target = arguments.target; + this.moduleKind = arguments.moduleKind; + this.main = arguments.main; + this.outputPrefix = arguments.outputPrefix; + this.outputPostfix = arguments.outputPostfix; + } + + @Override + public K2JSCompilerArguments copy() { + return new K2JSCompilerArguments(this); + } + @Override @NotNull public String executableScriptFileName() { diff --git a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.java b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.java index 63858f2fe81..9258f2e80c9 100644 --- a/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.java +++ b/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.java @@ -107,6 +107,12 @@ public class K2JVMCompilerArguments extends CommonCompilerArguments { // Paths to output directories for friend modules. public String[] friendPaths; + @Override + public CommonCompilerArguments copy() { + // No need to copy these arguments yet + throw new UnsupportedOperationException(); + } + @Override @NotNull public String executableScriptFileName() { diff --git a/idea/idea-jps-common/src/org/jetbrains/kotlin/config/CompilerSettings.kt b/idea/idea-jps-common/src/org/jetbrains/kotlin/config/CompilerSettings.kt index 1fedf41bc12..b985feadcdd 100644 --- a/idea/idea-jps-common/src/org/jetbrains/kotlin/config/CompilerSettings.kt +++ b/idea/idea-jps-common/src/org/jetbrains/kotlin/config/CompilerSettings.kt @@ -23,6 +23,16 @@ class CompilerSettings { var copyJsLibraryFiles: Boolean = true var outputDirectoryForJsLibraryFiles: String = DEFAULT_OUTPUT_DIRECTORY + constructor() + + constructor(settings: CompilerSettings) { + additionalArguments = settings.additionalArguments + scriptTemplates = settings.scriptTemplates + scriptTemplatesClasspath = settings.scriptTemplatesClasspath + copyJsLibraryFiles = settings.copyJsLibraryFiles + outputDirectoryForJsLibraryFiles = settings.outputDirectoryForJsLibraryFiles + } + companion object { private val DEFAULT_ADDITIONAL_ARGUMENTS = "-version" private val DEFAULT_OUTPUT_DIRECTORY = "lib" diff --git a/idea/src/org/jetbrains/kotlin/idea/compiler/configuration/KotlinCompilerConfigurableTab.form b/idea/src/org/jetbrains/kotlin/idea/compiler/configuration/KotlinCompilerConfigurableTab.form index 7304eff2434..8fb8c165915 100644 --- a/idea/src/org/jetbrains/kotlin/idea/compiler/configuration/KotlinCompilerConfigurableTab.form +++ b/idea/src/org/jetbrains/kotlin/idea/compiler/configuration/KotlinCompilerConfigurableTab.form @@ -92,7 +92,7 @@ - + @@ -115,7 +115,7 @@ - + diff --git a/idea/src/org/jetbrains/kotlin/idea/compiler/configuration/KotlinCompilerConfigurableTab.java b/idea/src/org/jetbrains/kotlin/idea/compiler/configuration/KotlinCompilerConfigurableTab.java index 0eaced7d246..f63c1034b4a 100644 --- a/idea/src/org/jetbrains/kotlin/idea/compiler/configuration/KotlinCompilerConfigurableTab.java +++ b/idea/src/org/jetbrains/kotlin/idea/compiler/configuration/KotlinCompilerConfigurableTab.java @@ -38,6 +38,7 @@ import org.jetbrains.kotlin.cli.common.arguments.K2JsArgumentConstants; import org.jetbrains.kotlin.config.CompilerSettings; import org.jetbrains.kotlin.idea.KotlinBundle; import org.jetbrains.kotlin.idea.PluginStartupComponent; +import org.jetbrains.kotlin.idea.facet.KotlinFacetConfiguration; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -50,6 +51,7 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co private final CommonCompilerArguments commonCompilerArguments; private final K2JSCompilerArguments k2jsCompilerArguments; private final CompilerSettings compilerSettings; + @Nullable private final KotlinCompilerWorkspaceSettings compilerWorkspaceSettings; private final Project project; private JPanel contentPane; @@ -71,6 +73,8 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co private JTextField scriptTemplatesClasspathField; private JLabel scriptTemplatesLabel; private JLabel scriptTemplatesClasspathLabel; + private JPanel k2jvmPanel; + private JPanel k2jsPanel; static { moduleKindDescriptions.put(K2JsArgumentConstants.MODULE_PLAIN, "Plain (put to global scope)"); @@ -79,12 +83,18 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co moduleKindDescriptions.put(K2JsArgumentConstants.MODULE_UMD, "UMD (detect AMD or CommonJS if available, fallback to plain)"); } - public KotlinCompilerConfigurableTab(Project project) { - this.commonCompilerArguments = KotlinCommonCompilerArgumentsHolder.getInstance(project).getSettings(); - this.k2jsCompilerArguments = Kotlin2JsCompilerArgumentsHolder.getInstance(project).getSettings(); - this.compilerSettings = KotlinCompilerSettings.getInstance(project).getSettings(); - this.compilerWorkspaceSettings = ServiceManager.getService(project, KotlinCompilerWorkspaceSettings.class); + public KotlinCompilerConfigurableTab( + Project project, + CommonCompilerArguments commonCompilerArguments, + K2JSCompilerArguments k2jsCompilerArguments, + CompilerSettings compilerSettings, + @Nullable KotlinCompilerWorkspaceSettings compilerWorkspaceSettings + ) { this.project = project; + this.commonCompilerArguments = commonCompilerArguments; + this.k2jsCompilerArguments = k2jsCompilerArguments; + this.compilerSettings = compilerSettings; + this.compilerWorkspaceSettings = compilerWorkspaceSettings; additionalArgsOptionsField.attachLabel(additionalArgsLabel); @@ -103,6 +113,24 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co }); fillModuleKindList(); + + if (compilerWorkspaceSettings == null) { + keepAliveCheckBox.setVisible(false); + k2jvmPanel.setVisible(false); + } + } + + public void setTargetPlatform(@Nullable KotlinFacetConfiguration.TargetPlatform targetPlatform) { + k2jsPanel.setVisible(targetPlatform == KotlinFacetConfiguration.TargetPlatform.JS); + } + + @SuppressWarnings("unused") + public KotlinCompilerConfigurableTab(Project project) { + this(project, + KotlinCommonCompilerArgumentsHolder.getInstance(project).getSettings(), + Kotlin2JsCompilerArgumentsHolder.getInstance(project).getSettings(), + KotlinCompilerSettings.getInstance(project).getSettings(), + ServiceManager.getService(project, KotlinCompilerWorkspaceSettings.class)); } @SuppressWarnings("unchecked") @@ -152,8 +180,9 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co ComparingUtils.isModified(copyRuntimeFilesCheckBox, compilerSettings.getCopyJsLibraryFiles()) || ComparingUtils.isModified(outputDirectory, compilerSettings.getOutputDirectoryForJsLibraryFiles()) || - ComparingUtils.isModified(enablePreciseIncrementalCheckBox, compilerWorkspaceSettings.getPreciseIncrementalEnabled()) || - ComparingUtils.isModified(keepAliveCheckBox, compilerWorkspaceSettings.getEnableDaemon()) || + (compilerWorkspaceSettings != null && + (ComparingUtils.isModified(enablePreciseIncrementalCheckBox, compilerWorkspaceSettings.getPreciseIncrementalEnabled()) || + ComparingUtils.isModified(keepAliveCheckBox, compilerWorkspaceSettings.getEnableDaemon()))) || ComparingUtils.isModified(generateSourceMapsCheckBox, k2jsCompilerArguments.sourceMap) || isModified(outputPrefixFile, k2jsCompilerArguments.outputPrefix) || @@ -175,12 +204,14 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co compilerSettings.setCopyJsLibraryFiles(copyRuntimeFilesCheckBox.isSelected()); compilerSettings.setOutputDirectoryForJsLibraryFiles(outputDirectory.getText()); - compilerWorkspaceSettings.setPreciseIncrementalEnabled(enablePreciseIncrementalCheckBox.isSelected()); + if (compilerWorkspaceSettings != null) { + compilerWorkspaceSettings.setPreciseIncrementalEnabled(enablePreciseIncrementalCheckBox.isSelected()); - boolean oldEnableDaemon = compilerWorkspaceSettings.getEnableDaemon(); - compilerWorkspaceSettings.setEnableDaemon(keepAliveCheckBox.isSelected()); - if (keepAliveCheckBox.isSelected() != oldEnableDaemon) { - PluginStartupComponent.getInstance().resetAliveFlag(); + boolean oldEnableDaemon = compilerWorkspaceSettings.getEnableDaemon(); + compilerWorkspaceSettings.setEnableDaemon(keepAliveCheckBox.isSelected()); + if (keepAliveCheckBox.isSelected() != oldEnableDaemon) { + PluginStartupComponent.getInstance().resetAliveFlag(); + } } k2jsCompilerArguments.sourceMap = generateSourceMapsCheckBox.isSelected(); @@ -208,8 +239,10 @@ public class KotlinCompilerConfigurableTab implements SearchableConfigurable, Co copyRuntimeFilesCheckBox.setSelected(compilerSettings.getCopyJsLibraryFiles()); outputDirectory.setText(compilerSettings.getOutputDirectoryForJsLibraryFiles()); - enablePreciseIncrementalCheckBox.setSelected(compilerWorkspaceSettings.getPreciseIncrementalEnabled()); - keepAliveCheckBox.setSelected(compilerWorkspaceSettings.getEnableDaemon()); + if (compilerWorkspaceSettings != null) { + enablePreciseIncrementalCheckBox.setSelected(compilerWorkspaceSettings.getPreciseIncrementalEnabled()); + keepAliveCheckBox.setSelected(compilerWorkspaceSettings.getEnableDaemon()); + } generateSourceMapsCheckBox.setSelected(k2jsCompilerArguments.sourceMap); outputPrefixFile.setText(k2jsCompilerArguments.outputPrefix); diff --git a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetConfiguration.kt b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetConfiguration.kt index 6d2f8ead0e8..233c42046e5 100644 --- a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetConfiguration.kt +++ b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetConfiguration.kt @@ -22,6 +22,9 @@ import com.intellij.facet.ui.FacetEditorTab import com.intellij.facet.ui.FacetValidatorsManager import com.intellij.openapi.components.PersistentStateComponent import org.jdom.Element +import org.jetbrains.kotlin.cli.common.arguments.CommonCompilerArguments +import org.jetbrains.kotlin.cli.common.arguments.K2JSCompilerArguments +import org.jetbrains.kotlin.config.CompilerSettings import org.jetbrains.kotlin.idea.util.DescriptionAware class KotlinFacetConfiguration : FacetConfiguration, PersistentStateComponent { @@ -42,8 +45,15 @@ class KotlinFacetConfiguration : FacetConfiguration, PersistentStateComponent { - val tabs = arrayListOf(KotlinFacetEditorTab(this, editorContext, validatorsManager)) + state.initializeIfNeeded(editorContext.module, editorContext.rootModel) + + val compilerTab = KotlinFacetEditorCompilerTab(state.compilerInfo, editorContext) + val generalTab = KotlinFacetEditorGeneralTab(this, editorContext, validatorsManager, compilerTab) + val tabs = arrayListOf(generalTab, compilerTab) KotlinFacetConfigurationExtension.EP_NAME.extensions.flatMapTo(tabs) { it.createEditorTabs(editorContext, validatorsManager) } return tabs.toTypedArray() } diff --git a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorCompilerTab.kt b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorCompilerTab.kt new file mode 100644 index 00000000000..3b7e2a0d952 --- /dev/null +++ b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorCompilerTab.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2010-2016 JetBrains s.r.o. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.jetbrains.kotlin.idea.facet + +import com.intellij.facet.ui.FacetEditorContext +import com.intellij.facet.ui.FacetEditorTab +import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCompilerConfigurableTab + +class KotlinFacetEditorCompilerTab( + compilerInfo: KotlinFacetConfiguration.CompilerInfo, + editorContext: FacetEditorContext +) : FacetEditorTab() { + val compilerConfigurable = KotlinCompilerConfigurableTab( + editorContext.project, + compilerInfo.commonCompilerArguments, + compilerInfo.k2jsCompilerArguments, + compilerInfo.compilerSettings, + null + ) + + override fun apply() = compilerConfigurable.apply() + + override fun getDisplayName() = "Compiler" + + override fun createComponent() = compilerConfigurable.createComponent()!! + + override fun disposeUIResources() = compilerConfigurable.disposeUIResources() + + override fun isModified() = compilerConfigurable.isModified + + override fun reset() = compilerConfigurable.reset() +} \ No newline at end of file diff --git a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorTab.kt b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt similarity index 91% rename from idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorTab.kt rename to idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt index 2e3ee4d0231..8106316e43c 100644 --- a/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorTab.kt +++ b/idea/src/org/jetbrains/kotlin/idea/facet/KotlinFacetEditorGeneralTab.kt @@ -25,10 +25,11 @@ import java.awt.BorderLayout import java.awt.Component import javax.swing.* -class KotlinFacetEditorTab( +class KotlinFacetEditorGeneralTab( private val configuration: KotlinFacetConfiguration, private val editorContext: FacetEditorContext, - validatorsManager: FacetValidatorsManager + validatorsManager: FacetValidatorsManager, + private val compilerTab: KotlinFacetEditorCompilerTab ) : FacetEditorTab() { class DescriptionListCellRenderer : DefaultListCellRenderer() { override fun getListCellRendererComponent(list: JList<*>?, value: Any?, index: Int, isSelected: Boolean, cellHasFocus: Boolean): Component { @@ -51,8 +52,6 @@ class KotlinFacetEditorTab( } } - - private val languageVersionComboBox = JComboBox(KotlinFacetConfiguration.LanguageLevel.values()).apply { setRenderer(DescriptionListCellRenderer()) @@ -83,13 +82,18 @@ class KotlinFacetEditorTab( targetPlatformComboBox.addActionListener { validatorsManager.validate() + updateCompilerTab() } - configuration.state.versionInfo.initializeIfNeeded(editorContext.module, editorContext.rootModel) + updateCompilerTab() reset() } + private fun updateCompilerTab() { + compilerTab.compilerConfigurable.setTargetPlatform(chosenPlatform) + } + override fun isModified(): Boolean { return with(configuration.state.versionInfo) { languageVersionComboBox.selectedItem != languageLevel @@ -131,4 +135,7 @@ class KotlinFacetEditorTab( override fun disposeUIResources() { } + + val chosenPlatform: KotlinFacetConfiguration.TargetPlatform? + get() = targetPlatformComboBox.selectedItem as KotlinFacetConfiguration.TargetPlatform? } diff --git a/idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt b/idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt index e41bdaf1f10..3df71543065 100644 --- a/idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt +++ b/idea/src/org/jetbrains/kotlin/idea/facet/facetUtils.kt @@ -16,6 +16,7 @@ package org.jetbrains.kotlin.idea.facet +import com.intellij.openapi.components.ServiceManager import com.intellij.openapi.module.Module import com.intellij.openapi.projectRoots.JavaSdk import com.intellij.openapi.projectRoots.JavaSdkVersion @@ -23,6 +24,11 @@ import com.intellij.openapi.roots.LibraryOrderEntry import com.intellij.openapi.roots.ModuleRootManager import com.intellij.openapi.roots.ModuleRootModel import com.intellij.util.text.VersionComparatorUtil +import org.jetbrains.kotlin.config.CompilerSettings +import org.jetbrains.kotlin.idea.compiler.configuration.Kotlin2JsCompilerArgumentsHolder +import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCommonCompilerArgumentsHolder +import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCompilerSettings +import org.jetbrains.kotlin.idea.compiler.configuration.KotlinCompilerWorkspaceSettings import org.jetbrains.kotlin.idea.framework.JSLibraryStdPresentationProvider import org.jetbrains.kotlin.idea.framework.JavaRuntimePresentationProvider import org.jetbrains.kotlin.idea.framework.getLibraryProperties @@ -95,24 +101,42 @@ internal fun getLibraryLanguageLevel( return getDefaultLanguageLevel(module, minVersion) } -internal fun KotlinFacetConfiguration.VersionInfo.initializeIfNeeded(module: Module, rootModel: ModuleRootModel?) { - if (targetPlatformKind == null) { - targetPlatformKind = getDefaultTargetPlatform(module, rootModel) +internal fun KotlinFacetConfiguration.Settings.initializeIfNeeded(module: Module, rootModel: ModuleRootModel?) { + val project = module.project + + with(versionInfo) { + if (targetPlatformKind == null) { + targetPlatformKind = getDefaultTargetPlatform(module, rootModel) + } + + if (languageLevel == null) { + languageLevel = getDefaultLanguageLevel(module) + } + + if (apiLevel == null) { + apiLevel = languageLevel!!.coerceAtMost(getLibraryLanguageLevel(module, rootModel, targetPlatformKind!!)) + } } - if (languageLevel == null) { - languageLevel = getDefaultLanguageLevel(module) - } + with(compilerInfo) { + if (commonCompilerArguments == null) { + commonCompilerArguments = KotlinCommonCompilerArgumentsHolder.getInstance(project).settings.copy() + } - if (apiLevel == null) { - apiLevel = languageLevel!!.coerceAtMost(getLibraryLanguageLevel(module, rootModel, targetPlatformKind!!)) + if (compilerSettings == null) { + compilerSettings = CompilerSettings(KotlinCompilerSettings.getInstance(project).settings) + } + + if (k2jsCompilerArguments == null) { + k2jsCompilerArguments = Kotlin2JsCompilerArgumentsHolder.getInstance (project).settings.copy() + } } } -internal fun Module.getKotlinVersionInfo(rootModel: ModuleRootModel? = null): KotlinFacetConfiguration.VersionInfo { - val versionInfo = KotlinFacet.get(this)?.configuration?.state?.versionInfo ?: KotlinFacetConfiguration.VersionInfo() - versionInfo.initializeIfNeeded(this, rootModel) - return versionInfo +internal fun Module.getKotlinSettings(rootModel: ModuleRootModel? = null): KotlinFacetConfiguration.Settings { + val settings = KotlinFacet.get(this)?.configuration?.state ?: KotlinFacetConfiguration.Settings() + settings.initializeIfNeeded(this, rootModel) + return settings } val KotlinFacetConfiguration.TargetPlatform.mavenLibraryId: String