Skip to content

Commit

Permalink
feat(gradle): use Java 21 with gradle >= 8.5 (#31449)
Browse files Browse the repository at this point in the history
  • Loading branch information
Churro authored Sep 17, 2024
1 parent b775d83 commit 4c56818
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/modules/manager/gradle-wrapper/util.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ describe('modules/manager/gradle-wrapper/util', () => {
${'7.0.1'} | ${'^16.0.0'}
${'7.3.0'} | ${'^17.0.0'}
${'8.0.1'} | ${'^17.0.0'}
${'8.5.0'} | ${'^21.0.0'}
${'9.0.1'} | ${'^21.0.0'}
`(
'$gradleVersion | $javaConstraint',
async ({ gradleVersion, javaConstraint }) => {
Expand Down
3 changes: 3 additions & 0 deletions lib/modules/manager/gradle-wrapper/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ export async function getJavaConstraint(
return `^${toolChainVersion}.0.0`;
}
}
if (major > 8 || (major === 8 && minor && minor >= 5)) {
return '^21.0.0';
}
if (major > 7 || (major === 7 && minor && minor >= 3)) {
return '^17.0.0';
}
Expand Down

0 comments on commit 4c56818

Please sign in to comment.