Skip to content

Commit

Permalink
Added ability to set vmArgs for EquinoxLaunchTask.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed Jul 8, 2018
1 parent 5de48d5 commit af5fc92
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

### Version 3.16.0-SNAPSHOT - TBD ([javadoc](http://diffplug.github.io/goomph/javadoc/snapshot/), [snapshot](https://oss.sonatype.org/content/repositories/snapshots/com/diffplug/gradle/goomph/))

- Added ability to set vmArgs for EquinoxLaunchTask.

### Version 3.15.0 - July 6th 2018 ([javadoc](http://diffplug.github.io/goomph/javadoc/3.15.0/), [jcenter](https://bintray.com/diffplug/opensource/goomph/3.15.0/view))

- Added support for eclipse 4.8.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@ public class EquinoxLaunchTask extends DefaultTask {
private File installDir;
private File workingDir;
private List<String> args;
private List<String> vmArgs;

@TaskAction
public void launch() throws Exception {
Objects.requireNonNull(installDir, "installDir");
// workingDir can be null
Objects.requireNonNull(args, "args");
JarFolderRunnerExternalJvm jvm = new JarFolderRunnerExternalJvm(installDir, workingDir, getProject());
jvm.setVmArgs(vmArgs);
jvm.run(args);
}

Expand Down Expand Up @@ -66,4 +68,12 @@ public List<String> getArgs() {
public void setArgs(List<String> args) {
this.args = args;
}

public List<String> getVmArgs() {
return vmArgs;
}

public void setVmArgs(List<String> vmArgs) {
this.vmArgs = vmArgs;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ public class JarFolderRunnerExternalJvm implements EclipseRunner {
final File workingDirectory;
@Nullable
final Project project;
@Nullable
List<String> vmArgs;

/**
* If you have a gradle {@link Project} object handy, use
Expand Down Expand Up @@ -72,6 +74,10 @@ public JarFolderRunnerExternalJvm(File rootDirectory, @Nullable File workingDire
this.project = project;
}

public void setVmArgs(@Nullable List<String> vmArgs) {
this.vmArgs = vmArgs;
}

@Override
public void run(List<String> args) throws Exception {
RunOutside outside = new RunOutside(rootDirectory, args);
Expand All @@ -98,6 +104,9 @@ private void modifyClassPath(JavaExecSpec execSpec) {
return true;
}
}));
if (vmArgs != null) {
execSpec.jvmArgs(vmArgs);
}
}

/** Jars on the classpath that should be used in the launcher. */
Expand Down

0 comments on commit af5fc92

Please sign in to comment.