Commit c2ada7c
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>1 parent afa8835 commit c2ada7c
2 files changed
Lines changed: 20 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
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 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
54 | 58 | | |
55 | 59 | | |
56 | 60 | | |
57 | | - | |
| 61 | + | |
58 | 62 | | |
59 | 63 | | |
60 | 64 | | |
0 commit comments