# Gradle (/pipeline-sdk/reference/toolchains/gradle)



{/* Generated by docs-site/scripts/generate-dsl-docs.ts — do not edit. */}

## `gradle` [#gradle]

Callable singleton for the Gradle toolchain — access as `hm.gradle`.

Call directly to construct a `GradleProject`, or use the bare-form
action methods (`gradle.build()`, `gradle.test()`, etc.) for a
one-shot leaf.

```python
gradle(*, path='.', jdk='21', kotlin=False, image=None, base=None) -> GradleProject
```

| Parameter                                               | Type           | Default | Description                                              |
| ------------------------------------------------------- | -------------- | ------- | -------------------------------------------------------- |
| `path`                                                  | `str`          | `'.'`   | Path to the project root (where `build.gradle` lives).   |
| `jdk`                                                   | `str`          | `'21'`  | JDK major version to install via apt. Must be one of     |
| `"11"`, `"17"`, or `"21"`.                              |                |         |                                                          |
| `kotlin`                                                | `bool`         | `False` | When `True`, sets the label prefix to `:kotlin:`         |
| instead of `:java:`. The Gradle commands are identical. |                |         |                                                          |
| `image`                                                 | `str \| None`  | `None`  | Local-mode Docker base image override.                   |
| `base`                                                  | `Step \| None` | `None`  | Existing `Step` to attach to instead of emitting a fresh |
| apt-base step.                                          |                |         |                                                          |

**Returns** `GradleProject` — A `GradleProject` ready for action methods.

### `gradle.build()` [#gradlebuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `gradle.lint()` [#gradlelint]

```python
lint(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `gradle.test()` [#gradletest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `GradleEntry` [#gradleentry]

Callable singleton for the Gradle toolchain — access as `hm.gradle`.

Call directly to construct a `GradleProject`, or use the bare-form
action methods (`gradle.build()`, `gradle.test()`, etc.) for a
one-shot leaf.

### `GradleEntry.build()` [#gradleentrybuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GradleEntry.lint()` [#gradleentrylint]

```python
lint(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GradleEntry.test()` [#gradleentrytest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

## `GradleProject` [#gradleproject]

Gradle (Java/Kotlin) project install chain — constructed via `hm.gradle()`.

`installed` is the JDK-verify step. Action methods (`build`,
`test`, `lint`) attach leaves to `installed`.

### Fields [#fields]

| Field       | Type   | Default    |
| ----------- | ------ | ---------- |
| `path`      | `str`  | *required* |
| `installed` | `Step` | *required* |

### `GradleProject.build()` [#gradleprojectbuild]

```python
build(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GradleProject.lint()` [#gradleprojectlint]

```python
lint(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`

### `GradleProject.test()` [#gradleprojecttest]

```python
test(**kw) -> Step
```

| Parameter | Type  | Default | Description |
| --------- | ----- | ------- | ----------- |
| `kw`      | `Any` | `{}`    | —           |

**Returns** `Step`
