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

java versions preview enhancements #2376

Merged
merged 10 commits into from
Sep 12, 2022
Merged

Conversation

j-baker
Copy link
Contributor

@j-baker j-baker commented Sep 9, 2022

+ support setting preview on a project-by-project basis.
+ Fixes #2340
+ fails more elegantly if javaVersions is set on not-the-root.
@changelog-app
Copy link

changelog-app bot commented Sep 9, 2022

Generate changelog in changelog/@unreleased

Type

  • Feature
  • Improvement
  • Fix
  • Break
  • Deprecation
  • Manual task
  • Migration

Description

java versions preview enhancements

Check the box to generate changelog(s)

  • Generate changelog entry

@@ -61,6 +70,16 @@ public final void setLibraryTarget(int value) {
libraryTarget.set(JavaLanguageVersion.of(value));
}

public final void setLibraryTarget(String value) {
Copy link
Contributor Author

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'
Copy link
Contributor Author

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?");
Copy link
Contributor Author

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() {
Copy link
Contributor Author

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

@j-baker j-baker merged commit a163bfa into develop Sep 12, 2022
@j-baker j-baker deleted the jbaker/java_versions_ergonomics branch September 12, 2022 13:19
@svc-autorelease
Copy link
Collaborator

Released 4.162.0

@schlosna
Copy link
Contributor

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

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.
-----------
* Where:
Build file '/Volumes/git/palantir/tritium/build.gradle' line: 29

* What went wrong:
A problem occurred evaluating root project 'tritium'.
> failed to access class com.palantir.baseline.plugins.javaversions.BaselineJavaVersionsExtension$LazyJdks from class com.palantir.gradle.jdks.JdksPlugin (com.palantir.baseline.plugins.javaversions.BaselineJavaVersionsExtension$LazyJdks and com.palantir.gradle.jdks.JdksPlugin are in unnamed module of loader org.gradle.internal.classloader.VisitableURLClassLoader @57e989a9)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

2: Task failed with an exception.
-----------
* Where:
Build file '/Volumes/git/palantir/tritium/tritium-jmh/build.gradle' line: 17

* What went wrong:
A problem occurred evaluating project ':tritium-jmh'.
> Could not find method api() for arguments [io.dropwizard.metrics:metrics-core] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
==============================================================================

* Get more help at https://help.gradle.org

BUILD FAILED in 489ms
On branch roomba/latest-baseline-oss
Your branch is up to date with 'origin/roomba/latest-baseline-oss'.

@schlosna
Copy link
Contributor

See #2379 for fix

@schlosna schlosna mentioned this pull request Sep 12, 2022
bulldozer-bot bot pushed a commit to palantir/witchcraft-api that referenced this pull request Sep 12, 2022
###### _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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Confusing attempted safety check with XX_PREVIEW
5 participants