feat: eignexCli version + generated BuildInfo source for --version#16
Merged
Conversation
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 #13.
What changed
EignexCliExtensiongainsversion,appName,appId, andbuildInfoPackageproperties.generateCliBuildInfotask emits aninternal object BuildInfo { NAME; ID; VERSION; versionLine() }into a generatedcommonMainsource dir, wired viasrcDirso it compiles across every KMP target (JVM + native) — mirroring the root build'sgenerateKbuildVersionpattern.version→project.version;appName→ project name;appId→ project group;buildInfoPackage→ the package ofmainClass(falling back to the group).Why
--versionis table stakes for a CLI, and the version should have one source of truth instead of a hand-maintainedconst val VERSIONthat drifts from the published/project version (and, for FlatZinc solvers, from the.msc). The awkward parts — a configuration-cache-safe codegen task, srcDir wiring across targets, and staying lint-clean — are exactly what the shared plugin should absorb.Lint-clean
Generated under
build/, so it's outside the detekt/checkKdocsrcscan; and it'sinternal, so dokka (public API only) ignores it. The emitted KDoc has no[links]/angle-brackets, so even if scanned it's clean.Scope
Kept in
cli(notkmp/jvm): no library code hand-maintains a version today,clidoesn't applykmp, andappName/appId/versionLine()/--versionare CLI conventions. Base-layer exposure can be a future opt-in if a library ever needs a runtime version.Testing
./gradlew compileKotlinpasses. Functional generation is exercised by the klause-cli migration (drop the hand-maintained BuildInfo, seteignexCli { version/appName/appId }), to follow once this publishes.