mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
avoid CommandLineWrapper as mediator when no vm properties were written in the classpath jar
This commit is contained in:
@@ -47,14 +47,12 @@ import com.intellij.openapi.util.Getter;
|
||||
import com.intellij.openapi.util.io.FileUtil;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.openapi.util.text.StringUtilRt;
|
||||
import com.intellij.openapi.vfs.CharsetToolkit;
|
||||
import com.intellij.psi.JavaPsiFacade;
|
||||
import com.intellij.psi.PsiDirectory;
|
||||
import com.intellij.psi.PsiPackage;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.search.GlobalSearchScopesCore;
|
||||
import com.intellij.rt.execution.CommandLineWrapper;
|
||||
import com.intellij.util.PathUtil;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
@@ -251,7 +249,7 @@ public abstract class JavaTestFrameworkRunnableState<T extends ModuleBasedConfig
|
||||
final PrintWriter writer = new PrintWriter(tempFile, CharsetToolkit.UTF8);
|
||||
try {
|
||||
if (JdkUtil.useDynamicClasspath(getConfiguration().getProject())) {
|
||||
writer.println(PathUtil.getJarPathForClass(CommandLineWrapper.class));
|
||||
writer.println("use classpath jar");
|
||||
}
|
||||
else {
|
||||
writer.println("");
|
||||
|
||||
+1
-6
@@ -15,8 +15,6 @@
|
||||
*/
|
||||
package com.intellij.rt.execution.testFrameworks;
|
||||
|
||||
import com.intellij.rt.execution.CommandLineWrapper;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -83,10 +81,7 @@ public abstract class ForkedByModuleSplitter {
|
||||
builder.add("-classpath");
|
||||
if (myDynamicClasspath.length() > 0) {
|
||||
try {
|
||||
final File classpathFile = createClasspathJarFile(new Manifest(), classpath);
|
||||
builder.add(myDynamicClasspath + File.pathSeparator + classpathFile.getAbsolutePath());
|
||||
builder.add(CommandLineWrapper.class.getName());
|
||||
builder.add(classpathFile.getAbsolutePath());
|
||||
builder.add(createClasspathJarFile(new Manifest(), classpath).getAbsolutePath());
|
||||
}
|
||||
catch (Throwable e) {
|
||||
builder.add(classpath);
|
||||
|
||||
@@ -105,8 +105,6 @@ public class ExternalProcessUtil {
|
||||
final String classpathFile = CommandLineWrapperUtil.createClasspathJarFile(new Manifest(), classpath).getAbsolutePath();
|
||||
commandLineWrapperArgs = Arrays.asList(
|
||||
"-classpath",
|
||||
ClasspathBootstrap.getResourcePath(wrapperClass) + File.pathSeparator + classpathFile,
|
||||
wrapperClass.getName(),
|
||||
classpathFile
|
||||
);
|
||||
}
|
||||
|
||||
@@ -173,7 +173,8 @@ public class JdkUtil {
|
||||
final Manifest manifest = new Manifest();
|
||||
manifest.getMainAttributes().putValue("Created-By",
|
||||
ApplicationNamesInfo.getInstance().getFullProductName());
|
||||
if (javaParameters.isDynamicVMOptions() && useDynamicVMOptions()) {
|
||||
final boolean writeDynamicVMOptions = javaParameters.isDynamicVMOptions() && useDynamicVMOptions();
|
||||
if (writeDynamicVMOptions) {
|
||||
List<String> dParams = new ArrayList<String>();
|
||||
for (String param : vmParametersList.getList()) {
|
||||
if (param.startsWith("-D")) {
|
||||
@@ -193,11 +194,16 @@ public class JdkUtil {
|
||||
final List<String> classPathList = javaParameters.getClassPath().getPathList();
|
||||
final String jarFile = CommandLineWrapperUtil.createClasspathJarFile(manifest, classPathList, notEscape).getAbsolutePath();
|
||||
commandLine.addParameter("-classpath");
|
||||
commandLine.addParameter(PathUtil.getJarPathForClass(commandLineWrapper) + File.pathSeparator + jarFile);
|
||||
|
||||
appendEncoding(javaParameters, commandLine, vmParametersList);
|
||||
commandLine.addParameter(commandLineWrapper.getName());
|
||||
commandLine.addParameter(jarFile);
|
||||
if (writeDynamicVMOptions) {
|
||||
commandLine.addParameter(PathUtil.getJarPathForClass(commandLineWrapper) + File.pathSeparator + jarFile);
|
||||
appendEncoding(javaParameters, commandLine, vmParametersList);
|
||||
commandLine.addParameter(commandLineWrapper.getName());
|
||||
commandLine.addParameter(jarFile);
|
||||
}
|
||||
else {
|
||||
commandLine.addParameters(jarFile);
|
||||
appendEncoding(javaParameters, commandLine, vmParametersList);
|
||||
}
|
||||
}
|
||||
catch (IOException e) {
|
||||
LOG.error(e);
|
||||
|
||||
Reference in New Issue
Block a user