|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.JavaExec
public class JavaExec
Executes a Java application in a child process.
| Field Summary |
|---|
| Fields inherited from interface org.gradle.api.Task |
|---|
TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE |
| Constructor Summary | |
|---|---|
JavaExec()
|
|
| Method Summary | |
|---|---|
JavaExecSpec |
args(Iterable<?> args)
Adds args for the main class to be executed. |
JavaExec |
args(Object... args)
Adds args for the main class to be executed. |
JavaExec |
bootstrapClasspath(Object... classpath)
Adds the given values to the end of the bootstrap classpath for the process. |
JavaExec |
classpath(Object... paths)
Adds elements to the classpath for executing the main class. |
JavaExec |
copyTo(JavaForkOptions options)
Copies these options to the given options. |
JavaExec |
copyTo(ProcessForkOptions target)
Copies these options to the given target options. |
JavaExec |
environment(Map<String,?> environmentVariables)
Adds some environment variables to the environment for this process. |
JavaExec |
environment(String name,
Object value)
Adds an environment variable to the environment for this process. |
JavaExec |
executable(Object executable)
Sets the name of the executable to use. |
List<String> |
getAllJvmArgs()
Returns the full set of arguments to use to launch the JVM for the process. |
List<String> |
getArgs()
Returns the arguments passed to the main class to be executed. |
FileCollection |
getBootstrapClasspath()
Returns the bootstrap classpath to use for the process. |
FileCollection |
getClasspath()
Returns the classpath for executing the main class. |
List<String> |
getCommandLine()
Returns the full command line, including the executable plus its arguments. |
boolean |
getDebug()
Returns true if debugging is enabled for the process. |
boolean |
getEnableAssertions()
Returns true if assertions are enabled for the process. |
Map<String,Object> |
getEnvironment()
The environment variables to use for the process. |
OutputStream |
getErrorOutput()
Returns the output stream to consume standard error from the process executing the command. |
String |
getExecutable()
Returns the name of the executable to use. |
List<String> |
getJvmArgs()
Returns the extra arguments to use to launch the JVM for the process. |
String |
getMain()
Returns the fully qualified name of the Main class to be executed. |
String |
getMaxHeapSize()
Returns the maximum heap size for the process, if any. |
InputStream |
getStandardInput()
Returns the standard input stream for the process executing the command. |
OutputStream |
getStandardOutput()
Returns the output stream to consume standard output from the process executing the command. |
Map<String,Object> |
getSystemProperties()
Returns the system properties which will be used for the process. |
File |
getWorkingDir()
Returns the working directory for the process. |
boolean |
isIgnoreExitValue()
Tells whether a non-zero exit value is ignored, or an exception thrown. |
JavaExec |
jvmArgs(Iterable<?> arguments)
Adds some arguments to use to launch the JVM for the process. |
JavaExec |
jvmArgs(Object... arguments)
Adds some arguments to use to launch the JVM for the process. |
void |
setAllJvmArgs(Iterable<?> arguments)
Sets the full set of arguments to use to launch the JVM for the process. |
JavaExec |
setArgs(Iterable<?> applicationArgs)
Sets the args for the main class to be executed. |
void |
setBootstrapClasspath(FileCollection classpath)
Sets the bootstrap classpath to use for the process. |
JavaExec |
setClasspath(FileCollection classpath)
Sets the classpath for executing the main class. |
void |
setDebug(boolean enabled)
Enable or disable debugging for the process. |
void |
setEnableAssertions(boolean enabled)
Enable or disable assertions for the process. |
void |
setEnvironment(Map<String,?> environmentVariables)
Sets the environment variable to use for the process. |
JavaExec |
setErrorOutput(OutputStream outputStream)
Sets the output stream to consume standard error from the process executing the command. |
void |
setExecutable(Object executable)
Sets the name of the executable to use. |
JavaExecSpec |
setIgnoreExitValue(boolean ignoreExitValue)
Sets whether a non-zero exit value is ignored, or an exception thrown. |
void |
setJvmArgs(Iterable<?> arguments)
Sets the extra arguments to use to launch the JVM for the process. |
JavaExec |
setMain(String mainClassName)
Sets the fully qualified name of the main class to be executed. |
void |
setMaxHeapSize(String heapSize)
Sets the maximum heap size for the process. |
JavaExec |
setStandardInput(InputStream inputStream)
Sets the standard input stream for the process executing the command. |
JavaExec |
setStandardOutput(OutputStream outputStream)
Sets the output stream to consume standard output from the process executing the command. |
void |
setSystemProperties(Map<String,?> properties)
Sets the system properties to use for the process. |
void |
setWorkingDir(Object dir)
Sets the working directory for the process. |
JavaExec |
systemProperties(Map<String,?> properties)
Adds some system properties to use for the process. |
JavaExec |
systemProperty(String name,
Object value)
Adds a system property to use for the process. |
JavaExec |
workingDir(Object dir)
Sets the working directory for the process. |
| Methods inherited from class org.gradle.api.internal.ConventionTask |
|---|
conventionMapping, getConventionMapping, setConventionMapping |
| Methods inherited from class org.gradle.api.internal.AbstractTask |
|---|
addValidator, captureStandardOutput, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, disableStandardOutputCapture, doFirst, doFirst, doLast, doLast, execute, getActions, getAdditionalProperties, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getDynamicObjectHelper, getEnabled, getExecuter, getGroup, getInputs, getLogger, getLogging, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getStandardOutputCapture, getState, getTaskDependencies, getTemporaryDir, getValidators, hasProperty, injectIntoNewInstance, isEnabled, leftShift, onlyIf, onlyIf, property, setActions, setConvention, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setGroup, setName, setOnlyIf, setOnlyIf, setProject, setProperty, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JavaExec()
| Method Detail |
|---|
public List<String> getAllJvmArgs()
getAllJvmArgs in interface JavaForkOptionspublic void setAllJvmArgs(Iterable<?> arguments)
setAllJvmArgs in interface JavaForkOptionsarguments - The arguments. Must not be null.public List<String> getJvmArgs()
getJvmArgs in interface JavaForkOptionspublic void setJvmArgs(Iterable<?> arguments)
setJvmArgs in interface JavaForkOptionsarguments - The arguments. Must not be null.public JavaExec jvmArgs(Iterable<?> arguments)
jvmArgs in interface JavaForkOptionsarguments - The arguments. Must not be null.
public JavaExec jvmArgs(Object... arguments)
jvmArgs in interface JavaForkOptionsarguments - The arguments.
public Map<String,Object> getSystemProperties()
getSystemProperties in interface JavaForkOptionspublic void setSystemProperties(Map<String,?> properties)
setSystemProperties in interface JavaForkOptionsproperties - The system properties. Must not be null.public JavaExec systemProperties(Map<String,?> properties)
systemProperties in interface JavaForkOptionsproperties - The system properties. Must not be null.
public JavaExec systemProperty(String name,
Object value)
systemProperty in interface JavaForkOptionsname - The name of the propertyvalue - The value for the property. May be null.
public FileCollection getBootstrapClasspath()
getBootstrapClasspath in interface JavaForkOptionspublic void setBootstrapClasspath(FileCollection classpath)
setBootstrapClasspath in interface JavaForkOptionsclasspath - The classpath. Must not be null. Can be empty.public JavaExec bootstrapClasspath(Object... classpath)
bootstrapClasspath in interface JavaForkOptionsclasspath - The classpath.
public String getMaxHeapSize()
getMaxHeapSize in interface JavaForkOptionspublic void setMaxHeapSize(String heapSize)
setMaxHeapSize in interface JavaForkOptionsheapSize - The heap size. Use null for the default maximum heap size.public boolean getEnableAssertions()
getEnableAssertions in interface JavaForkOptionspublic void setEnableAssertions(boolean enabled)
setEnableAssertions in interface JavaForkOptionsenabled - true to enable assertions, false to disable.public boolean getDebug()
getDebug in interface JavaForkOptionspublic void setDebug(boolean enabled)
setDebug in interface JavaForkOptionsenabled - true to enable debugging, false to disable.public String getMain()
getMain in interface JavaExecSpecpublic JavaExec setMain(String mainClassName)
setMain in interface JavaExecSpecmainClassName - the fully qualified name of the main class to be executed.
public List<String> getArgs()
getArgs in interface JavaExecSpecpublic JavaExec setArgs(Iterable<?> applicationArgs)
setArgs in interface JavaExecSpecapplicationArgs - Args for the main class.
public JavaExec args(Object... args)
args in interface JavaExecSpecargs - Args for the main class.
public JavaExecSpec args(Iterable<?> args)
args in interface JavaExecSpecargs - Args for the main class.
public JavaExec setClasspath(FileCollection classpath)
setClasspath in interface JavaExecSpecclasspath - the classpath
public JavaExec classpath(Object... paths)
classpath in interface JavaExecSpecpaths - classpath elements
public FileCollection getClasspath()
getClasspath in interface JavaExecSpecpublic JavaExec copyTo(JavaForkOptions options)
copyTo in interface JavaForkOptionsoptions - The target options.
public String getExecutable()
getExecutable in interface ProcessForkOptionspublic void setExecutable(Object executable)
setExecutable in interface ProcessForkOptionsexecutable - The executable. Must not be null.public JavaExec executable(Object executable)
executable in interface ProcessForkOptionsexecutable - The executable. Must not be null.
public File getWorkingDir()
getWorkingDir in interface ProcessForkOptionspublic void setWorkingDir(Object dir)
Project.file(Object).
setWorkingDir in interface ProcessForkOptionsdir - The working directory. Must not be null.public JavaExec workingDir(Object dir)
Project.file(Object).
workingDir in interface ProcessForkOptionsdir - The working directory. Must not be null.
public Map<String,Object> getEnvironment()
getEnvironment in interface ProcessForkOptionspublic void setEnvironment(Map<String,?> environmentVariables)
setEnvironment in interface ProcessForkOptionsenvironmentVariables - The environment variables. Must not be null.
public JavaExec environment(String name,
Object value)
environment in interface ProcessForkOptionsname - The name of the variable.value - The value for the variable. Must not be null.
public JavaExec environment(Map<String,?> environmentVariables)
environment in interface ProcessForkOptionsenvironmentVariables - The environment variables. Must not be null.
public JavaExec copyTo(ProcessForkOptions target)
copyTo in interface ProcessForkOptionstarget - The target options
public JavaExec setStandardInput(InputStream inputStream)
setStandardInput in interface BaseExecSpecinputStream - The standard input stream for the process. Must not be null.
public InputStream getStandardInput()
getStandardInput in interface BaseExecSpecpublic JavaExec setStandardOutput(OutputStream outputStream)
setStandardOutput in interface BaseExecSpecoutputStream - The standard output stream for the process. Must not be null.
public OutputStream getStandardOutput()
System.out.
getStandardOutput in interface BaseExecSpecpublic JavaExec setErrorOutput(OutputStream outputStream)
setErrorOutput in interface BaseExecSpecoutputStream - The standard output error stream for the process. Must not be null.
public OutputStream getErrorOutput()
System.err.
getErrorOutput in interface BaseExecSpecpublic JavaExecSpec setIgnoreExitValue(boolean ignoreExitValue)
setIgnoreExitValue in interface BaseExecSpecignoreExitValue - whether a non-zero exit value is ignored, or an exception thrown
public boolean isIgnoreExitValue()
false.
isIgnoreExitValue in interface BaseExecSpecpublic List<String> getCommandLine()
getCommandLine in interface BaseExecSpec
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||