Commit a7ff738
build(deps): bump Gradle wrapper to 9.4.1 and LWJGL to 3.4.1 (#383)
* build(deps): bump Gradle wrapper 8.14.3 -> 9.4.1 and LWJGL 3.3.6 -> 3.4.1
Gradle 9.x is required for local builds on JDK 25+ -- Gradle 8.14.3's
bundled Kotlin fails to parse recent JDK version strings
(IllegalArgumentException: 26). Gradle 9.4.1's Kotlin 2.x handles all
current JDKs.
LWJGL 3.4.1 is a minor bump with no binding-visible API breaks.
Verified: binding compile, native generateLibs, and :example:run (with
the existing ImPlot showcase) all green on JDK 26 + macOS arm64.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* build: make build.gradle Gradle 9 configuration-cache compatible
Paired with the Gradle 9.4.1 wrapper bump: make the root and
imgui-binding build scripts usable under Gradle 9's configuration
cache (the default for downstream consumers on Gradle 9+).
Three changes:
- build.gradle: replace Groovy 'git describe'.execute() with
providers.exec (cache-aware external process API). Same for
'git rev-parse HEAD' in the jar manifest block.
- imgui-binding/build.gradle: capture project.version.toString() into
a local at configuration time, and pass that through the
processResources filesMatching closure rather than letting the
closure resolve `version` against the live Project model at
execution time.
Without this, any downstream consumer running Gradle 9 with
configuration cache on (including `includeBuild` composite builds)
hits:
- Starting an external process 'git describe --tags --always' during
configuration time is unsupported.
- Invocation of 'version' references a Gradle script object from a
Groovy closure at execution time, which is unsupported with the
configuration cache.
Verified: `./gradlew :imgui-binding:compileJava --configuration-cache`
now stores a configuration cache entry cleanly on Gradle 9.4.1.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(buildSrc): make generateApi work under Gradle 9 / Kotlin 2 K2
Kotlin 2.x's K2 compiler emits a runtime CHECKCAST to java.lang.Void
at generic call sites where the type argument is specified as Nothing.
That checkcast was elided under K1, but K1 is gone in Kotlin 2.0.
The codegen used `<Nothing>` extensively on Spoon's builder-style
setters (setType, setSimpleName, setParent, addParameter, etc.) as a
"don't care" type argument, since Nothing is the bottom type and
therefore a subtype of every bound. Under K2 those calls throw
ClassCastException because Spoon returns concrete CtMethodImpl etc.,
not Void.
Replace each <Nothing> with the bound-appropriate type so no Void
checkcast is emitted:
setType -> CtTypedElement<Any>
setSimpleName -> CtNamedElement (or CtReference on type refs)
setParent -> CtElement
setDocComment -> CtElement
setAnnotations -> CtElement
addAnnotation -> CtElement
addModifier -> CtModifiable
setModifiers -> CtModifiable
addParameter -> CtMethod<Any>
addParameterAt -> CtMethod<Any>
setParameters -> CtMethod<Any>
setBody -> CtBodyHolder
addStatement -> CtStatementList
setTags -> CtJavaDoc
removeTag -> CtJavaDoc
setValue -> CtCodeSnippet
addValue -> CtAnnotation<Annotation>
setAssignment -> CtRHSReceiver<Any>
createMethod -> Any (unbounded)
createField -> Any
createParameter -> Any
createTypeReference -> Any (or Annotation for createAnnotation chain)
`method.clone()` sites cast to CtMethod<Any> with @Suppress because
CtMethod<*>.setParameters<T : CtExecutable<captured *>> has no T that
Kotlin can infer or accept.
* build: bump build toolchain to JDK 17, keep Java 8 bytecode target
Gradle 9's default checkstyle toolVersion (~10.21+) requires Java 11+
to run, but every module pinned a Java 8 toolchain, so Gradle routed
the Checkstyle task's launcher through JDK 8 and the Ant task class
(class file version 55) failed to load on the JDK 8 runtime.
Rather than pin an old checkstyle or splice a separate launcher just
for Checkstyle, bump the build toolchain to JDK 17 in every module
and set `options.release = 8` on the library modules. Net effect:
- compile/checkstyle/javadoc all run on the same modern JVM
- published jars still contain class file version 52 (Java 8) — the
library's consumer baseline is unchanged (verified on ImGui.class)
- CI only needs to install JDK 17 (dropped the dual 8+17 setup)
Also bump foojay-resolver-convention 0.10.0 -> 1.0.0. Gradle 9
removed JvmVendorSpec.IBM_SEMERU; the 0.10.0 plugin references it in
its <clinit>, so any local build that has to download a toolchain
(no matching JDK already installed) crashes with NoSuchFieldError
before reaching the task graph. CI didn't hit this because
setup-java pre-installs the JDKs.
Verified: ./gradlew buildAll green on JDK 25 / macOS arm64; javap on
the produced ImGui.class reports major version 52.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2fcd517 commit a7ff738
14 files changed
Lines changed: 323 additions & 275 deletions
File tree
- .github/workflows
- buildSrc/src/main/kotlin/tool/generator/api
- example
- gradle/wrapper
- imgui-app
- imgui-binding-natives
- imgui-binding
- imgui-lwjgl3
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
| 27 | + | |
30 | 28 | | |
31 | 29 | | |
32 | 30 | | |
| |||
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
76 | | - | |
77 | | - | |
78 | | - | |
| 74 | + | |
79 | 75 | | |
80 | 76 | | |
81 | 77 | | |
| |||
162 | 158 | | |
163 | 159 | | |
164 | 160 | | |
165 | | - | |
166 | | - | |
167 | | - | |
| 161 | + | |
168 | 162 | | |
169 | 163 | | |
170 | 164 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
9 | 21 | | |
10 | 22 | | |
11 | | - | |
| 23 | + | |
12 | 24 | | |
13 | 25 | | |
14 | 26 | | |
| |||
23 | 35 | | |
24 | 36 | | |
25 | 37 | | |
| 38 | + | |
26 | 39 | | |
27 | 40 | | |
28 | 41 | | |
29 | 42 | | |
30 | 43 | | |
31 | 44 | | |
32 | | - | |
| 45 | + | |
33 | 46 | | |
34 | 47 | | |
35 | 48 | | |
| |||
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
| 9 | + | |
8 | 10 | | |
9 | 11 | | |
10 | 12 | | |
| |||
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
138 | | - | |
| 140 | + | |
139 | 141 | | |
140 | 142 | | |
141 | 143 | | |
142 | | - | |
143 | | - | |
144 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
Lines changed: 11 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
4 | 9 | | |
5 | 10 | | |
6 | 11 | | |
| |||
19 | 24 | | |
20 | 25 | | |
21 | 26 | | |
22 | | - | |
| 27 | + | |
23 | 28 | | |
24 | | - | |
25 | | - | |
26 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
27 | 32 | | |
28 | 33 | | |
29 | 34 | | |
| |||
37 | 42 | | |
38 | 43 | | |
39 | 44 | | |
40 | | - | |
| 45 | + | |
41 | 46 | | |
42 | 47 | | |
43 | | - | |
| 48 | + | |
44 | 49 | | |
45 | 50 | | |
46 | 51 | | |
| |||
0 commit comments