Package org.gradle.process
Interface ProcessForkOptions
-
- All Known Subinterfaces:
BaseExecSpec,ExecSpec,JavaExecSpec,JavaForkOptions
- All Known Implementing Classes:
AbstractExecTask,Exec,JavaExec,RunTestExecutable,Test
public interface ProcessForkOptionsSpecifies the options to use to fork a process.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description ProcessForkOptionscopyTo(ProcessForkOptions options)Copies these options to the given target options.ProcessForkOptionsenvironment(java.lang.String name, java.lang.Object value)Adds an environment variable to the environment for this process.ProcessForkOptionsenvironment(java.util.Map<java.lang.String,?> environmentVariables)Adds some environment variables to the environment for this process.ProcessForkOptionsexecutable(java.lang.Object executable)Sets the name of the executable to use.java.util.Map<java.lang.String,java.lang.Object>getEnvironment()The environment variables to use for the process.java.lang.StringgetExecutable()Returns the name of the executable to use.java.io.FilegetWorkingDir()Returns the working directory for the process.voidsetEnvironment(java.util.Map<java.lang.String,?> environmentVariables)Sets the environment variable to use for the process.voidsetExecutable(java.lang.Object executable)Sets the name of the executable to use.voidsetExecutable(java.lang.String executable)Sets the name of the executable to use.voidsetWorkingDir(java.io.File dir)Sets the working directory for the process.voidsetWorkingDir(java.lang.Object dir)Sets the working directory for the process.ProcessForkOptionsworkingDir(java.lang.Object dir)Sets the working directory for the process.
-
-
-
Method Detail
-
getExecutable
java.lang.String getExecutable()
Returns the name of the executable to use.- Returns:
- The executable.
-
setExecutable
void setExecutable(java.lang.String executable)
Sets the name of the executable to use.- Parameters:
executable- The executable. Must not be null.- Since:
- 4.0
-
setExecutable
void setExecutable(java.lang.Object executable)
Sets the name of the executable to use.- Parameters:
executable- The executable. Must not be null.
-
executable
ProcessForkOptions executable(java.lang.Object executable)
Sets the name of the executable to use.- Parameters:
executable- The executable. Must not be null.- Returns:
- this
-
getWorkingDir
java.io.File getWorkingDir()
Returns the working directory for the process. Defaults to the project directory.- Returns:
- The working directory. Never returns null.
-
setWorkingDir
void setWorkingDir(java.io.File dir)
Sets the working directory for the process.- Parameters:
dir- The working directory. Must not be null.- Since:
- 4.0
-
setWorkingDir
void setWorkingDir(java.lang.Object dir)
Sets the working directory for the process. The supplied argument is evaluated as perProject.file(Object).- Parameters:
dir- The working directory. Must not be null.
-
workingDir
ProcessForkOptions workingDir(java.lang.Object dir)
Sets the working directory for the process. The supplied argument is evaluated as perProject.file(Object).- Parameters:
dir- The working directory. Must not be null.- Returns:
- this
-
getEnvironment
java.util.Map<java.lang.String,java.lang.Object> getEnvironment()
The environment variables to use for the process. Defaults to the environment of this process.- Returns:
- The environment. Returns an empty map when there are no environment variables.
-
setEnvironment
void setEnvironment(java.util.Map<java.lang.String,?> environmentVariables)
Sets the environment variable to use for the process.- Parameters:
environmentVariables- The environment variables. Must not be null.
-
environment
ProcessForkOptions environment(java.util.Map<java.lang.String,?> environmentVariables)
Adds some environment variables to the environment for this process.- Parameters:
environmentVariables- The environment variables. Must not be null.- Returns:
- this
-
environment
ProcessForkOptions environment(java.lang.String name, java.lang.Object value)
Adds an environment variable to the environment for this process.- Parameters:
name- The name of the variable.value- The value for the variable. Must not be null.- Returns:
- this
-
copyTo
ProcessForkOptions copyTo(ProcessForkOptions options)
Copies these options to the given target options.- Parameters:
options- The target options- Returns:
- this
-
-