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

Compile tests using Java 17 #1533

Open
nedtwigg opened this issue Jan 26, 2023 · 1 comment
Open

Compile tests using Java 17 #1533

nedtwigg opened this issue Jan 26, 2023 · 1 comment

Comments

@nedtwigg
Copy link
Member

It would be really convenient if our tests could use multiline string literals. Then we could remove some of this cuteness

public File toLines(String... lines) {
return toContent(String.join("\n", Arrays.asList(lines)));
}

setFile("build.gradle").toLines(
"plugins {",
" id 'com.diffplug.spotless'",
"}",
"repositories { mavenCentral() }",
"apply plugin: 'java'",
"spotless {",
" java {",
" googleJavaFormat('1.2')",
" }",
"}",
"tasks.named('spotlessJavaApply').get()");

Right now we test on two platforms - jdk11 and jdk17. But once #1304 gets figured out, we could run our build on Java 17, up the source level to 17 for tests, and use Gradle toolchain to run tests against jre 11 + 17.

That might be too complicated, and java 11 LTS reaches end of life in 2026 which will be here before we know it anyway. But if you made a PR that

  • preserved the existing test matrix
  • but always used java 17 as the build jre
  • compiled bytecode to java 11 for the jars
  • compiled bytecode to java 17 for the tests

That would be welcome and quickly merged!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants