mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-18 19:39:19 +00:00
build: compile directly for Java 8
Keep modern java out of that for now, it make build script too complicated as long as scala still here to force J8 path
This commit is contained in:
1 parent
d3f1b561a3
commit
12eb146d02
14 files changed
+376
-330
No files matched your search
@@ -205,14 +205,6 @@ These are accepted once for the migration, not repeated for every otherwise equi
|
||||
the retained getter and old Iguana reflection. Its name, type and visibility remain unchanged.
|
||||
- TickScheduler's private Scala scheduler types become package-private static nested Java classes, retaining their
|
||||
binary names.
|
||||
- The modern-syntax helpers that have nested or anonymous classes carry `xyz.wagyourtail.jvmdg.j11.NestHost` and
|
||||
`NestMembers` annotations on 23 packaged classes, recording nest relationships Java 8 class files cannot express.
|
||||
These annotation types are deliberately not shipped and JVM Downgrader is not a runtime dependency: the packaged
|
||||
classes contain no executable Downgrader API reference, and reflection skips an annotation whose type is absent
|
||||
instead of throwing, so `getAnnotations()` on these classes returns an empty array on a Java 8 runtime. Forge and
|
||||
FMP's own scanners read annotation tables through ASM without loading the types. Do not shade the Downgrader API
|
||||
jar to resolve them; that would place FMP classes in a namespace it does not own and duplicate types other
|
||||
installed mods already provide.
|
||||
|
||||
## Updating this ledger
|
||||
|
||||
|
||||
@@ -10,29 +10,16 @@ These constraints explain the retained build and runtime machinery. Consumer mig
|
||||
modern-runtime policy spans Java 17–26; validate packaged releases on the selected supported runtime. Equal
|
||||
throughput across Java versions is not required. The deobfuscated Forge test runner uses Java 8; the current
|
||||
modern dedicated-server run tasks are not a substitute for packaged validation.
|
||||
- Keep `enableModernJavaSyntax = false` while Scala 2.11.5 remains. The convention plugin's global JVM Downgrader
|
||||
mode forces a modern toolchain that Scala cannot run on. With gtnhgradle 2.0.29, forcing Java 8 also conflicts
|
||||
with the mode's multi-release version constraints. Revisit the supported global mode after Scala removal,
|
||||
including an explicit stubs-provider decision; `gtnhlib` adds a runtime dependency and shading is rejected in
|
||||
[DIVERGENCES.md](DIVERGENCES.md).
|
||||
- Normal Java and joint Scala/Java compilation use Java 8. `modernJavaPaths` in `build.gradle` is the single list
|
||||
that both excludes modern helpers from joint javac and includes them in `compileModernJava`. Scalac resolves
|
||||
their declarations through `-sourcepath`; JDK 25 compiles their bodies with `--release 21` after Scala compilation.
|
||||
Only `downgradeModernJava`'s Java 8 output joins main outputs, tests, Forge and packaged jars.
|
||||
- Keep declaration inputs and downgrade output directories declared to Gradle. A modern-source exclusion without
|
||||
a matching inclusion can silently omit a class. Helpers importing retained Scala models cannot simply move to
|
||||
`src/main/java`: `compileJava` runs before those Scala types exist. Retire per-file routing when the dependency
|
||||
cycle permits a source-set boundary, and remove the special routing after Scala removal.
|
||||
- Keep `enableModernJavaSyntax = false` while Scala 2.11.5 remains. Normal Java and joint Scala/Java compilation
|
||||
use Java 8. Helpers importing retained Scala models belong in the joint `src/main/scala` source set because
|
||||
`compileJava` runs before those Scala types exist.
|
||||
- `scalaCompileOptions.force = true` prevents stale `Tags.VERSION` constants in joint-compiled Java `@Mod`
|
||||
annotations. Zinc otherwise misses those consumers when the generated constant changes. Verify all five mod
|
||||
annotations in dev/release artifacts against their artifact version; replace the guard only with equivalent coverage.
|
||||
- Modernize bounded helpers only after checking declaration visibility, compile order, ABI and generated output.
|
||||
Java 21 is the validated source ceiling. Records/sealed types are not automatic replacements for ABI-sensitive
|
||||
models. New library APIs may need runtime stubs even when syntax downgrades successfully.
|
||||
- Keep registered trait inputs and compatibility facades conservative. Moving `RedstoneInteractions$` or
|
||||
`BlockMultipart` pulls transformer-sensitive dependencies; `RenderPartResolver` is needed by joint compilation
|
||||
before the modern stage. Bootstrap and mixin source sets are not downgraded by this task. The explicit
|
||||
`Microblock` cast in `PostMicroblockTraitLogic` is required by the retained Scala declaration.
|
||||
before Java helpers that use it. The explicit `Microblock` cast in `PostMicroblockTraitLogic` is required by the
|
||||
retained Scala declaration.
|
||||
- GTNHLib is compile-only here. Its fastutil compile classpath does not grant a runtime dependency. Declare that
|
||||
dependency explicitly before using fastutil in ordinary code; require profiling evidence for such a change.
|
||||
|
||||
@@ -106,7 +93,7 @@ mechanical ports. Coverage percentages and signature counts alone are insufficie
|
||||
|
||||
A Scala-to-Java replacement needs clean verification: Zinc can retain the removed Scala class and package it
|
||||
instead of exercising the new source. Stop the daemon if Windows holds build outputs open. Verify packaged
|
||||
class version 52, unexpected downgrader API references and mod-version freshness, including after the release commit.
|
||||
class version 52 and mod-version freshness, including after the release commit.
|
||||
|
||||
JUnit reports are under `build/test-results/test/` and `run/server/junit-out/`; inspect counts, failures, errors and
|
||||
skips. The Forge task rejects missing/failed reports. Keep that CI gate required. Generated dumps are under
|
||||
|
||||
Reference in new issue
Block a user