standardized JAR naming to gittally.jar (version-free); updated scripts, docs, and build config to align; added --version support via BuildProperties

This commit is contained in:
Michael Hoennig
2026-07-08 22:45:23 +02:00
parent d0b38c557a
commit 347efc16c5
9 changed files with 38 additions and 18 deletions
@@ -6,6 +6,8 @@ import de.hoennig.gittally.commands.InitCommand
import de.hoennig.gittally.commands.RetryCommand
import de.hoennig.gittally.commands.ServerCommand
import de.hoennig.gittally.commands.StatusCommand
import org.springframework.beans.factory.ObjectProvider
import org.springframework.boot.info.BuildProperties
import org.springframework.stereotype.Component
import picocli.CommandLine
import picocli.CommandLine.Command
@@ -22,8 +24,22 @@ import picocli.CommandLine.Command
ConfigPrintCommand::class,
],
mixinStandardHelpOptions = true,
versionProvider = BuildPropertiesVersionProvider::class,
description = ["Lightweight, declarative CI/CD system"],
)
class GitTallyCommand : Runnable {
override fun run(): Unit = throw CommandLine.ParameterException(CommandLine(this), "Specify a subcommand")
}
/**
* Feeds `--version` from the Gradle project version via the `build-info`
* [BuildProperties] — the same source as the web UI footer, so the version is
* declared only in `build.gradle.kts`. Resolved through picocli's Spring factory;
* `dev` when running from classes (IDE, tests) where no build info exists.
*/
@Component
class BuildPropertiesVersionProvider(
private val buildProperties: ObjectProvider<BuildProperties>,
) : CommandLine.IVersionProvider {
override fun getVersion(): Array<String> = arrayOf("GitTally v${buildProperties.getIfAvailable()?.version ?: "dev"}")
}