Skip to content

feat: eignexCli version + generated BuildInfo source for --version#16

Merged
rasros merged 1 commit into
mainfrom
feat/cli-build-info
Jun 14, 2026
Merged

feat: eignexCli version + generated BuildInfo source for --version#16
rasros merged 1 commit into
mainfrom
feat/cli-build-info

Conversation

@rasros

@rasros rasros commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Closes #13.

What changed

  • EignexCliExtension gains version, appName, appId, and buildInfoPackage properties.
  • A new CC-safe generateCliBuildInfo task emits an internal object BuildInfo { NAME; ID; VERSION; versionLine() } into a generated commonMain source dir, wired via srcDir so it compiles across every KMP target (JVM + native) — mirroring the root build's generateKbuildVersion pattern.
  • Defaults: versionproject.version; appName → project name; appId → project group; buildInfoPackage → the package of mainClass (falling back to the group).

Why

--version is table stakes for a CLI, and the version should have one source of truth instead of a hand-maintained const val VERSION that 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/checkKdoc src scan; and it's internal, 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 (not kmp/jvm): no library code hand-maintains a version today, cli doesn't apply kmp, and appName/appId/versionLine()/--version are CLI conventions. Base-layer exposure can be a future opt-in if a library ever needs a runtime version.

Testing

./gradlew compileKotlin passes. Functional generation is exercised by the klause-cli migration (drop the hand-maintained BuildInfo, set eignexCli { version/appName/appId }), to follow once this publishes.

@rasros rasros merged commit cfc994b into main Jun 14, 2026
2 checks passed
@rasros rasros deleted the feat/cli-build-info branch June 14, 2026 10:33
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.

eignexCli: support a version + generated build-info source for --version

1 participant