-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
java versions preview enhancements #2376
Conversation
j-baker
commented
Sep 9, 2022
- support setting preview on a project-by-project basis.
- Fixes Confusing attempted safety check with XX_PREVIEW #2340
- fails more elegantly if javaVersions is set on not-the-root.
+ support setting preview on a project-by-project basis. + Fixes #2340 + fails more elegantly if javaVersions is set on not-the-root.
Generate changelog in
|
@@ -61,6 +70,16 @@ public final void setLibraryTarget(int value) { | |||
libraryTarget.set(JavaLanguageVersion.of(value)); | |||
} | |||
|
|||
public final void setLibraryTarget(String value) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is the bit that solves #2340.
@@ -220,7 +250,7 @@ class BaselineJavaVersionIntegrationTest extends IntegrationSpec { | |||
when: | |||
buildFile << ''' | |||
javaVersions { | |||
libraryTarget = 11 | |||
libraryTarget = '11' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this just tests that the string format for setting versions works.
private static void throwIfNotRootProject(Project project) { | ||
if (!project.equals(project.getRootProject())) { | ||
throw new GradleException("The javaVersions extension can only be applied to the root project." | ||
+ " Did you mean javaVersion, which can be used to override on a project-by-project basis?"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with this I think we'd have probably saved some time!
throw throwCannotSetFromSubproject(); | ||
} | ||
|
||
private RuntimeException throwCannotSetFromSubproject() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FAILURE: Build failed with an exception.
* Where:
Build file '/Volumes/git/thermite/thermite-simulation/build.gradle' line: 2
* What went wrong:
A problem occurred evaluating project ':thermite-simulation'.
> The javaVersions extension can only be used from the root project. Did you mean javaVersion, which can be used to override on a project-by-project basis? You used it from thermite-simulation
Released 4.162.0 |
This change is causing gradle failures on excavator roll out, e.g. palantir/tritium#1566 with error https://app.circleci.com/pipelines/github/palantir/tritium/2471/workflows/d414b195-beff-486c-9316-e13a206f6981/jobs/18979/parallel-runs/0/steps/0-105
|
This reverts commit a163bfa.
See #2379 for fix |
###### _excavator_ is a bot for automating changes across repositories. Changes produced by the roomba/latest-baseline-oss check. # Release Notes ## 4.162.0 | Type | Description | Link | | ---- | ----------- | ---- | | Feature | java versions preview enhancements<br><br>+ support setting preview on a project-by-project basis.<br>+ Fixes #2340<br>+ fails more elegantly if javaVersions is set on not-the-root. | palantir/gradle-baseline#2376 | ## 4.163.0 | Type | Description | Link | | ---- | ----------- | ---- | | Fix | Fix interface visibility bug | palantir/gradle-baseline#2379 | To enable or disable this check, please contact the maintainers of Excavator.