gradle
8.4

# withEnvironment

abstract fun withEnvironment(@Nullable environmentVariables: Map<String, String>): GradleRunner(source)

Sets the environment variables for the build. `null` is permitted and will make the build use the system environment.

When environment is specified, running with isDebug is not allowed. Debug mode runs in-process and TestKit must fork a separate process to pass environment variables.

#### Return

this

#### Parameters

environmentVariables

the variables to use, `null` is allowed.