Gradle plugin io.heapy.kinetica, released as 0.4.0 - #15
Merged
Conversation
Kinetica is compiler-plugin-only, so a Gradle consumer had to resolve the plugin jar through its own configuration and push -Xplugin into every KotlinCompilationTask by hand. The new kinetica-gradle-plugin module does that wiring, adds the version-matched runtime dependencies, and keeps sourcePipeline=psi on JVM compilations only — the one rule the manual wiring cannot express. Its marker publication is written by scripts/gradle-plugin-marker.sh, which the release script calls before staging. Two publication defects had to be fixed before any of that could work: - the toolchain publishes every dependency as runtime-scoped, so consumers had nothing on the compile classpath and failed on SerializerFactory, a supertype of Role.Companion. Coroutines and serialization-json are exported now (both leak into the public API, EffectScope extends CoroutineScope), as is kinetica-runtime from kinetica-markdown. - kinetica-compiler was Java 21 bytecode, and it is loaded into the consumer's Kotlin compile daemon: a JDK 17 daemon died with UnsupportedClassVersionError before compiling a line. It targets 17 now, like the Gradle plugin itself. Verified by scripts/verify-gradle-plugin.mjs — two fixtures, multiplatform and single-target JVM, whose build scripts carry no Kinetica wiring at all; an authoring-rule violation rejected by the FIR checkers on both the JVM and the JS compilation; a configuration-cache entry stored and reused. It runs in the macOS CI job, the only one that can publish the macosArm64 targets those fixtures resolve. examples/gradle-ssr stays on 0.3.0 with its manual wiring until 0.4.0 is on Central. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
…th it release.sh drops every local artifact of the version being released so a stale one cannot end up in the bundle — and that includes kinetica-compiler, which every other module compiles with. The toolchain resolves it as an ordinary external dependency and has no ordering edge to the module that produces it, so the first 0.4.0 attempt died on `Unable to resolve dependency io.heapy.kinetica:kinetica-compiler:0.4.0`. Earlier releases only worked because the version already happened to be in ~/.m2. Publish it on its own first, exactly like every build in this repository starts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
0.4.0 is on Maven Central, so the example drops the wiring it existed to demonstrate: the resolvable kineticaCompiler configuration, the -Xplugin argument pushed into every KotlinCompilationTask, and the explicit kinetica-runtime / kinetica-browser dependencies. All of it is now `alias(libs.plugins.kinetica)`. kotlinx-serialization-json stays declared, with a different reason: this example's own code builds island props and JSON-LD with it. Consumers who only use Kinetica no longer need it — 0.4.0 exports serialization and coroutines to the compile classpath. Verified against Central with a clean, cache-free build: jvmTest (the SEO contract tests) and jsBrowserDistribution both green with no Kinetica artifact declared anywhere in the build. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Kinetica is compiler-plugin-only, so a Gradle consumer had to resolve the plugin jar through its own configuration and push
-Xplugininto everyKotlinCompilationTaskby hand. This adds thekinetica-gradle-pluginmodule, which does that wiring, adds the version-matched runtime dependencies, and keepssourcePipeline=psion JVM compilations only — the one rule the manual wiring cannot express. Built as a toolchainjvm/libagainstdev.gradleplugins:gradle-apiandkotlin-gradle-plugin-api, both compile-only; the pom-only plugin marker is written byscripts/gradle-plugin-marker.sh, whichrelease.shcalls before staging.Two publication defects had to be fixed first, both of which blocked any Gradle consumption:
SerializerFactory, a supertype ofRole.Companion. Coroutines and serialization-json areexportednow — both leak into the public API (EffectScope : CoroutineScope) — as iskinetica-runtimefromkinetica-markdown, the one battery that was not exporting it.kinetica-compilerwas Java 21 bytecode, and it is loaded into the consumer's Kotlin compile daemon. A JDK 17 daemon — Android, Spring, anything onjvmToolchain(17)— died withUnsupportedClassVersionErrorbefore compiling a line. It targets 17 now, like the Gradle plugin itself.release.shalso grew a fix found by the release itself: it drops every local artifact of the version being released, including the compiler plugin every other module compiles with, and the toolchain has no ordering edge to the module that produces it. It publishes the compiler on its own first now.Verification
node scripts/verify-gradle-plugin.mjs— 10 assertions over two fixtures (multiplatform and single-target JVM) whose build scripts carry no Kinetica wiring at all: both build and test,sourcePipeline=psiis withheld from the JS compilation, an authoring-rule violation is rejected by the FIR checkers on both the JVM and the JS compilation, and a configuration-cache entry is stored and reused. Plus./kotlin test -m kinetica-gradle-plugin(6 contract tests guarding the baked-in coordinates againstpublish.module-template.yaml,common.module-template.yamlandKineticaCompilerContract).0.4.0 is on Maven Central.
examples/gradle-ssrnow consumes it asalias(libs.plugins.kinetica)— cleanjvmTest+jsBrowserDistributionwith--no-build-cache --rerun-tasks, no Kinetica artifact declared anywhere in that build.Worth a look in review
kinetica-runtime& co, whose macosArm64 targets a Linux runner cannot build. That job's timeout went 30 → 40 min. This PR is the first CI run of any of it.kinetica-runtimeand friends stay at Java 21 bytecode. That is the app's runtime floor and a library policy call, unchanged here; only the compiler plugin moved to 17.getPluginArtifactForNative(), so Native takes the same artifact path, but nothing exercised it. Recorded as the open item in KNT-0048.🤖 Generated with Claude Code