api / org.gradle.api / Project / exec

exec

abstract fun exec(closure: Closure<Any>): ExecResult

Executes an external command. The closure configures a org.gradle.process.ExecSpec.

Parameters

closure - The closure for configuring the execution.

Return
the result of the execution

abstract fun exec(action: Action<in ExecSpec>): ExecResult

Executes an external command.

The given action configures a org.gradle.process.ExecSpec, which is used to launch the process. This method blocks until the process terminates, with its result being returned.

Parameters

action - The action for configuring the execution.

Return
the result of the execution