mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
external build: support -proceedOnError option for Eclipse compiler
This commit is contained in:
@@ -650,7 +650,7 @@ public class CompileDriver {
|
||||
new CompilerTask(myProject, compileInBackground, contentName, ApplicationManager.getApplication().isUnitTestMode());
|
||||
|
||||
StatusBar.Info.set("", myProject, "Compiler");
|
||||
if (useOutOfProcessBuild() && BuildManager.getInstance().rescanRequired(myProject)) {
|
||||
if (useExtProcessBuild && BuildManager.getInstance().rescanRequired(myProject)) {
|
||||
// ensure the project model seen by build process is up-to-date
|
||||
myProject.save();
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
|
||||
private float myDone = -1.0f;
|
||||
private EventDispatcher<BuildListener> myListeners = EventDispatcher.create(BuildListener.class);
|
||||
private Map<Module, AnnotationProcessingProfile> myAnnotationProcessingProfileMap;
|
||||
private boolean myIsProceedOnErrors = false;
|
||||
|
||||
public CompileContext(CompileScope scope,
|
||||
ProjectDescriptor pd, boolean isMake,
|
||||
@@ -82,6 +83,14 @@ public class CompileContext extends UserDataHolderBase implements MessageHandler
|
||||
return myProjectPaths;
|
||||
}
|
||||
|
||||
public boolean isProceedOnErrors() {
|
||||
return myIsProceedOnErrors;
|
||||
}
|
||||
|
||||
public void setProceedOnErrors(boolean isProceedOnErrors) {
|
||||
myIsProceedOnErrors = isProceedOnErrors;
|
||||
}
|
||||
|
||||
public boolean isMake() {
|
||||
return myIsMake;
|
||||
}
|
||||
|
||||
@@ -38,8 +38,7 @@ import org.jetbrains.jps.incremental.storage.BuildDataManager;
|
||||
import org.jetbrains.jps.incremental.storage.SourceToFormMapping;
|
||||
import org.jetbrains.jps.javac.*;
|
||||
|
||||
import javax.tools.Diagnostic;
|
||||
import javax.tools.JavaFileObject;
|
||||
import javax.tools.*;
|
||||
import java.io.*;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.ServerSocket;
|
||||
@@ -344,7 +343,7 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
if (!compiledOk && diagnosticSink.getErrorCount() == 0) {
|
||||
diagnosticSink.report(new PlainMessageDiagnostic(Diagnostic.Kind.ERROR, "Compilation failed: internal java compiler error"));
|
||||
}
|
||||
if (diagnosticSink.getErrorCount() > 0) {
|
||||
if (!context.isProceedOnErrors() && diagnosticSink.getErrorCount() > 0) {
|
||||
if (!compiledOk) {
|
||||
diagnosticSink.report(new PlainMessageDiagnostic(Diagnostic.Kind.OTHER, "Errors occurred while compiling module '" + chunkName + "'"));
|
||||
}
|
||||
@@ -771,7 +770,8 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
//options.add("-verbose");
|
||||
final Project project = context.getProject();
|
||||
final CompilerConfiguration compilerConfig = project.getCompilerConfiguration();
|
||||
final Map<String, String> opts = useEclipseCompiler(context)? compilerConfig.getEclipseOptions() : compilerConfig.getJavacOptions();
|
||||
final boolean useEclipseCompiler = useEclipseCompiler(context);
|
||||
final Map<String, String> opts = useEclipseCompiler ? compilerConfig.getEclipseOptions() : compilerConfig.getJavacOptions();
|
||||
final boolean debugInfo = !"false".equals(opts.get("DEBUGGING_INFO"));
|
||||
final boolean nowarn = "true".equals(opts.get("GENERATE_NO_WARNINGS"));
|
||||
final boolean deprecation = !"false".equals(opts.get("DEPRECATION"));
|
||||
@@ -808,6 +808,15 @@ public class JavaBuilder extends ModuleLevelBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
if (useEclipseCompiler) {
|
||||
for (String option : options) {
|
||||
if (option.startsWith("-proceedOnError")) {
|
||||
context.setProceedOnErrors(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JAVAC_OPTIONS.set(context, options);
|
||||
JAVAC_VM_OPTIONS.set(context, vmOptions);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user