-
Couldn't load subscription status.
- Fork 488
Description
It would be really convenient if our tests could use multiline string literals. Then we could remove some of this cuteness
spotless/testlib/src/main/java/com/diffplug/spotless/ResourceHarness.java
Lines 184 to 186 in aa78b56
| public File toLines(String... lines) { | |
| return toContent(String.join("\n", Arrays.asList(lines))); | |
| } |
spotless/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/ConfigurationCacheTest.java
Lines 50 to 61 in aa78b56
| 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!