You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Move the Gradle plugin's sources out of src/main/groovy, so that Error Prone checks them #261
Seven classes of the Gradle plugin live in gradle-open-java-format/src/main/groovy: ConfigureJavaFormatterXml.groovy, the only Groovy source in the repository, and six Java files, PalantirJavaFormatPlugin, PalantirJavaFormatIdeaPlugin, UpdatePalantirJavaFormatIdeaXmlFile, UpdateWorkspaceXmlFile, UpdateExternalDependenciesXmlFile and XmlUtils. compileGroovy compiles all of them, and net.ltgt.errorprone and net.ltgt.nullaway configure only JavaCompile tasks: Error Prone and NullAway never see these six Java files.
compileJava runs before compileGroovy, so Java code that calls a Groovy class compiles only from the Groovy source directory, jointly with it. The tasks that call ConfigureJavaFormatterXml went there, then PalantirJavaFormatIdeaPlugin, which registers them, and PalantirJavaFormatPlugin, which applies it: Spotless plugin palantir/palantir-java-format#107 moved it there from src/main/java. XmlUtils did not have to be there; it was put next to its callers.
Convert ConfigureJavaFormatterXml to Java, still on groovy.util.Node. ConfigureJavaFormatterXmlTest covers its three entry points.
Move the seven files to src/main/java and drop apply plugin: 'groovy'.
Fix what Error Prone and NullAway report in them.
Upstream's palantir#1855 is step 1, still a draft; its description calls it the prerequisite for the move. Its .palantir/revapi.yml part does not apply here, as we do not run revapi.
The Groovy XML classes (XmlParser, XmlNodePrinter, groovy.util.Node) stay: replacing them changes the text of the developer's .idea files and is #262.
Activity