mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
separate jdk version limits for jps process and javac compiler
This commit is contained in:
@@ -57,8 +57,7 @@ import org.jetbrains.jps.javac.ExternalJavacManager;
|
||||
import org.jetbrains.jps.javac.OutputFileConsumer;
|
||||
import org.jetbrains.jps.javac.OutputFileObject;
|
||||
|
||||
import javax.tools.Diagnostic;
|
||||
import javax.tools.JavaFileObject;
|
||||
import javax.tools.*;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.lang.reflect.Array;
|
||||
@@ -345,7 +344,7 @@ public class CompilerManagerImpl extends CompilerManager {
|
||||
Collection<File> files,
|
||||
File outputDir) throws IOException, CompilationException {
|
||||
|
||||
final Pair<Sdk, JavaSdkVersion> runtime = BuildManager.getBuildProcessRuntimeSdk(myProject);
|
||||
final Pair<Sdk, JavaSdkVersion> runtime = BuildManager.getJavacRuntimeSdk(myProject);
|
||||
|
||||
String javaHome = null;
|
||||
final Sdk sdk = runtime.getFirst();
|
||||
|
||||
@@ -876,7 +876,16 @@ public class BuildManager implements Disposable {
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Pair<Sdk, JavaSdkVersion> getBuildProcessRuntimeSdk(Project project) {
|
||||
public static Pair<Sdk, JavaSdkVersion> getBuildProcessRuntimeSdk(@NotNull Project project) {
|
||||
return getRuntimeSdk(project, JavaSdkVersion.JDK_1_8);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
public static Pair<Sdk, JavaSdkVersion> getJavacRuntimeSdk(@NotNull Project project) {
|
||||
return getRuntimeSdk(project, JavaSdkVersion.JDK_1_6);
|
||||
}
|
||||
|
||||
private static Pair<Sdk, JavaSdkVersion> getRuntimeSdk(@NotNull Project project, final JavaSdkVersion oldestPossibleVersion) {
|
||||
final Set<Sdk> candidates = new LinkedHashSet<>();
|
||||
final Sdk defaultSdk = ProjectRootManager.getInstance(project).getProjectSdk();
|
||||
if (defaultSdk != null && defaultSdk.getSdkType() instanceof JavaSdkType) {
|
||||
@@ -918,9 +927,7 @@ public class BuildManager implements Disposable {
|
||||
}
|
||||
}
|
||||
|
||||
final JavaSdkVersion oldestPossible = JavaSdkVersion.JDK_1_8;
|
||||
|
||||
if (projectJdk == null || sdkVersion == null || !sdkVersion.isAtLeast(oldestPossible)) {
|
||||
if (projectJdk == null || sdkVersion == null || !sdkVersion.isAtLeast(oldestPossibleVersion)) {
|
||||
final Sdk internalJdk = JavaAwareProjectJdkTableImpl.getInstanceEx().getInternalJdk();
|
||||
projectJdk = internalJdk;
|
||||
sdkVersion = javaSdkType.getVersion(internalJdk);
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ public class CompilingEvaluatorImpl extends CompilingEvaluator {
|
||||
}
|
||||
JavaBuilder.addAnnotationProcessingOptions(options, profile);
|
||||
|
||||
final Pair<Sdk, JavaSdkVersion> runtime = BuildManager.getBuildProcessRuntimeSdk(myEvaluationContext.getProject());
|
||||
final Pair<Sdk, JavaSdkVersion> runtime = BuildManager.getJavacRuntimeSdk(myEvaluationContext.getProject());
|
||||
final JavaSdkVersion buildRuntimeVersion = runtime.getSecond();
|
||||
// if compiler or debuggee version or both are unknown, let source and target be the compiler's defaults
|
||||
if (buildRuntimeVersion != null && debuggeeVersion != null) {
|
||||
|
||||
Reference in New Issue
Block a user