package com.intellij.jps.cache;

import com.intellij.openapi.components.ProjectComponent;

public class JpsCachesDummyProjectComponent implements ProjectComponent {
}

@@ -50,118 +50,2195 @@
 lij.
-openapi.components.ProjectComponent;%0A%0Apublic class JpsCachesDummyProjectComponent implements ProjectComponent %7B
+compiler.CompilerWorkspaceConfiguration;%0Aimport com.intellij.compiler.server.BuildManager;%0Aimport com.intellij.ide.util.PropertiesComponent;%0Aimport com.intellij.notification.Notification;%0Aimport com.intellij.notification.NotificationAction;%0Aimport com.intellij.notification.NotificationType;%0Aimport com.intellij.notification.Notifications;%0Aimport com.intellij.openapi.components.ProjectComponent;%0Aimport com.intellij.openapi.project.Project;%0Aimport org.jetbrains.annotations.NotNull;%0A%0Aimport static com.intellij.jps.cache.ui.JpsLoaderNotifications.STICKY_NOTIFICATION_GROUP;%0A%0Apublic class JpsCachesDummyProjectComponent implements ProjectComponent %7B%0A  private static final String NOT_ASK_AGAIN = %22JpsCaches.NOT_ASK_AGAIN%22;%0A  private final Project myProject;%0A  private final PropertiesComponent myPropertiesComponent;%0A  private final CompilerWorkspaceConfiguration myWorkspaceConfiguration;%0A%0A  public JpsCachesDummyProjectComponent(@NotNull Project project) %7B%0A    myProject = project;%0A    myPropertiesComponent = PropertiesComponent.getInstance(project);%0A    myWorkspaceConfiguration = CompilerWorkspaceConfiguration.getInstance(myProject);%0A  %7D%0A%0A  @Override%0A  public void projectOpened() %7B%0A    if (myWorkspaceConfiguration.MAKE_PROJECT_ON_SAVE && !myPropertiesComponent.getBoolean(NOT_ASK_AGAIN, false)) %7B%0A      Notification notification = STICKY_NOTIFICATION_GROUP.createNotification(%22Automatic project build enabled%22,%0A                                                                               %22Make project automatically enabled, it can affect portable caches%22,%0A                                                                               NotificationType.WARNING, null);%0A      notification.addAction(NotificationAction.createSimple(%22Disable Property%22, () -%3E %7B%0A        myWorkspaceConfiguration.MAKE_PROJECT_ON_SAVE = false;%0A        BuildManager.getInstance().clearState(myProject);%0A        notification.expire();%0A      %7D));%0A      notification.addAction(NotificationAction.createSimple(%22Don't ask again%22, () -%3E %7B%0A        myPropertiesComponent.setValue(NOT_ASK_AGAIN, true);%0A        notification.expire();%0A      %7D));%0A      Notifications.Bus.notify(notification, myProject);%0A    %7D%0A  %7D
 %0A%7D%0A

Add notification if automatic project build property enabled