Skip to content

Desktop application acting as a Gradle Tooling API client

License

Notifications You must be signed in to change notification settings

gradle/gradle-client

Gradle Client

GitHub License GitHub Top Language GitHub Actions Workflow Status GitHub Issues

This is a desktop application acting as a Gradle Tooling API client to connect to Gradle builds.

IDEs typically use the Gradle Tooling API to provide support for Gradle builds. This application is used to showcase what IDEs could do with new Gradle tooling features.

Usage

You can download the latest version of Gradle Client for macos, Linux or Windows from the Releases assets.

Once installed on your system, simply launch the application.

Adding a build

The first screen shown by the Gradle Client allows you to add local Gradle builds to explore.

Click the Add build button and pick the folder of a local build. Note that the folder must contain a settings.gradle(.kts|.dcl) file to be accepted.

Each added build is displayed in a list. From that list you can remove a build by clicking on the cross ╳ button present on the right.

By clicking on a build in the list you navigate to the connection screen.

Connecting to a build

This screen allows you to define the parameters necessary to connect to a Gradle build:

Java Home - required

  • Defaults to the JAVA_HOME environment variable if present.
  • Click the folder 📁 button on the right and select a valid Java installation folder from your system to define a specific Java Home.

Gradle User Home - optional

  • Empty by default. When empty the default Gradle User Home will be used.
  • Click the folder 📁 button on the right and select a folder to be used as the Gradle User Home for this build.
  • Most of the time you can leave this empty.

Gradle Distribution - required

  • This parameter defines which Gradle version will be used to connect to the build.
  • It has three possible values: Wrapper, Specific Version or Local Installation.
    • Wrapper
      • This is the default.
      • The version of Gradle defined by the Gradle Wrapper present in the build will be used.
    • Specific Version
      • If you pick Specific Version, you will also need to specify which Gradle version to use.
      • The list of known released and nightly Gradle versions is available for you to pick from.
    • Local Installation
      • If you pick Local Installation, you will also need to specify the local path to a Gradle installation.
      • Click the folder 📁 button on the right and select a valid folder of a local Gradle installation.

Once you are done defining the connection parameters you can click the Connect button to continue.

Interacting with a build

Once connected you will see a list of available actions on the left. Clicking any of these will run the action. At the bottom of the screen you can expand a drawer to read the logs.

Build Environment

  • Informs about the build environment, like Gradle version or the Java home in use.
  • Fetches the BuildEnvironment Tooling API model.
  • This action doesn't require any configuration of the build.

Build Model

  • Informs about the Gradle build.
  • Fetches the BuildModel Tooling API model.
  • This action requires the completion of the initialization phase of the build.
  • No subprojects of the build are configured.

Projects Model

  • Informs about the projects of the Gradle build.
  • Fetches the ProjectModel Tooling API model.
  • This action requires the completion of the configuration phase of the build.
  • All subprojects of the build are configured.

Declarative Schema (Only for builds using Declarative Gradle)

  • Informs about the schema of the available Software Types.
  • Fetches the DeclarativeSchemaModel Tooling API model.
  • This action requires the completion of the initialization phase of the build.
  • No subprojects of the build are configured.

Declarative Documents (Only for builds using Declarative Gradle)

  • Informs about the declarative build definition and allows triggering mutations.
  • Fetches the DeclarativeSchemaModel Tooling API model.
  • This action requires the completion of the initialization phase of the build.
  • No subprojects of the build are configured.
  • Parsing, analysis and mutation of the .gradle.dcl files is done in the Gradle Client.

Navigating in the application

On each screen you can use the back ⬅ button to navigate to the previous screen.

You can quit the application by closing its window or by hitting Ctrl-Q / Cmd-Q.

Building Gradle Client

⚠️ These instructions are for software developers working on the Gradle Client. Usage instructions can be found above.

The build requires Java 17 with jlink and jpackage JDK tools. The build will fail to configure with the wrong Java version. Building release distributables will fail if the required JDK tools are not available.

# Run from sources
./gradlew :gradle-client:run

# Run from sources in continuous mode
./gradlew -t :gradle-client:run

# Run debug build type from build installation
./gradlew :gradle-client:runDistributable

# Run release build type from build installation
./gradlew :gradle-client:runReleaseDistributable

To add more actions start from GetModelAction.kt.

Packaging Gradle Client

Packaging native distributions is platform dependent.

The GitHub Actions based CI builds the native distributions. They are attached as artifacts to each workflow run. They are also automatically attached as release assets when building a tag.

Mac

# Package DMG on MacOS
./gradlew :gradle-client:packageReleaseDmg

DMG file is output in gradle-client/build/compose/binaries/main-release/dmg.

Linux

# Package DEB on Linux
./gradlew :gradle-client:packageReleaseDeb

DEB file is output in gradle-client/build/compose/binaries/main-release/deb.

Windows

# Package MSI on Windows
./gradlew :gradle-client:packageReleaseMsi

MSI file is output in gradle-client/build/compose/binaries/main-release/msi.