Package org.gradle.workers
Interface WorkerConfiguration
-
- All Superinterfaces:
ActionConfiguration,Describable
public interface WorkerConfiguration extends Describable, ActionConfiguration
Represents the configuration of a worker. Used when submitting an item of work to theWorkerExecutor.workerExecutor.submit(RunnableWorkImpl.class) { WorkerConfiguration conf -> conf.isolationMode = IsolationMode.PROCESS forkOptions { JavaForkOptions options -> options.maxHeapSize = "512m" options.systemProperty 'some.prop', 'value' options.jvmArgs "-server" } classpath configurations.fooLibrary conf.params = [ "foo", file('bar') ] }- Since:
- 3.5
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclasspath(Iterable<File> files)Adds a set of files to the classpath associated with the worker.voidforkOptions(Action<? super JavaForkOptions> forkOptionsAction)Executes the provided action against theJavaForkOptionsobject associated with this builder.Iterable<File>getClasspath()Gets the classpath associated with the worker.StringgetDisplayName()Returns the display name of this object.ForkModegetForkMode()Gets the forking mode for this worker, seeForkMode.JavaForkOptionsgetForkOptions()Returns theJavaForkOptionsobject associated with this builder.IsolationModegetIsolationMode()Gets the isolation mode for this worker, seeIsolationMode.voidsetClasspath(Iterable<File> files)Sets the classpath associated with the worker.voidsetDisplayName(String displayName)Sets the name to use when displaying this item of work.voidsetForkMode(ForkMode forkMode)Sets the forking mode for this worker, seeForkMode.voidsetIsolationMode(IsolationMode isolationMode)Sets the isolation mode for this worker, seeIsolationMode.-
Methods inherited from interface org.gradle.api.ActionConfiguration
getParams, params, setParams
-
-
-
-
Method Detail
-
classpath
void classpath(Iterable<File> files)
Adds a set of files to the classpath associated with the worker.- Parameters:
files- - the files to add to the classpath
-
setClasspath
void setClasspath(Iterable<File> files)
Sets the classpath associated with the worker.- Parameters:
files- - the files to set the classpath to
-
getClasspath
Iterable<File> getClasspath()
Gets the classpath associated with the worker.- Returns:
- the classpath associated with the worker
-
getIsolationMode
IsolationMode getIsolationMode()
Gets the isolation mode for this worker, seeIsolationMode.- Returns:
- the isolation mode for this worker, see
IsolationMode, defaults toIsolationMode.AUTO - Since:
- 4.0
-
setIsolationMode
void setIsolationMode(IsolationMode isolationMode)
Sets the isolation mode for this worker, seeIsolationMode.- Parameters:
isolationMode- the forking mode for this worker, seeIsolationMode- Since:
- 4.0
-
getForkMode
ForkMode getForkMode()
Gets the forking mode for this worker, seeForkMode.- Returns:
- the forking mode for this worker, see
ForkMode, defaults toForkMode.AUTO
-
setForkMode
void setForkMode(ForkMode forkMode)
Sets the forking mode for this worker, seeForkMode.- Parameters:
forkMode- the forking mode for this worker, seeForkMode
-
forkOptions
void forkOptions(Action<? super JavaForkOptions> forkOptionsAction)
Executes the provided action against theJavaForkOptionsobject associated with this builder.- Parameters:
forkOptionsAction- - An action to configure theJavaForkOptionsfor this builder
-
getForkOptions
JavaForkOptions getForkOptions()
Returns theJavaForkOptionsobject associated with this builder.- Returns:
- the
JavaForkOptionsof this builder
-
setDisplayName
void setDisplayName(String displayName)
Sets the name to use when displaying this item of work.- Parameters:
displayName- the name of this item of work
-
getDisplayName
@Nullable String getDisplayName()
Returns the display name of this object. It is strongly encouraged to compute it lazily, and cache the value if it is expensive.- Specified by:
getDisplayNamein interfaceDescribable- Returns:
- the display name
-
-