mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
JavaParameters migrated to new api (IDEA-55925 fixed), special order processing for maven implemented
This commit is contained in:
+10
-18
@@ -18,13 +18,11 @@ package com.intellij.execution.configurations;
|
||||
import com.intellij.execution.CantRunException;
|
||||
import com.intellij.execution.ExecutionBundle;
|
||||
import com.intellij.openapi.actionSystem.DataKey;
|
||||
import com.intellij.openapi.extensions.Extensions;
|
||||
import com.intellij.openapi.module.Module;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.projectRoots.Sdk;
|
||||
import com.intellij.openapi.roots.ModuleRootManager;
|
||||
import com.intellij.openapi.roots.ProjectClasspathTraversing;
|
||||
import com.intellij.openapi.roots.ProjectRootsTraversing;
|
||||
import com.intellij.openapi.roots.OrderEnumerator;
|
||||
import com.intellij.openapi.vfs.VirtualFile;
|
||||
import com.intellij.openapi.vfs.encoding.EncodingProjectManager;
|
||||
|
||||
@@ -66,7 +64,7 @@ public class JavaParameters extends SimpleJavaParameters {
|
||||
}
|
||||
|
||||
setDefaultCharset(module.getProject());
|
||||
ProjectRootsTraversing.collectRoots(module, getPolicy(null, module, classPathType), getClassPath());
|
||||
configureEnumerator(OrderEnumerator.orderEntries(module).runtimeOnly().recursively(), classPathType).collectPaths(getClassPath());
|
||||
}
|
||||
|
||||
public void setDefaultCharset(final Project project) {
|
||||
@@ -104,22 +102,16 @@ public class JavaParameters extends SimpleJavaParameters {
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectRootsTraversing.collectRoots(project, getPolicy(project, null, classPathType), getClassPath());
|
||||
configureEnumerator(OrderEnumerator.orderEntries(project).runtimeOnly(), classPathType).collectPaths(getClassPath());
|
||||
}
|
||||
|
||||
private ProjectRootsTraversing.RootTraversePolicy getPolicy(Project project, Module module, int classPathType) {
|
||||
ProjectRootsTraversing.RootTraversePolicy result = (classPathType & TESTS_ONLY) != 0
|
||||
? (classPathType & JDK_ONLY) != 0 ? ProjectClasspathTraversing.FULL_CLASSPATH_RECURSIVE : ProjectClasspathTraversing.FULL_CLASS_RECURSIVE_WO_JDK
|
||||
: (classPathType & JDK_ONLY) != 0 ? ProjectClasspathTraversing.FULL_CLASSPATH_WITHOUT_TESTS : ProjectClasspathTraversing.FULL_CLASSPATH_WITHOUT_JDK_AND_TESTS;
|
||||
|
||||
for (JavaClasspathPolicyExtender each : Extensions.getExtensions(JavaClasspathPolicyExtender.EP_NAME)) {
|
||||
if (project == null) {
|
||||
result = each.extend(module, result);
|
||||
}
|
||||
else {
|
||||
result = each.extend(project, result);
|
||||
}
|
||||
private static OrderEnumerator configureEnumerator(OrderEnumerator enumerator, int classPathType) {
|
||||
if ((classPathType & JDK_ONLY) == 0) {
|
||||
enumerator = enumerator.withoutSdk();
|
||||
}
|
||||
return result;
|
||||
if ((classPathType & TESTS_ONLY) == 0) {
|
||||
enumerator = enumerator.productionOnly();
|
||||
}
|
||||
return enumerator;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user