Provides a class that can be populated with various fork options for Java and which can then be used to copy to other methods in the Gradle API that provides a JavaForkOptions in the parameters.
Type | Name and description |
---|---|
FileCollection |
bootstrapClasspath |
String |
defaultCharacterEncoding |
java.util.Map<String, Object> |
environment |
String |
executable |
java.util.List<String> |
jvmArgs |
String |
maxHeapSize |
String |
minHeapSize |
java.util.Map<String, Object> |
systemProperties |
Object |
workingDir |
Type Params | Return Type | Name and description |
---|---|---|
|
JavaForkOptions |
bootstrapClasspath(Object... classpath) Adds the given values to the end of the bootstrap classpath for the process. |
|
JavaForkOptions |
copyTo(JavaForkOptions options) Copies these options to the given options. |
|
ProcessForkOptions |
copyTo(ProcessForkOptions options) Copies these options to the given target options. |
|
void |
environment(java.util.Map<String, ?> environmentVariables) Adds some environment variables to the environment for this process. |
|
void |
environment(String name, Object value) Adds an environment variable to the environment for this process. |
|
void |
executable(Object executable) Sets the name of the exe to use. |
|
FileCollection |
getBootstrapClasspath() Returns the bootstrap classpath to use for the process. |
|
boolean |
getDebug() Returns true if debugging is enabled for the process. |
|
String |
getDefaultCharacterEncoding() Returns the default character encoding to use. |
|
boolean |
getEnableAssertions() Returns true if assertions are enabled for the process. |
|
java.util.Map<String, Object> |
getEnvironment() The environment variables to use for the process. |
|
String |
getExecutable() Returns the name of the exe to use. |
|
java.util.List<String> |
getJvmArgs() Returns the extra arguments to use to launch the JVM for the process. |
|
String |
getMaxHeapSize() Returns the maximum heap size for the process, if any. |
|
String |
getMinHeapSize() Returns the minimum heap size for the process, if any. |
|
java.util.Map<String, Object> |
getSystemProperties() Returns the system properties which will be used for the process. |
|
Object |
getWorkingDir() Returns the working directory for the process. |
|
JavaForkOptions |
jvmArgs(Iterable<?> arguments) Adds some arguments to use to launch the JVM for the process. |
|
JavaForkOptions |
jvmArgs(Object... arguments) Adds some arguments to use to launch the JVM for the process. |
|
void |
setBootstrapClasspath(FileCollection classpath) Sets the bootstrap classpath to use for the process. |
|
void |
setDebug(boolean enabled) Enable or disable debugging for the process. |
|
void |
setDefaultCharacterEncoding(String defaultCharacterEncoding) Sets the default character encoding to use. |
|
void |
setEnableAssertions(boolean enabled) Enable or disable assertions for the process. |
|
void |
setEnvironment(java.util.Map<String, ?> environmentVariables) Sets the environment variable to use for the process. |
|
void |
setExecutable(Object executable) Sets the name of the exe to use. |
|
void |
setJvmArgs(Iterable<?> arguments) Sets the extra arguments to use to launch the JVM for the process. |
|
void |
setMaxHeapSize(String heapSize) Sets the maximum heap size for the process. |
|
void |
setMinHeapSize(String heapSize) Sets the minimum heap size for the process. |
|
void |
setSystemProperties(java.util.Map<String, ?> props) Sets the system properties to use for the process. |
|
void |
setWorkingDir(Object dir) Sets the working directory for the process. |
|
JavaForkOptions |
systemProperties(java.util.Map<String, ?> props) Adds some system properties to use for the process. |
|
JavaForkOptions |
systemProperty(String name, Object value) Adds a system property to use for the process. |
|
void |
workingDir(Object dir) Sets the working directory for the process. |
Adds the given values to the end of the bootstrap classpath for the process.
classpath
- The classpath.Copies these options to the given options.
options
- The target options.Copies these options to the given target options.
options
- The target optionsAdds some environment variables to the environment for this process.
environmentVariables
- The environment variables. Must not be null.Adds an environment variable to the environment for this process.
name
- The name of the variable.value
- The value for the variable. Must not be null.Sets the name of the exe to use.
executable
- The exe. Must not be null.Returns the bootstrap classpath to use for the process. The default bootstrap classpath for the JVM is used when this classpath is empty.
Returns true if debugging is enabled for the process. When enabled, the process is started suspended and listening on port 5005.
Returns the default character encoding to use.
Returns true if assertions are enabled for the process.
The environment variables to use for the process. Defaults to the environment of this process.
Returns the name of the exe to use.
Returns the extra arguments to use to launch the JVM for the process. Does not include system properties and the minimum/maximum heap size.
Returns the maximum heap size for the process, if any.
Returns the minimum heap size for the process, if any.
Returns the system properties which will be used for the process.
Returns the working directory for the process. Defaults to the project directory.
Adds some arguments to use to launch the JVM for the process.
arguments
- The arguments. Must not be null.Adds some arguments to use to launch the JVM for the process.
arguments
- The arguments.Sets the bootstrap classpath to use for the process. Set to an empty classpath to use the default bootstrap classpath for the specified JVM.
classpath
- The classpath. Must not be null. Can be empty.Enable or disable debugging for the process. When enabled, the process is started suspended and listening on port 5005.
enabled
- true to enable debugging, false to disable. Sets the default character encoding to use.
Note: Many JVM implementations support the setting of this attribute via system property on startup
(namely, the file.encoding
property). For JVMs where this is the case, setting the file.encoding
property via setSystemProperties(java.util.Map) or similar will have no effect as this value will be
overridden by the value specified by getDefaultCharacterEncoding().
defaultCharacterEncoding
- The default character encoding. Use null
java.nio.charset.Charset#defaultCharset() to use this JVM's default charset.Enable or disable assertions for the process.
enabled
- true to enable assertions, false to disable.Sets the environment variable to use for the process.
environmentVariables
- The environment variables. Must not be null.Sets the name of the exe to use.
executable
- The exe. Must not be null.Sets the extra arguments to use to launch the JVM for the process. System properties and minimum/maximum heap size are updated.
arguments
- The arguments. Must not be null.Sets the maximum heap size for the process.
heapSize
- The heap size. Use null for the default maximum heap size.Sets the minimum heap size for the process.
heapSize
- The minimum heap size. Use null for the default minimum heap size.Sets the system properties to use for the process.
props
- The system properties. Must not be null.Sets the working directory for the process. The supplied argument is evaluated as per # file ( Object ).
dir
- The working directory. Must not be null.Adds some system properties to use for the process.
props
- The system properties. Must not be null.Adds a system property to use for the process.
name
- The name of the propertyvalue
- The value for the property. May be null.Sets the working directory for the process. The supplied argument is evaluated as per # file ( Object ).
dir
- The working directory. Must not be null.