Skip to content
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

Finalize java-versions extension values on read #2107

Merged
merged 2 commits into from
Mar 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions changelog/@unreleased/pr-2107.v2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
type: improvement
improvement:
description: Finalize java-versions extension values on read to prevent changes
due to interactions from other plugins
links:
- https://github.com/palantir/gradle-baseline/pull/2107
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ public BaselineJavaVersionExtension(Project project) {
target = project.getObjects().property(JavaLanguageVersion.class);
runtime = project.getObjects().property(JavaLanguageVersion.class);
overrideLibraryAutoDetection = project.getObjects().property(Boolean.class);
target.finalizeValueOnRead();
runtime.finalizeValueOnRead();
overrideLibraryAutoDetection.finalizeValueOnRead();
}

/** Target {@link JavaLanguageVersion} for compilation. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ public BaselineJavaVersionsExtension(Project project) {
distributionTarget.convention(libraryTarget);
// runtime defaults to the distribution value
runtime.convention(distributionTarget);
libraryTarget.finalizeValueOnRead();
distributionTarget.finalizeValueOnRead();
runtime.finalizeValueOnRead();
}

/** Target {@link JavaLanguageVersion} for compilation of libraries that are published. */
Expand Down