Repository navigation
fix(java): read the Kotlin Gradle jvmToolchain shorthand - #684
Open
noahkhomer18 wants to merge 1 commit into
Open
noahkhomer18 wants to merge 1 commit into
noahkhomer18 wants to merge 1 commit into
Conversation
Kotlin projects normally declare their JDK with the Kotlin Gradle plugin
shorthand rather than sourceCompatibility:
kotlin { jvmToolchain(17) }
That form was not recognised, so those projects reported no Java version at
all. The scanner now also matches jvmToolchain(<digits>) and uses it like the
other toolchain declarations. The longer jvmToolchain { languageVersion.set(
JavaLanguageVersion.of(17)) } form already resolved through the existing
JavaLanguageVersion pattern and is unchanged.
Fixes vibgrate#657
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #657.
Kotlin projects normally declare their JDK with the Kotlin Gradle plugin shorthand rather than
sourceCompatibility:kotlin { jvmToolchain(17) }That form was not recognised, so those projects reported no Java version at all — no runtime, no
runtimeLatest, noruntimeMajorsBehind.The scanner now also matches
jvmToolchain(<digits>). The longerkotlin { jvmToolchain { languageVersion.set(JavaLanguageVersion.of(17)) } }form already resolved through the existingJavaLanguageVersionpattern and is unchanged, as are thesourceCompatibility/targetCompatibilityforms.Tests:
test/gradle-kotlin-jvmtoolchain.test.tscovers the Kotlin DSL and Groovy short forms, spaces inside the call, and precedence when the file also carriessourceCompatibility.Proof the tests bite: with the scanner change stashed, 6 of the new tests fail — so they are pinning the new behaviour, not describing it. With the fix, the new file plus
gradle-version-catalogandsbom-gradle-scopeare 16/16 green.(
cargo-workspace-inheritancestill fails on Windows on path separators — pre-existing, untouched.)