Commit bfa308d
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 8ab21ec commit bfa308d
File tree
4 files changed
+66
-1
lines changed- src/main/java/dev/jbang/source
- generators
- parser
4 files changed
+66
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
60 | 62 | | |
61 | 63 | | |
62 | 64 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
447 | 447 | | |
448 | 448 | | |
449 | 449 | | |
| 450 | + | |
| 451 | + | |
450 | 452 | | |
451 | 453 | | |
452 | 454 | | |
| |||
Lines changed: 61 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
101 | 114 | | |
102 | 115 | | |
103 | 116 | | |
104 | 117 | | |
105 | 118 | | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
106 | 128 | | |
107 | 129 | | |
108 | 130 | | |
| |||
330 | 352 | | |
331 | 353 | | |
332 | 354 | | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
333 | 394 | | |
| 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