Gradle: check the Java target in build.gradle
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- build-system, cli
Research direction
Start with the Java rows and the literal-pin extractors in checks/runtimes.py, then mirror the Gemfile-style pattern for build.gradle and build.gradle.kts. Add the new id project.java.gradle to explain.py, docs/checks.md and the CHANGELOG, and cover both DSLs plus a hostile file in unit tests. Done when a sourceCompatibility of 17 on Java 11 yields one fail, a Gradle file with no literal target yields no result, and pytest and ruff pass.
Written by the indexing model from the issue text.
Description
Problem: Gradle projects declare their Java target in build.gradle or build.gradle.kts, not in .java-version. DevReady currently has no way to warn when the installed JDK is older than the target the build requires.
Do:
- Add a literal pin extractor for
build.gradleandbuild.gradle.ktsinchecks/runtimes.py, next to the Java rows. - Recognize, in a line-based parse:
sourceCompatibility = JavaVersion.VERSION_17sourceCompatibility = 17/sourceCompatibility = "17"java { toolchain { languageVersion = JavaLanguageVersion.of(17) } }(Groovy) and.set(JavaLanguageVersion.of(17))/languageVersion.set(...)(Kotlin)targetCompatibilitywith the same shapes
- Never evaluate Groovy or Kotlin. First literal match wins; variables,
project.property(...), and computed values stayskip. - New id
project.java.gradle; title likeJava (Gradle); a mismatch is afail. - Add
explain.pyanddocs/checks.mdrows, a CHANGELOG line, and unit tests for both DSLs and a hostile file.
Done when:
- A
build.gradlewithsourceCompatibility = JavaVersion.VERSION_17on Java 11 reports onefail. build.gradle.ktswithlanguageVersion.set(JavaLanguageVersion.of(17))behaves the same.- A Gradle file with no literal Java target adds no result.
pytest,ruff checkandruff format --checkpass.
Notes:
- Follows the existing rule for Gradle/Gemfile-style files: literal declarations only, no execution.
- If both
pom.xmlandbuild.gradleexist, the Maven result wins (one Java target per project); say so in the docs.
- Dominant language
- Python
- Stars
- 2
- Forks
- 3
- Avg merge
- 10h 51m
- Merged PRs (30d)
- 40
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Evalogical-Inc/devReady
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Evalogical-Inc/devReady#71 ·
Maintainers usually reply within 1 day
-
enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Evalogical-Inc/devReady#66 ·
Maintainers usually reply within 1 day
-
enhancement good first issue
Difficulty 2/5 3-5 days Newbie friendliness 72/100
Evalogical-Inc/devReady#61 ·
Maintainers usually reply within 1 day
-
good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
Evalogical-Inc/devReady#72 ·
Maintainers usually reply within 1 day
-
Read the Java pin from .sdkmanrcPossibly taken @Utkarsh3725 claimed this today. Openenhancement good first issue help wanted
Difficulty 3/5 Half a day Newbie friendliness 74/100
Evalogical-Inc/devReady#70 ·
Maintainers usually reply within 1 day
All issues in Evalogical-Inc/devReady
Similar issues
-
Email validation accepts a trailing newlinePossibly taken @marcello-pichini claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
dbt-labs/spark-utils#51 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
bug frontend
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
vendrabuck/HERD#1419 ·
Maintainers usually reply within 1 day