Disable notification about outdated ABI in Kotlin project
This commit is contained in:
Generated
+4
-1
@@ -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>
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
+6
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user