GradleRunnerAlias Class

Summary

Provides a wrapper around Gradle functionality within a Cake build script.
Assembly
Cake.Gradle.dll
Namespace
Cake.Gradle
Base Types
  • Object
graph BT Type-->Base0["Object"] Type["GradleRunnerAlias"] class Type type-node

Syntax

public static class GradleRunnerAlias

Examples

Run 'gradle --version'.

Cake task:

Task("Gradle-Version")
    .Does(() =>
{
    Gradle.WithArguments("--version").Run();
});

Run 'gradle hello' in a specific folder.

Note: if you have a gradle wrapper setup in the specified path, this one will be used.

Cake task:

Task("Gradle-Hello")
    .Does(() =>
{
    Gradle.FromPath("./example").WithTask("hello").Run();
});

Run 'gradle hello' in a specific folder with default log level.

Note: if no log level is set, it is derived from the Cake verbosity (which is set to 'verbose' in build.ps1).

Cake task:

Task("Gradle-Hello-WithDefaultLogLevel")
    .Does(() =>
{
    Gradle.FromPath("./example").WithTask("hello").WithLogLevel(GradleLogLevel.Default).Run();
});

Run 'gradle --offline --build-file build.gradle hello' in a specific folder.

Cake task:

Task("Gradle-Hello-WithArguments")
    .Does(() =>
{
    Gradle.FromPath("./example").WithTask("hello").WithArguments("--offline --build-file build.gradle").Run();
});

Attributes

Type Description
CakeAliasCategoryAttribute

Methods

Name Value Summary
Gradle(ICakeContext) GradleRunner
Get a Gradle runner.
static

Extension Methods

Name Value Summary
ToDictionary() IDictionary<string, object>
Requires the Cake.DeployParams addin