feat(cli): package ccas binary via sbt-native-packager (#41)#68
Merged
Conversation
Add sbt-native-packager (JavaAppPackaging) and a single `ccas.cli.Main` entry point. `sbt stage` emits two launchers under target/universal/stage/bin: `ccas` (CLI primary) and `ccas-server` (forwarder to ccas.server.CcasServer) for hosted deploys. discoveredMainClasses is pinned to those two so the other ZIOAppDefault apps don't leak launcher scripts. Main dispatches on the first arg: `serve` boots CcasServer; anything else prints a placeholder and exits non-zero (subcommand tree lands in #46). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #41. First sub-issue of the CLI v0 epic (#40).
What
sbt-native-packager(JavaAppPackaging).sbt stageemits two launchers undertarget/universal/stage/bin/:ccas— CLI primary (Compile / mainClass = ccas.cli.Main).ccas-server— forwarder toccas.server.CcasServer, the standalone server entry for hosted deploys (Host CcasServer on Render (deferred until post-CLI-v0 + #51) #60).Compile / discoveredMainClassespinned to those two classes so the otherZIOAppDefaultapps don't leak launcher scripts.ccas.cli.Main: dispatches the first arg —serve→CcasServer.run; anything else prints a placeholder to stderr and exits non-zero (thedeclinesubcommand tree lands in CLI subcommand tree via decline #46).Verification
sbt compile/sbt stageclean;bin/contains exactlyccas+ccas-server(+.bat).ccas-serverforwards-main ccas.server.CcasServer;ccasdefaults toccas.cli.Main.bin/ccas serveagainst a local Postgres →/healthand/health/readyboth 200, clean SIGTERM.bin/ccas <other>andbin/ccas(no args) → exit 1.Notes
bin/ccasreads settings from the process env only (no.envloader) — follow-upccas configcommand filed asccas configcommand to manage CCAS settings (DB connection, contact email, …) #67.🤖 Generated with Claude Code