Skip to content

Commit 98245b2

Browse files
committed
docs: reconcile CLAUDE.md toolchain rule with the three-override discipline
CLAUDE.md described the cross-compile override as 'both jvmToolchain and compilerOptions { jvmTarget }', omitting the java {} block that the build scripts and docs/architecture.md require. State all three overrides and point at the architecture-doc section. Also fix a missing paragraph break in that section so the two paragraphs render separately.
1 parent b6f5079 commit 98245b2

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

CLAUDE.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ Layered, from the bottom up:
8585

8686
- **Java 8 bytecode everywhere except** `sdk-transport-jdkhttp` (11) and `sdk-async-virtualthreads` (21).
8787
Avoid `InputStream.transferTo` (9+), `Thread.threadId()` (19+), records, sealed `permits` in Java-8
88-
modules. A module that genuinely needs a newer JDK must override **both** `jvmToolchain(N)` **and**
88+
modules. A module that genuinely needs a newer JDK must override **all three** of `jvmToolchain(N)`,
89+
the `java { sourceCompatibility / targetCompatibility = VERSION_N + toolchain }` block, and
8990
`compilerOptions { jvmTarget.set(JvmTarget.JVM_N) }` in its own build script — overriding only the
90-
toolchain produces Java-8-format bytecode referencing newer stdlib symbols (`NoSuchMethodError` on JDK 8).
91+
toolchain produces Java-8-format bytecode referencing newer stdlib symbols (`NoSuchMethodError` on JDK 8),
92+
and omitting the `java {}` block trips Gradle's `compileJava`/`compileKotlin` JVM-target validation. See
93+
`docs/architecture.md` (Cross-Compile Toolchain Discipline).
9194
- **MIT license header in every source file.** Each `.kt`, `.java`, and `.kts` file starts with the 6-line
9295
`Copyright (c) 2026 dexpace and Omar Aljarrah` / `SPDX-License-Identifier: MIT` block — copy it from any
9396
existing file when creating new ones. Nothing enforces this automatically; it is a review convention.

docs/architecture.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,7 @@ are mandatory. The `java {}` block governs `compileJava` and keeps Gradle's JVM-
538538
between `compileJava` and `compileKotlin` happy; a module that sets only the Kotlin toolchain and
539539
`jvmTarget` but omits the `java {}` block will trip that validation or compile its Java sources at
540540
the wrong level.
541+
541542
The root build registers a `plugins.withId("org.jetbrains.kotlin.jvm")` callback that sets
542543
`jvmTarget` to `JVM_1_8` for every Kotlin module by default. A module that bumps only the
543544
toolchain — say to JDK 21 — but leaves `jvmTarget` at the inherited `1.8` will compile *against*

0 commit comments

Comments
 (0)