Fix pjf crashing when we force realization of the spotlessJava task#1319
Fix pjf crashing when we force realization of the spotlessJava task#1319kelvinou01 wants to merge 1 commit into
Conversation
Generate changelog in
|
| import java.util.stream.Stream | ||
|
|
||
| /** | ||
| * IntegrationTestKitSpec currently [loads more than what it needs into the classpath](https://github.com/nebula-plugins/nebula-test/blob/c5d3af9004898276bde5c68da492c6b0b4c5facc/src/main/groovy/nebula/test/IntegrationTestKitBase.groovy#L136) |
There was a problem hiding this comment.
This is not valid javadoc (yet - it is in java 23). Can you use the proper links and what not. Not doing a proper review, was just curious what was going on
| GradlewExecutionResult result = new GradlewExecutionResult(process.exitValue(), output) | ||
| return result |
| ProcessBuilder processBuilder = new ProcessBuilder() | ||
| .command(arguments) | ||
| .directory(projectDir) | ||
| .redirectErrorStream(true) | ||
| return processBuilder |
| * This classpath only contains the dependencies required by the plugin, as well as the plugin itself. | ||
| * This means no more eager loading of Formatters onto the classpath, no more complaints from PalantirJavaFormatStep | ||
| */ | ||
| class GradlewExecutor { |
There was a problem hiding this comment.
Ensure this is used by the existing spotless test
| } | ||
|
|
||
| private static Iterable<File> getBuildPluginClasspathInjector() { | ||
| return getPluginClasspathInjector(Path.of("../gradle-palantir-java-format/build/pluginUnderTestMetadata/plugin-under-test-metadata.properties")) |
There was a problem hiding this comment.
Try and get this from a system property, so you're inherently relying the on the structure of your build. Then in your gradle file, ensure that the task that will run this test, has it as a system property.
If you were to make the change to nebula, I imagine this is what you'd want to do. i.e. if the system property is there, then use that, if not then fallback to whatever mechanism they currently have.
Before this PR
After this PR
==COMMIT_MSG==
==COMMIT_MSG==
Possible downsides?