2023-03-14 21:39:56 -04:00
wip
2023-03-14 16:23:16 -04:00
wip
2023-03-13 17:17:12 -04:00
wip
2023-03-14 21:32:27 -04:00
wip
2023-03-14 21:39:56 -04:00
wip
2023-03-14 17:03:24 -04:00
2023-03-10 11:07:27 -05:00
wip
2023-03-14 16:23:16 -04:00
2023-03-12 23:02:11 -04:00
wip
2023-03-14 18:49:37 -04:00
wip
2023-03-13 17:17:12 -04:00

swift-git-version

A swift package that exposes some helpers to set the version of a command line tool to the git tag or the git sha, if a tag is not set for the current commit.

Usage

You can use this in your command line tool via the swift package manager.

let package = Package(
  ...
  dependencies: [
    .package(url: "https://github.com/m-housh/swift-git-version.git", from: "0.1.0")
  ],
  targets: [
    .executableTarget(
      name: "my-executable",
      dependencies: [
        ...
      ]
    ),
    .executableTarget(
      name: "my-executable-builder",
      dependencies: [
        .product(name: "GitVersion", package: "swift-git-version")
      ]
    ),
  ]
)

Inside of your executable (my-executable) in the above example, you will want to create a file that contains your version variable.

// Do not set this variable, it is set by the build script.

let VERSION: String? = nil
Description
No description provided
Readme 597 KiB
0.2.0 Latest
2024-12-26 19:04:47 +00:00
Languages
Swift 97.5%
Just 2.4%
Dockerfile 0.1%