mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Gradle: vmOptions provisioning fix
This commit is contained in:
+5
-3
@@ -25,6 +25,7 @@ import com.intellij.openapi.util.text.StringUtil;
|
||||
import com.intellij.util.ArrayUtilRt;
|
||||
import com.intellij.util.Function;
|
||||
import com.intellij.util.SystemProperties;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.ContainerUtilRt;
|
||||
import org.gradle.StartParameter;
|
||||
import org.gradle.tooling.*;
|
||||
@@ -82,10 +83,11 @@ public class GradleExecutionHelper {
|
||||
public BuildLauncher getBuildLauncher(@NotNull final ExternalSystemTaskId id,
|
||||
@NotNull ProjectConnection connection,
|
||||
@Nullable GradleExecutionSettings settings,
|
||||
@NotNull ExternalSystemTaskNotificationListener listener)
|
||||
@NotNull ExternalSystemTaskNotificationListener listener,
|
||||
@Nullable final String vmOptions)
|
||||
{
|
||||
BuildLauncher result = connection.newBuild();
|
||||
prepare(result, id, settings, listener, Collections.<String>emptyList());
|
||||
prepare(result, id, settings, listener, ContainerUtil.newArrayList(vmOptions == null ? "" : vmOptions.trim()));
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -191,7 +193,7 @@ public class GradleExecutionHelper {
|
||||
}
|
||||
ProjectConnection connection = getConnection(projectPath, settings);
|
||||
try {
|
||||
BuildLauncher launcher = getBuildLauncher(id, connection, settings, listener);
|
||||
BuildLauncher launcher = getBuildLauncher(id, connection, settings, listener, null);
|
||||
try {
|
||||
final File tempFile = FileUtil.createTempFile("wrap", ".gradle");
|
||||
tempFile.deleteOnExit();
|
||||
|
||||
@@ -53,14 +53,14 @@ public class GradleTaskManager implements ExternalSystemTaskManager<GradleExecut
|
||||
@Nullable final String debuggerSetup,
|
||||
@NotNull final ExternalSystemTaskNotificationListener listener) throws ExternalSystemException {
|
||||
|
||||
//if(settings != null && settings.getDistributionType() == DistributionType.WRAPPED) {
|
||||
if(settings != null) {
|
||||
myHelper.ensureInstalledWrapper(id, projectPath, settings, listener);
|
||||
//}
|
||||
}
|
||||
|
||||
Function<ProjectConnection, Void> f = new Function<ProjectConnection, Void>() {
|
||||
@Override
|
||||
public Void fun(ProjectConnection connection) {
|
||||
BuildLauncher launcher = myHelper.getBuildLauncher(id, connection, settings, listener);
|
||||
BuildLauncher launcher = myHelper.getBuildLauncher(id, connection, settings, listener, vmOptions);
|
||||
if (!StringUtil.isEmpty(debuggerSetup)) {
|
||||
try {
|
||||
final File tempFile = FileUtil.createTempFile("init", ".gradle");
|
||||
@@ -78,9 +78,6 @@ public class GradleTaskManager implements ExternalSystemTaskManager<GradleExecut
|
||||
throw new ExternalSystemException(e);
|
||||
}
|
||||
}
|
||||
if (!StringUtil.isEmpty(vmOptions)) {
|
||||
launcher.setJvmArguments(vmOptions.trim());
|
||||
}
|
||||
launcher.forTasks(ArrayUtil.toStringArray(taskNames));
|
||||
launcher.run();
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user