Updated on 2026-01-08 GMT+08:00

Using Gradle for Build

In this action, you build a Java, Groovy, or Scala project with Gradle.

Graphical Build

Add Build with Gradle, when configuring build actions.

The parameters are described in the following table.

Parameter

Description

Action Name

Name of a build action. It can be customized.

Gradle

Select a Gradle version.

JDK

Select a JDK version.

Commands

Configure the Gradle commands. You can also use default commands. If you have special build requirements, enter your custom build script in the text box.

Code-based Build

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
version: 2.0 # The value must be 2.0.
steps:
  BUILD:
    - gradle:
        inputs:
            gradle: 4.8
            jdk: 1.8
            command: |
                # Gradle Wrapper provided by CodeArts is used for cache acceleration.
                cp /cache/android/wrapper/gradle-wrapper.jar ./gradle/wrapper/gradle-wrapper.jar
                # Build an unsigned APK.
                /bin/bash ./gradlew build --init-script  ./.codeci/.gradle/init_template.gradle -Dorg.gradle.daemon=false -Dorg.gradle.internal.http.connectionTimeout=800000

Parameter

Type

Description

Mandatory

Default Value

command

String

Commands to be run.

Yes

None

gradle

String

Gradle version.

Yes

None

jdk

String

JDK version.

Yes

None