diff --git a/idea/idea-jvm/build.gradle.kts b/idea/idea-jvm/build.gradle.kts index 1ecba7675e0..278d3ade4ed 100644 --- a/idea/idea-jvm/build.gradle.kts +++ b/idea/idea-jvm/build.gradle.kts @@ -6,7 +6,8 @@ dependencies { compile(project(":compiler:light-classes")) compile(project(":compiler:frontend.java")) compileOnly(intellijDep()) { includeJars("annotations", "openapi", "idea", "extensions", "util", "velocity", "boot", "gson", - "swingx-core", "forms_rt", "jdom", "log4j", "guava", "asm-all", rootProject = rootProject) } + "swingx-core", "forms_rt", "jdom", "log4j", "guava", "asm-all", "picocontainer", + rootProject = rootProject) } compileOnly(commonDep("com.google.code.findbugs", "jsr305")) compileOnly(intellijPluginDep("junit")) { includeJars("idea-junit") } diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/internal/ReactivePostOpenProjectActionsAction.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/internal/ReactivePostOpenProjectActionsAction.kt new file mode 100644 index 00000000000..40546149182 --- /dev/null +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/actions/internal/ReactivePostOpenProjectActionsAction.kt @@ -0,0 +1,19 @@ +/* + * Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license + * that can be found in the license/LICENSE.txt file. + */ + +package org.jetbrains.kotlin.idea.actions.internal + +import com.intellij.openapi.actionSystem.AnAction +import com.intellij.openapi.actionSystem.AnActionEvent +import com.intellij.openapi.project.impl.ProjectImpl +import org.jetbrains.kotlin.idea.configuration.ui.KotlinConfigurationCheckerComponent + +class ReactivePostOpenProjectActionsAction : AnAction() { + override fun actionPerformed(e: AnActionEvent) { + val project = e.project as? ProjectImpl ?: return + val configureComponent = project.getComponentInstancesOfType(KotlinConfigurationCheckerComponent::class.java).single() + configureComponent.performProjectPostOpenActions() + } +} diff --git a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/KotlinConfigurationCheckerComponent.kt b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/KotlinConfigurationCheckerComponent.kt index 3e5e8113932..40bdfb40e99 100644 --- a/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/KotlinConfigurationCheckerComponent.kt +++ b/idea/idea-jvm/src/org/jetbrains/kotlin/idea/configuration/ui/KotlinConfigurationCheckerComponent.kt @@ -70,26 +70,30 @@ class KotlinConfigurationCheckerComponent(project: Project) : AbstractProjectCom super.projectOpened() StartupManager.getInstance(myProject).registerPostStartupActivity { - ApplicationManager.getApplication().executeOnPooledThread { - DumbService.getInstance(myProject).waitForSmartMode() + performProjectPostOpenActions() + } + } - for (module in getModulesWithKotlinFiles(myProject)) { - module.getAndCacheLanguageLevelByDependencies() - } + fun performProjectPostOpenActions() { + ApplicationManager.getApplication().executeOnPooledThread { + DumbService.getInstance(myProject).waitForSmartMode() - val libraries = findOutdatedKotlinLibraries(myProject) - if (!libraries.isEmpty()) { - ApplicationManager.getApplication().invokeLater { - notifyOutdatedKotlinRuntime(myProject, libraries) - } - } - if (!isSyncing) { - val excludeModules = collectModulesWithOutdatedRuntime(libraries) - showConfigureKotlinNotificationIfNeeded(myProject, excludeModules) - } else { - notificationPostponed = true + for (module in getModulesWithKotlinFiles(myProject)) { + module.getAndCacheLanguageLevelByDependencies() + } + + val libraries = findOutdatedKotlinLibraries(myProject) + if (!libraries.isEmpty()) { + ApplicationManager.getApplication().invokeLater { + notifyOutdatedKotlinRuntime(myProject, libraries) } } + if (!isSyncing) { + val excludeModules = collectModulesWithOutdatedRuntime(libraries) + showConfigureKotlinNotificationIfNeeded(myProject, excludeModules) + } else { + notificationPostponed = true + } } } diff --git a/idea/src/META-INF/jvm.xml b/idea/src/META-INF/jvm.xml index fc7b997bcbe..03bf69307d8 100644 --- a/idea/src/META-INF/jvm.xml +++ b/idea/src/META-INF/jvm.xml @@ -46,6 +46,11 @@ class="org.jetbrains.kotlin.idea.internal.makeBackup.CreateIncrementalCompilationBackup"> + + + +