Commit 1ae4cec
feat: add support for Add-Reads and SplashScreen-Image manifest attributes
Extends manifest attribute support for jars beyond PR jbangdev#2439 to handle
Add-Reads module dependencies and SplashScreen-Image extraction.
Changes:
- Add Project.ATTR_ADD_READS and Project.ATTR_SPLASH_SCREEN_IMAGE constants
- Import Add-Reads and SplashScreen-Image attributes from jar manifests
- Process Add-Reads: converts to --add-reads JVM flags (Java 9+)
- Process SplashScreen-Image: extracts image and passes -splash flag
- Fix KeyValue.of() to support values containing '=' signs
Add-Reads implementation:
- Parses space-separated module dependencies (e.g., "mod1=mod2 mod3=mod4")
- Generates --add-reads flags for each dependency pair
- Version-gated for Java 9+ with runAsModule check
SplashScreen-Image implementation:
- Extracts splash image from jar to <jarPath>.splash.<ext> in cache
- Smart caching: only re-extracts if jar is newer than cached image
- Fails gracefully with warnings (never breaks the build)
- Adds -splash:<path> flag before other JVM options
KeyValue parser fix:
- Changed split("=") to split("=", 2) to handle values with '='
- Enables manifest directives like //MANIFEST Add-Reads=mod1=mod2
This builds on PR jbangdev#2439's copyManifestAttribute() and
addAllUnnamedManifestOptions() patterns.
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>1 parent fb47430 commit 1ae4cec
File tree
4 files changed
+79
-21
lines changed- src/main/java/dev/jbang/source
- generators
- parser
4 files changed
+79
-21
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
57 | 62 | | |
58 | 63 | | |
59 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
448 | | - | |
449 | | - | |
450 | | - | |
451 | | - | |
452 | | - | |
453 | | - | |
454 | | - | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
455 | 452 | | |
456 | 453 | | |
457 | 454 | | |
| |||
Lines changed: 68 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
85 | 86 | | |
86 | 87 | | |
87 | 88 | | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
88 | 93 | | |
89 | 94 | | |
90 | 95 | | |
| |||
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
100 | | - | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
105 | 113 | | |
106 | 114 | | |
| 115 | + | |
107 | 116 | | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
113 | 130 | | |
114 | 131 | | |
115 | 132 | | |
| |||
197 | 214 | | |
198 | 215 | | |
199 | 216 | | |
200 | | - | |
| 217 | + | |
201 | 218 | | |
202 | 219 | | |
203 | 220 | | |
| |||
230 | 247 | | |
231 | 248 | | |
232 | 249 | | |
233 | | - | |
| 250 | + | |
234 | 251 | | |
235 | 252 | | |
236 | 253 | | |
| |||
316 | 333 | | |
317 | 334 | | |
318 | 335 | | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
319 | 375 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
0 commit comments