Conversation
The build no longer applies anything from palantir's Gradle tooling. What it used to get from there is now written out in two buildSrc convention plugins, or comes from the plain upstream plugins: - open-java-format.error-prone-conventions runs Error Prone 2.50.0 through net.ltgt.errorprone and net.ltgt.nullaway, with NullAway and Picnic's error-prone-support, in place of baseline-error-prone, baseline-null-away, suppressible-error-prone and gradle-guide, which applied suppressible-error-prone itself. The checks vfs-s3 makes build-breaking are listed there, commented out until the code is fixed. - open-java-format.java-conventions sets what gradle-baseline-java did: the Java 21 toolchain, tests on -PjavaRuntime, the JUnit wiring, the javac flags and Checkstyle. The IntelliJ Platform plugin defaults javac to --release, which javac refuses alongside the --add-exports of jdk.compiler; baseline hid that, and the IDEA plugin's build now unsets it. - Checkstyle's configuration moves from .baseline/checkstyle to Gradle's default config/checkstyle and runs on Checkstyle 14.3.0, without JavadocStyle, which Checkstyle 13.9.0 removed. custom-suppressions.xml still suppresses every check, as upstream. - The released dev.openjavaformat.java-format 2.98.0.5 formats the repository instead of com.palantir.java-format, which needed Spotless on the classpath once baseline no longer brought it. - The version comes from git describe, the same command gradle-git-version ran. failure-reports, idea-language-injector and jakarta-package-alignment go without replacement, and so do the configuration files of palantir's bots: bulldozer, changelog, excavator and revapi.
.baseline/ held what palantir's baseline-idea and baseline-eclipse plugins copied into IDE settings: copyright notices, Eclipse JDT preferences with their Checkstyle hookup, and the IntelliJ code style. Neither plugin is applied any more and nothing else reads these files; Checkstyle's configuration already lives in config/checkstyle.
The benchmarks build kept upstream's Spotless configuration commented out, to come back with baseline-format. baseline is gone and nothing in the build applies Spotless; dev.openjavaformat.java-format formats the repository. What the block said still matters, so a comment keeps it: the symlinked test input must not be formatted.
open-java-format-native put com.palantir.gradle.utils:platform on its buildscript classpath for two things: the <os>_<arch> part of the image name, and whether a collected binary is a Windows .exe. The new buildSrc plugin open-java-format.native-platform works out the first with the same names (macos, windows, linux-glibc or linux-musl from ldd --version; x86-64, aarch64, x86) and sets it as nativePlatform. The extension now comes from the .exe suffix the file name pattern already matched. The image here is still open-java-format-macos_aarch64, and six dummy binaries passed in with -PnativeImages get the classifiers and extensions already published on Maven Central.
The IDEA plugin declared com.palantir.gradle.utils:platform without using it: nothing in its sources, nor in the jdk-bootstrap and SPI modules it bundles, refers to the library. Dropping it takes four jars out of the plugin zip: platform, exec, providers and safe-exec-commandline.
The Gradle plugin used com.palantir.gradle.utils:platform, at run time in the builds it is applied to, to decide whether a native image exists for the machine and which classifier to resolve. NativePlatform now does that itself: os.name, os.arch and, on Linux, ldd --version to tell glibc from musl, read through Gradle's ProviderFactory as before, with the names open-java-format-native publishes its images under and buildSrc's open-java-format.native-platform gives the ones the build produces. The published platforms are listed exactly: the five classifiers on Maven Central. Before, any glibc Linux and any macOS counted, so a 32-bit x86 JVM went on to look for an image that does not exist. NativePlatformTest pins those classifiers and extensions, the spellings of os.arch, glibc against musl, ldd running only on Linux, and the refusal of platforms it cannot name. One test asks Gradle for the platform of the JVM running it, which on CI's Linux jobs runs the real ldd. The plugin no longer depends on platform, exec, providers and safe-exec-commandline.
The Gradle plugin applied palantir's gradle-idea-configuration for one thing: when IntelliJ syncs the project, list the open-java-format IDEA plugin in .idea/externalDependencies.xml, so that IntelliJ offers to install it. UpdateExternalDependenciesXmlFile does that now, the way the plugin already edits open-java-format.xml and workspace.xml, through XmlUtils and ConfigureJavaFormatterXml. As before it runs only when idea.active is set, keeps the other required plugins, and keeps a higher min-version for this one; versions compare numerically. Its task name differs from palantir's updateExternalDepsXml, so a build that applies that plugin as well gets both tasks rather than a clash. The plugin no longer creates the ideaConfiguration extension, and its dependencies lose gradle-idea-configuration. ConfigureJavaFormatterXmlTest covers the XML: a new file, other required plugins, and a min-version that is missing, lower, equal or higher. RequiredIdeaPluginTest runs a build without idea.active and one with it. It is a class of its own because PalantirJavaFormatIdeaPluginTest needs the native image and runs only in CI's native jobs; with -PnativeImage=true that one passes as well.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The build applied a dozen plugins from palantir's Gradle tooling, several of them there only for palantir's own CI and bots, and the Gradle and IDEA plugins we publish carried two palantir libraries. This replaces them with buildSrc conventions, the plain upstream plugins and a little code of our own, and drops the rest. Nothing from palantir is left in the build or in what we ship, apart from the package names.
Supersedes the Dependabot bumps #96 (gradle-baseline-error-prone) and #2 (gradle-guide): both plugins are gone.
What replaces what
open-java-format.error-prone-conventions: net.ltgt.errorprone 5.1.1 and net.ltgt.nullaway 3.2.0 running Error Prone 2.50.0, NullAway 0.14.2 and Picnic's error-prone-support 0.30.0open-java-format.java-conventions, in plain Gradle DSL.baseline/checkstyleconfig/checkstylegit describe, the command it ranopen-java-format.native-platformfor the image name, andNativePlatformin the Gradle plugin.idea/externalDependencies.xmlUpdateExternalDependenciesXmlFile, next to the tasks that already write.idea/open-java-format.xmlandworkspace.xml.baseline/IDE templates, the bot configsWorth a look
checkbut checks nothing yet:custom-suppressions.xmlsuppresses every check, as it did upstream, where the task had also been disabled since 2019. Without it there are 560 findings in 82 files.JavadocStyleis gone because Checkstyle 13.9.0 removed it.--release, which javac refuses next to the--add-exportsof jdk.compiler that every module gets. baseline hid that;open-java-format-idea-plugin/build.gradlenow unsets the convention.formatDiffreshaped the one statement this touches inPalantirJavaFormatSpotlessPluginTest.git describe --dirtyignores untracked files, which gradle-git-version'sgit status --porcelaincounted.ldd --versionto tell glibc from musl, only runs on CI's ubuntu jobs, in the native module's configuration and inNativePlatformTest.reads_the_platform_of_the_jvm_running_gradle..idea/externalDependencies.xmlis written only whenidea.activeis set, keeps the other required plugins and keeps a higher min-version for ours. The task isupdateExternalDependenciesXml, not palantir'supdateExternalDepsXml, so a build that applies palantir's plugin as well gets both tasks instead of a clash. TheideaConfigurationextension the Gradle plugin used to create is gone.Checked
./gradlew buildon JDK 21, after merging main.--release, encoding, javac arguments, test JVM arguments and system properties, archive settings. They are identical except javac's 2g heap, which never applied withfork=false.:gradle-open-java-format:test: 51 tests,NativePlatformTest's 20 andRequiredIdeaPluginTestamong them. With-PnativeImage=trueon GraalVM 25, all 60, including the native-onlyPalantirJavaFormatIdeaPluginTest, whose path through the IDEA plugin this touches.formatDiffthrough the released plugin and its native image on macOS aarch64.-PnativeImagesget the classifiers and extensions already on Maven Central.buildPlugin: the IDEA plugin zip has no palantir jars.