gradle
8.2

# withArguments

abstract fun withArguments(@Nullable arguments: Array<String>): LongRunningOperation

Specify the command line build arguments. Useful mostly for running tasks via BuildLauncher.

Be aware that not all of the Gradle command line options are supported! Only the build arguments that configure the build execution are supported. They are modelled in the Gradle API via org.gradle.StartParameter. Examples of supported build arguments: '--info', '-p'. The command line instructions that are actually separate commands (like '-?' and '-v') are not supported. Some other instructions like '--daemon' are also not supported - the tooling API always runs with the daemon.

If an unknown or unsupported command line option is specified, org.gradle.tooling.exceptions.UnsupportedBuildArgumentException will be thrown at the time the operation is executed via run or get.

For the list of all Gradle command line options please refer to the User Manual or take a look at the output of the 'gradle -?' command. Majority of arguments modeled by org.gradle.StartParameter are supported.

The arguments can potentially override some other settings you have configured. For example, the project directory or Gradle user home directory that are configured in the GradleConnector. Also, the task names configured by forTasks can be overridden if you happen to specify other tasks via the build arguments.

See the example in the docs for BuildLauncher If not configured, null, or an empty array is passed, then the reasonable default will be used.

Requires Gradle 1.0 or later.

#### Return

this

#### Parameters

arguments

Gradle command line arguments

abstract fun withArguments(@Nullable arguments: Iterable<String>): LongRunningOperation

Specify the command line build arguments. Useful mostly for running tasks via BuildLauncher.

If not configured, null, or an empty list is passed, then the reasonable default will be used.

Requires Gradle 1.0 or later.

#### Return

this

#### Parameters

arguments

Gradle command line arguments