Skip to content

Add 'postAppImageStep' to modify the app image before packaging - #136

Open
koppor wants to merge 1 commit into
gradlex-org:mainfrom
koppor:post-app-image-hook
Open

Add 'postAppImageStep' to modify the app image before packaging#136
koppor wants to merge 1 commit into
gradlex-org:mainfrom
koppor:post-app-image-hook

Conversation

@koppor

@koppor koppor commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

🤖 Adds an optional postAppImageStep per target: an Action<Directory> that receives the app image after all resources have been copied into it and runs before the OS-specific packages are built from it, so modifications land in every package instead of only in the app-image artifact. It is rejected together with singleStepPackaging, where no intermediate app image exists, and is not a task input — documented in the README. My use case is training a JEP 514 AOT cache, but the hook is generic.

Closes #135

Steps to test: ./gradlew quickCheck — the two new tests in JavaModulePackagingOptionsTest cover a hook writing a marker file into the packaged image (under --configuration-cache) and the singleStepPackaging rejection.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JnKVoy56BKWZAkVtvSqNgg

Creating a JEP 514 AOT cache requires running the packaged launcher once and
storing the result inside the app image, which has to happen after jpackage
assembled the image but before the OS-specific packages are derived from it.
The new option runs an Action on the app image directory at exactly that point;
it is rejected together with 'singleStepPackaging', where no intermediate image
exists.

Closes gradlex-org#135

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JnKVoy56BKWZAkVtvSqNgg
@testlens-app

testlens-app Bot commented Sep 3, 2026

Copy link
Copy Markdown

✅ All tests passed ✅

🏷️ Commit: 2492445
▶️ Tests: 340 executed
⚪️ Checks: 3/3 completed


Learn more about TestLens at testlens.app/docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Provide a hook between app-image creation and installer packaging (e.g. for JEP 514 AOT cache training)

1 participant