@Override public ConfigurationStage setJvmArguments(final String... jvmArguments) { getBuildLauncher().setJvmArguments(jvmArguments); return this; }
@Override public ConfigurationStage setJvmArguments(final String... jvmArguments) { getBuildLauncher().setJvmArguments(jvmArguments); return this; }
private static void setBuildJVMArgs(final BuildLauncher build) throws IOException { build.setJvmArguments("-Djava.io.tmpdir=" + getTmpDir()); }
task run << { ProjectConnection connection = GradleConnector.newConnector().forProjectDirectory(new File("someProjectFolder")).connect(); try { BuildLauncher build = connection.newBuild(); build.setJvmArguments("-javaagent:/home/audrius/org.springframework.instrument-3.0.5.RELEASE.jar") build.forTasks("jettyRun").run(); } finally { connection.close(); } }
try { BuildLauncher build = connection.newBuild(); //select tasks to run: build.forTasks("clean", "test"); //include some build arguments: build.withArguments("--no-search-upward", "-i", "--project-dir", "someProjectDir"); //configure the standard input: build.setStandardInput(new ByteArrayInputStream("consume this!".getBytes())); //in case you want the build to use java different than default: build.setJavaHome(new File("/path/to/java")); //if your build needs crazy amounts of memory: build.setJvmArguments("-Xmx2048m", "-XX:MaxPermSize=512m"); //if you want to listen to the progress events: ProgressListener listener = null; // use your implementation build.addProgressListener(listener); //kick the build off: build.run(); } finally { connection.close(); }
launcher.setJvmArguments(jvmArgs);