mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
IDEA-94514 External Compiler: Validation On Make not triggered
This commit is contained in:
@@ -162,10 +162,17 @@ public class CompilerManagerImpl extends CompilerManager {
|
||||
public final void addCompiler(@NotNull Compiler compiler) {
|
||||
if (compiler instanceof TranslatingCompiler) {
|
||||
myTranslators.add((TranslatingCompiler)compiler);
|
||||
|
||||
}
|
||||
else {
|
||||
myCompilers.add(compiler);
|
||||
// supporting file instrumenting compilers and validators for external build
|
||||
// Since these compilers are IDE-specific and use PSI, it is ok to run them before and after the build in the IDE
|
||||
if (compiler instanceof SourceInstrumentingCompiler) {
|
||||
addBeforeTask(new FileProcessingCompilerAdapterTask((FileProcessingCompiler)compiler));
|
||||
}
|
||||
else if (compiler instanceof Validator) {
|
||||
addAfterTask(new FileProcessingCompilerAdapterTask((FileProcessingCompiler)compiler));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -174,7 +181,16 @@ public class CompilerManagerImpl extends CompilerManager {
|
||||
myTranslators.remove(compiler);
|
||||
}
|
||||
else {
|
||||
myCompilers.remove(compiler);
|
||||
if (myCompilers.remove(compiler)) {
|
||||
for (List<CompileTask> tasks : Arrays.asList(myBeforeTasks, myAfterTasks)) {
|
||||
for (Iterator<CompileTask> iterator = tasks.iterator(); iterator.hasNext(); ) {
|
||||
CompileTask task = iterator.next();
|
||||
if (task instanceof FileProcessingCompilerAdapterTask && ((FileProcessingCompilerAdapterTask)task).getCompiler() == compiler) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
myCompilerToInputTypes.remove(compiler);
|
||||
myCompilerToOutputTypes.remove(compiler);
|
||||
|
||||
+12
-7
@@ -13,12 +13,9 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package com.intellij.uiDesigner.make;
|
||||
package com.intellij.compiler.impl;
|
||||
|
||||
import com.intellij.compiler.CompilerWorkspaceConfiguration;
|
||||
import com.intellij.compiler.impl.CompilerCacheManager;
|
||||
import com.intellij.compiler.impl.CompilerUtil;
|
||||
import com.intellij.compiler.impl.FileProcessingCompilerStateCache;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.compiler.*;
|
||||
import com.intellij.openapi.project.DumbService;
|
||||
@@ -33,14 +30,22 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* This is an adapter for Form2SourceCompiler to CompileTask interface
|
||||
* This is an adapter for running any FileProcessingCompiler as a compiler task
|
||||
*
|
||||
*
|
||||
* @author Eugene Zhuravlev
|
||||
* Date: 9/5/12
|
||||
*/
|
||||
public class SourceInstrumentationTask implements CompileTask{
|
||||
private final Form2SourceCompiler myCompiler = new Form2SourceCompiler();
|
||||
public class FileProcessingCompilerAdapterTask implements CompileTask{
|
||||
private final FileProcessingCompiler myCompiler;
|
||||
|
||||
public FileProcessingCompilerAdapterTask(FileProcessingCompiler compiler) {
|
||||
myCompiler = compiler;
|
||||
}
|
||||
|
||||
public FileProcessingCompiler getCompiler() {
|
||||
return myCompiler;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean execute(CompileContext context) {
|
||||
-3
@@ -18,7 +18,6 @@ package com.intellij.uiDesigner.propertyInspector;
|
||||
|
||||
import com.intellij.openapi.actionSystem.DataProvider;
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.compiler.CompilerManager;
|
||||
import com.intellij.openapi.components.ProjectComponent;
|
||||
import com.intellij.openapi.fileEditor.FileEditor;
|
||||
import com.intellij.openapi.fileEditor.FileEditorManager;
|
||||
@@ -40,7 +39,6 @@ import com.intellij.uiDesigner.componentTree.ComponentTree;
|
||||
import com.intellij.uiDesigner.componentTree.ComponentTreeBuilder;
|
||||
import com.intellij.uiDesigner.designSurface.GuiEditor;
|
||||
import com.intellij.uiDesigner.editor.UIFormEditor;
|
||||
import com.intellij.uiDesigner.make.SourceInstrumentationTask;
|
||||
import com.intellij.util.ui.update.MergingUpdateQueue;
|
||||
import com.intellij.util.ui.update.Update;
|
||||
import icons.UIDesignerIcons;
|
||||
@@ -82,7 +80,6 @@ public class UIDesignerToolWindowManager implements ProjectComponent {
|
||||
StartupManager.getInstance(myProject).registerPostStartupActivity(new Runnable() {
|
||||
public void run() {
|
||||
myToolWindowReady = true;
|
||||
CompilerManager.getInstance(myProject).addBeforeTask(new SourceInstrumentationTask());
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user