Disable notification about outdated ABI in Kotlin project

This commit is contained in:
Nikolay Krasko
2015-09-09 02:14:21 +03:00
parent 0f6bf80c0a
commit 0b6c484c6d
4 changed files with 50 additions and 1 deletions
+4 -1
View File
@@ -52,10 +52,13 @@
<component name="ProjectRootManager" version="2" languageLevel="JDK_1_6" assert-keyword="true" jdk-15="true" project-jdk-name="1.6" project-jdk-type="JavaSDK">
<output url="file://$PROJECT_DIR$/out" />
</component>
<component name="SuppressABINotification">
<option name="isSuppressed" value="true" />
</component>
<component name="WebServicesPlugin" addRequiredLibraries="true" />
<component name="com.sixrr.metrics.MetricsReloaded">
<option name="selectedProfile" value="" />
<option name="autoscroll" value="false" />
<option name="showOnlyWarnings" value="false" />
</component>
</project>
</project>
+2
View File
@@ -206,6 +206,8 @@
<projectService serviceImplementation="org.jetbrains.kotlin.idea.compiler.configuration.KotlinCompilerWorkspaceSettings"/>
<projectService serviceImplementation="org.jetbrains.kotlin.idea.versions.SuppressNotificationState"/>
<projectService serviceInterface="org.jetbrains.kotlin.asJava.KotlinLightClassForFacade$PackageFacadeStubCache"
serviceImplementation="org.jetbrains.kotlin.asJava.KotlinLightClassForFacade$PackageFacadeStubCache"/>
@@ -0,0 +1,38 @@
/*
* Copyright 2010-2015 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.versions;
import com.intellij.openapi.components.PersistentStateComponent;
import com.intellij.openapi.components.State;
import com.intellij.openapi.components.Storage;
import com.intellij.openapi.components.StoragePathMacros;
import com.intellij.util.xmlb.XmlSerializerUtil;
@State(name = "SuppressABINotification", storages = {@Storage(file = StoragePathMacros.PROJECT_FILE)})
public class SuppressNotificationState implements PersistentStateComponent<SuppressNotificationState> {
public boolean isSuppressed;
@Override
public SuppressNotificationState getState() {
return this;
}
@Override
public void loadState(SuppressNotificationState state) {
XmlSerializerUtil.copyBean(state, this);
}
}
@@ -22,6 +22,7 @@ import com.intellij.ProjectTopics;
import com.intellij.icons.AllIcons;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.compiler.CompilerManager;
import com.intellij.openapi.components.ServiceManager;
import com.intellij.openapi.fileEditor.FileEditor;
import com.intellij.openapi.fileEditor.OpenFileDescriptor;
import com.intellij.openapi.module.Module;
@@ -86,6 +87,11 @@ public class UnsupportedAbiVersionNotificationPanelProvider extends EditorNotifi
@Nullable
public static EditorNotificationPanel checkAndCreate(@NotNull Project project) {
SuppressNotificationState state = ServiceManager.getService(project, SuppressNotificationState.class).getState();
if (state != null && state.isSuppressed) {
return null;
}
Collection<VirtualFile> badRoots = collectBadRoots(project);
if (!badRoots.isEmpty()) {
return new UnsupportedAbiVersionNotificationPanelProvider(project).doCreate(badRoots);