mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
1. disable javac in-process and jikes compilers
2. compiler settings UI cleanup
This commit is contained in:
@@ -24,11 +24,9 @@ package com.intellij.compiler;
|
||||
import com.intellij.CommonBundle;
|
||||
import com.intellij.ProjectTopics;
|
||||
import com.intellij.compiler.impl.javaCompiler.BackendCompiler;
|
||||
import com.intellij.compiler.impl.javaCompiler.api.CompilerAPICompiler;
|
||||
import com.intellij.compiler.impl.javaCompiler.eclipse.EclipseCompiler;
|
||||
import com.intellij.compiler.impl.javaCompiler.eclipse.EclipseEmbeddedCompiler;
|
||||
import com.intellij.compiler.impl.javaCompiler.javac.JavacCompiler;
|
||||
import com.intellij.compiler.impl.javaCompiler.jikes.JikesCompiler;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.application.ApplicationNamesInfo;
|
||||
import com.intellij.openapi.application.ex.ApplicationManagerEx;
|
||||
@@ -271,8 +269,8 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
|
||||
myRegisteredCompilers.add(JAVAC_EXTERNAL_BACKEND);
|
||||
|
||||
if (!ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
final BackendCompiler JIKES_BACKEND = new JikesCompiler(myProject);
|
||||
myRegisteredCompilers.add(JIKES_BACKEND);
|
||||
//final BackendCompiler JIKES_BACKEND = new JikesCompiler(myProject);
|
||||
//myRegisteredCompilers.add(JIKES_BACKEND);
|
||||
|
||||
if (EclipseCompiler.isInitialized()) {
|
||||
final EclipseCompiler eclipse = new EclipseCompiler(myProject);
|
||||
@@ -289,13 +287,13 @@ public class CompilerConfigurationImpl extends CompilerConfiguration implements
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
CompilerAPICompiler inProcessJavaCompiler = new CompilerAPICompiler(myProject);
|
||||
myRegisteredCompilers.add(inProcessJavaCompiler);
|
||||
}
|
||||
catch (NoClassDefFoundError e) {
|
||||
// wrong JDK
|
||||
}
|
||||
//try {
|
||||
// CompilerAPICompiler inProcessJavaCompiler = new CompilerAPICompiler(myProject);
|
||||
// myRegisteredCompilers.add(inProcessJavaCompiler);
|
||||
//}
|
||||
//catch (NoClassDefFoundError e) {
|
||||
// // wrong JDK
|
||||
//}
|
||||
}
|
||||
|
||||
final BackendCompiler[] compilers = Extensions.getExtensions(BackendCompiler.EP_NAME, myProject);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="com.intellij.compiler.options.CompilerUIConfigurable">
|
||||
<grid id="1663f" binding="myPanel" layout-manager="GridLayoutManager" row-count="8" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<grid id="1663f" binding="myPanel" layout-manager="GridLayoutManager" row-count="7" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
<margin top="0" left="0" bottom="0" right="0"/>
|
||||
<constraints>
|
||||
<xy x="28" y="24" width="883" height="379"/>
|
||||
@@ -10,7 +10,7 @@
|
||||
<children>
|
||||
<vspacer id="67edf">
|
||||
<constraints>
|
||||
<grid row="7" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
<grid row="6" column="0" row-span="1" col-span="2" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
</vspacer>
|
||||
<grid id="b341d" layout-manager="GridLayoutManager" row-count="2" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
|
||||
@@ -77,15 +77,15 @@
|
||||
<text resource-bundle="messages/CompilerBundle" key="label.option.autoshow.first.error"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="ce617" class="javax.swing.JCheckBox" binding="myCbUseCompileServer" default-binding="true">
|
||||
<component id="ce617" class="javax.swing.JCheckBox" binding="myCbUseExternalBuild" default-binding="true">
|
||||
<constraints>
|
||||
<grid row="4" column="0" row-span="1" col-span="2" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Use external build for compilation"/>
|
||||
<text value="Use external build (Javac and Eclipse compilers are supported for java compilation and annotation processing)"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="b9b2d" class="javax.swing.JCheckBox" binding="myCbMakeProjectOnSave">
|
||||
<component id="b9b2d" class="javax.swing.JCheckBox" binding="myCbEnableAutomake">
|
||||
<constraints>
|
||||
<grid row="5" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
@@ -93,14 +93,6 @@
|
||||
<text value="Make project automatically"/>
|
||||
</properties>
|
||||
</component>
|
||||
<component id="dd48b" class="javax.swing.JCheckBox" binding="myCbAllowAutomakeWhileRunningApplication">
|
||||
<constraints>
|
||||
<grid row="6" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
|
||||
</constraints>
|
||||
<properties>
|
||||
<text value="Allow auto-make while a run configuration is active"/>
|
||||
</properties>
|
||||
</component>
|
||||
</children>
|
||||
</grid>
|
||||
</form>
|
||||
|
||||
@@ -44,9 +44,8 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
|
||||
private JCheckBox myCbAssertNotNull;
|
||||
private JLabel myPatternLegendLabel;
|
||||
private JCheckBox myCbAutoShowFirstError;
|
||||
private JCheckBox myCbUseCompileServer;
|
||||
private JCheckBox myCbMakeProjectOnSave;
|
||||
private JCheckBox myCbAllowAutomakeWhileRunningApplication;
|
||||
private JCheckBox myCbUseExternalBuild;
|
||||
private JCheckBox myCbEnableAutomake;
|
||||
|
||||
public CompilerUIConfigurable(final Project project) {
|
||||
myProject = project;
|
||||
@@ -57,13 +56,10 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
|
||||
"<b>/</b> — path separator; <b>/**/</b> — any number of directories; " +
|
||||
"<i><dir_name></i>:<i><pattern></i> — restrict to source roots with the specified name" +
|
||||
"</html>");
|
||||
myCbAllowAutomakeWhileRunningApplication.setVisible(false);
|
||||
myCbUseCompileServer.addItemListener(new ItemListener() {
|
||||
myCbUseExternalBuild.addItemListener(new ItemListener() {
|
||||
@Override
|
||||
public void itemStateChanged(ItemEvent e) {
|
||||
final boolean enabled = myCbUseCompileServer.isSelected();
|
||||
myCbMakeProjectOnSave.setEnabled(enabled);
|
||||
myCbAllowAutomakeWhileRunningApplication.setEnabled(enabled);
|
||||
myCbEnableAutomake.setEnabled(myCbUseExternalBuild.isSelected());
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -75,9 +71,9 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
|
||||
myCbAutoShowFirstError.setSelected(workspaceConfiguration.AUTO_SHOW_ERRORS_IN_EDITOR);
|
||||
myCbClearOutputDirectory.setSelected(workspaceConfiguration.CLEAR_OUTPUT_DIRECTORY);
|
||||
myCbAssertNotNull.setSelected(configuration.isAddNotNullAssertions());
|
||||
myCbUseCompileServer.setSelected(workspaceConfiguration.USE_COMPILE_SERVER);
|
||||
myCbMakeProjectOnSave.setSelected(workspaceConfiguration.MAKE_PROJECT_ON_SAVE);
|
||||
myCbAllowAutomakeWhileRunningApplication.setEnabled(workspaceConfiguration.USE_COMPILE_SERVER);
|
||||
myCbUseExternalBuild.setSelected(workspaceConfiguration.USE_COMPILE_SERVER);
|
||||
myCbEnableAutomake.setSelected(workspaceConfiguration.MAKE_PROJECT_ON_SAVE);
|
||||
myCbEnableAutomake.setEnabled(myCbUseExternalBuild.isSelected());
|
||||
|
||||
configuration.convertPatterns();
|
||||
|
||||
@@ -85,7 +81,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
|
||||
}
|
||||
|
||||
private static String patternsToString(final String[] patterns) {
|
||||
final StringBuffer extensionsString = new StringBuffer();
|
||||
final StringBuilder extensionsString = new StringBuilder();
|
||||
for (int idx = 0; idx < patterns.length; idx++) {
|
||||
if (idx > 0) {
|
||||
extensionsString.append(";");
|
||||
@@ -102,9 +98,8 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
|
||||
workspaceConfiguration.AUTO_SHOW_ERRORS_IN_EDITOR = myCbAutoShowFirstError.isSelected();
|
||||
workspaceConfiguration.CLEAR_OUTPUT_DIRECTORY = myCbClearOutputDirectory.isSelected();
|
||||
boolean wasUsingExternalMake = workspaceConfiguration.USE_COMPILE_SERVER;
|
||||
workspaceConfiguration.USE_COMPILE_SERVER = myCbUseCompileServer.isSelected();
|
||||
workspaceConfiguration.MAKE_PROJECT_ON_SAVE = myCbMakeProjectOnSave.isSelected();
|
||||
workspaceConfiguration.ALLOW_AUTOMAKE_WHILE_RUNNING_APPLICATION = myCbAllowAutomakeWhileRunningApplication.isSelected();
|
||||
workspaceConfiguration.USE_COMPILE_SERVER = myCbUseExternalBuild.isSelected();
|
||||
workspaceConfiguration.MAKE_PROJECT_ON_SAVE = myCbEnableAutomake.isSelected();
|
||||
|
||||
configuration.setAddNotNullAssertions(myCbAssertNotNull.isSelected());
|
||||
configuration.removeResourceFilePatterns();
|
||||
@@ -115,6 +110,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
|
||||
final TranslatingCompilerFilesMonitor monitor = TranslatingCompilerFilesMonitor.getInstance();
|
||||
if (workspaceConfiguration.USE_COMPILE_SERVER) {
|
||||
monitor.suspendProject(myProject);
|
||||
//noinspection SSBasedInspection
|
||||
SwingUtilities.invokeLater(new Runnable() {
|
||||
public void run() {
|
||||
CompileServerManager.getInstance().sendReloadRequest(myProject);
|
||||
@@ -160,7 +156,7 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
|
||||
}
|
||||
|
||||
if (errors.size() > 0) {
|
||||
final StringBuffer pattersnsWithErrors = new StringBuffer();
|
||||
final StringBuilder pattersnsWithErrors = new StringBuilder();
|
||||
for (final Object error : errors) {
|
||||
String[] pair = (String[])error;
|
||||
pattersnsWithErrors.append("\n");
|
||||
@@ -179,9 +175,8 @@ public class CompilerUIConfigurable implements SearchableConfigurable, Configura
|
||||
boolean isModified = false;
|
||||
final CompilerWorkspaceConfiguration workspaceConfiguration = CompilerWorkspaceConfiguration.getInstance(myProject);
|
||||
isModified |= ComparingUtils.isModified(myCbAutoShowFirstError, workspaceConfiguration.AUTO_SHOW_ERRORS_IN_EDITOR);
|
||||
isModified |= ComparingUtils.isModified(myCbUseCompileServer, workspaceConfiguration.USE_COMPILE_SERVER);
|
||||
isModified |= ComparingUtils.isModified(myCbMakeProjectOnSave, workspaceConfiguration.MAKE_PROJECT_ON_SAVE);
|
||||
isModified |= ComparingUtils.isModified(myCbAllowAutomakeWhileRunningApplication, workspaceConfiguration.allowAutoMakeWhileRunningApplication());
|
||||
isModified |= ComparingUtils.isModified(myCbUseExternalBuild, workspaceConfiguration.USE_COMPILE_SERVER);
|
||||
isModified |= ComparingUtils.isModified(myCbEnableAutomake, workspaceConfiguration.MAKE_PROJECT_ON_SAVE);
|
||||
|
||||
final CompilerConfigurationImpl compilerConfiguration = (CompilerConfigurationImpl)CompilerConfiguration.getInstance(myProject);
|
||||
isModified |= ComparingUtils.isModified(myCbAssertNotNull, compilerConfiguration.isAddNotNullAssertions());
|
||||
|
||||
@@ -37,7 +37,6 @@ public class CompilerWorkspaceConfiguration implements PersistentStateComponent<
|
||||
public boolean CLEAR_OUTPUT_DIRECTORY = true;
|
||||
public boolean USE_COMPILE_SERVER = false;
|
||||
public boolean MAKE_PROJECT_ON_SAVE = false;
|
||||
public boolean ALLOW_AUTOMAKE_WHILE_RUNNING_APPLICATION = false;
|
||||
|
||||
public static CompilerWorkspaceConfiguration getInstance(Project project) {
|
||||
return ServiceManager.getService(project, CompilerWorkspaceConfiguration.class);
|
||||
|
||||
Reference in New Issue
Block a user