mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
force reload build project settings if bytecode target level settings change
This commit is contained in:
@@ -25,6 +25,7 @@ import com.intellij.ProjectTopics;
|
||||
import com.intellij.compiler.impl.javaCompiler.BackendCompiler;
|
||||
import com.intellij.compiler.impl.javaCompiler.eclipse.EclipseCompiler;
|
||||
import com.intellij.compiler.impl.javaCompiler.javac.JavacCompiler;
|
||||
import com.intellij.compiler.server.BuildManager;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.compiler.CompilerBundle;
|
||||
@@ -41,10 +42,7 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.roots.ProjectRootManager;
|
||||
import com.intellij.openapi.ui.InputValidator;
|
||||
import com.intellij.openapi.ui.Messages;
|
||||
import com.intellij.openapi.util.Couple;
|
||||
import com.intellij.openapi.util.Disposer;
|
||||
import com.intellij.openapi.util.Ref;
|
||||
import com.intellij.openapi.util.SystemInfo;
|
||||
import com.intellij.openapi.util.*;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.vfs.VfsUtilCore;
|
||||
@@ -204,7 +202,11 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
|
||||
}
|
||||
|
||||
public void setProjectBytecodeTarget(@Nullable String level) {
|
||||
final String previous = myBytecodeTargetLevel;
|
||||
myBytecodeTargetLevel = level;
|
||||
if (!myProject.isDefault() && !Comparing.equal(previous, level)) {
|
||||
BuildManager.getInstance().clearState(myProject);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -214,8 +216,12 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
|
||||
}
|
||||
|
||||
public void setModulesBytecodeTargetMap(@NotNull Map<String, String> mapping) {
|
||||
final boolean shouldNotify = !myProject.isDefault() && !myModuleBytecodeTarget.equals(mapping);
|
||||
myModuleBytecodeTarget.clear();
|
||||
myModuleBytecodeTarget.putAll(mapping);
|
||||
if (shouldNotify) {
|
||||
BuildManager.getInstance().clearState(myProject);
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, String> getModulesBytecodeTargetMap() {
|
||||
@@ -231,11 +237,12 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
|
||||
else {
|
||||
previous = myModuleBytecodeTarget.put(module.getName(), level);
|
||||
}
|
||||
// todo: mark module as dirty in order to rebuild it completely with the new target level
|
||||
//if (!Comparing.equal(previous, level)) {
|
||||
// final Project project = module.getProject();
|
||||
//
|
||||
//}
|
||||
if (!Comparing.equal(previous, level)) {
|
||||
final Project project = module.getProject();
|
||||
if (!project.isDefault()) {
|
||||
BuildManager.getInstance().clearState(project);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -139,8 +139,8 @@ public class JavaCompilersTab implements SearchableConfigurable, Configurable.No
|
||||
myCompilerConfiguration.setProjectBytecodeTarget(myTargetLevelComponent.getProjectBytecodeTarget());
|
||||
myCompilerConfiguration.setModulesBytecodeTargetMap(myTargetLevelComponent.getModulesBytecodeTargetMap());
|
||||
|
||||
myTargetLevelComponent.setProjectBytecodeTargetLevel(myCompilerConfiguration.getProjectBytecodeTarget());
|
||||
myTargetLevelComponent.setModuleTargetLevels(myCompilerConfiguration.getModulesBytecodeTargetMap());
|
||||
myCompilerConfiguration.setProjectBytecodeTarget(myTargetLevelComponent.getProjectBytecodeTarget());
|
||||
myCompilerConfiguration.setModulesBytecodeTargetMap(myCompilerConfiguration.getModulesBytecodeTargetMap());
|
||||
}
|
||||
|
||||
public void reset() {
|
||||
|
||||
Reference in New Issue
Block a user