api / org.gradle.workers / WorkerConfiguration

WorkerConfiguration

@Incubating interface WorkerConfiguration : Describable, ActionConfiguration

Represents the configuration of a worker. Used when submitting an item of work to the WorkerExecutor.

 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

Functions

classpath

abstract fun classpath(files: MutableIterable<File>): Unit

Adds a set of files to the classpath associated with the worker.

forkOptions

abstract fun forkOptions(forkOptionsAction: Action<in JavaForkOptions>): Unit

Executes the provided action against the JavaForkOptions object associated with this builder.

getClasspath

abstract fun getClasspath(): MutableIterable<File>

Gets the classpath associated with the worker.

getDisplayName

abstract fun getDisplayName(): String

{@inheritDoc}

getForkMode

abstract fun getForkMode(): ForkMode

Gets the forking mode for this worker, see ForkMode.

getForkOptions

abstract fun getForkOptions(): JavaForkOptions

Returns the JavaForkOptions object associated with this builder.

getIsolationMode

abstract fun getIsolationMode(): IsolationMode

Gets the isolation mode for this worker, see IsolationMode.

setClasspath

abstract fun setClasspath(files: MutableIterable<File>): Unit

Sets the classpath associated with the worker.

setDisplayName

abstract fun setDisplayName(displayName: String): Unit

Sets the name to use when displaying this item of work.

setForkMode

abstract fun setForkMode(forkMode: ForkMode): Unit

Sets the forking mode for this worker, see ForkMode.

setIsolationMode

abstract fun setIsolationMode(isolationMode: IsolationMode): Unit

Sets the isolation mode for this worker, see IsolationMode.

Inherited Functions

getParams

abstract fun getParams(): Array<Any>

Gets the initialization parameters that will be used when constructing an instance of the implementation class.

params

abstract fun params(vararg params: Any): Unit

Adds initialization parameters to use when constructing an instance of the implementation class.

setParams

abstract fun setParams(vararg params: Any): Unit

Sets any initialization parameters to use when constructing an instance of the implementation class.