apache / apache/gravitino

[Improvement] Gradle v9 support

Open
#8,571 0 comments 0 reactions 0 assignees View on GitHub
improvement
Dominant language
Java
Stars
3.2k
Forks
935
Avg merge
1d 16h
Merged PRs (30d)
298

Description

### What would you like to be improved?

This project could support `gradle` v9. Currently, there is an error.

```
Welcome to Gradle 9.0.0!

Here are the highlights of this release:
- Configuration Cache is the recommended execution mode
- Gradle requires JVM 17 or higher to run
- Build scripts use Kotlin 2.2 and Groovy 4.0
- Improved Kotlin DSL script compilation avoidance

For more details see https://docs.gradle.org/9.0.0/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)
Skipping filesystem-fuse module since enableFuse is set to false

> Configure project :
w: file:///private/tmp/gravitino-20250915-10862-fiy75q/gravitino-0.9.1/build.gradle.kts:165:51: 'var buildDir: File' is deprecated. Deprecated in Java.
w: file:///private/tmp/gravitino-20250915-10862-fiy75q/gravitino-0.9.1/build.gradle.kts:474:57: Unchecked cast of '@Nullable() Any?' to 'Function1'.
w: file:///private/tmp/gravitino-20250915-10862-fiy75q/gravitino-0.9.1/build.gradle.kts:487:56: Unchecked cast of '@Nullable() Any?' to 'List'.
e: file:///private/tmp/gravitino-20250915-10862-fiy75q/gravitino-0.9.1/build.gradle.kts:632:9: Unresolved reference 'fileMode'.
e: file:///private/tmp/gravitino-20250915-10862-fiy75q/gravitino-0.9.1/build.gradle.kts:683:9: Unresolved reference 'fileMode'.
e: file:///private/tmp/gravitino-20250915-10862-fiy75q/gravitino-0.9.1/build.gradle.kts:971:30: Unresolved reference 'exec'.
e: file:///private/tmp/gravitino-20250915-10862-fiy75q/gravitino-0.9.1/build.gradle.kts:972:7: Unresolved reference 'commandLine'.

FAILURE: Build failed with an exception.

* Where:
Build file '/private/tmp/gravitino-20250915-10862-fiy75q/gravitino-0.9.1/build.gradle.kts' line: 165

* What went wrong:
Script compilation errors:

Line 165: param.environment("IT_PROJECT_DIR", project.buildDir.path)
^ 'var buildDir: File' is deprecated. Deprecated in Java.

Line 474: val initTest = project.extra.get("initTestParam") as (Test) -> Unit
^ Unchecked cast of '@Nullable() Any?' to 'Function1'.

Line 487: val extraArgs = project.property("extraJvmArgs") as List
^ Unchecked cast of '@Nullable() Any?' to 'List'.

Line 632: fileMode = 0b111101101
^ Unresolved reference 'fileMode'.

Line 683: fileMode = 0b111101101
^ Unresolved reference 'fileMode'.

Line 971: val execResult = project.exec {
^ Unresolved reference 'exec'.

Line 972: commandLine("bash", "-c", command)
^ Unresolved reference 'commandLine'.

7 errors

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to generate a Build Scan (Powered by Develocity).
> Get more help at https://help.gradle.org./
```

Thanks,

### How should we improve?

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with build.gradle.kts, especially the reported lines 165, 632, 683, and 971-972, and reproduce the failure using Gradle 9. Review the Gradle 9 errors and the surrounding build configuration. Done means the project configures and builds successfully on Gradle 9 without these script compilation errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kotlin
Domain
build-system
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.