Fix license badge
A Simple SwiftPM plugin to show Git commit on your apps
Milepost is a simple library to fetch Git commit info.
You can show Git revisions for debug builds or production builds for end-users’ inquiry.
This library provides SwiftPM Build Tools Plugin. It helps developers to integrate it easily.
https://github.com/giginet/Milepost.git
Milepost
General
Frameworks, Libraries, and Embedded Content
+
Build Phases
Run Build Tool Plug-ins
PrepareMilepost
You can fetch a latest revision with RevisionLoader.load().
RevisionLoader.load()
import Milepost let revision = RevisionLoader.load()! revision.hash revision.branch revision.shortHash revision.lastCommit.author.description revision.lastCommit.committer.description revision.lastCommit.subject revision.lastCommit.authorDate revision.lastCommit.commitDate
You can easily build a setting page like followings:
import SwiftUI import Milepost struct RevisionView: View { var body: some View { List { Section { if let revision = RevisionLoader.load() { LabeledContent("Hash") { Text(revision.hash) .font(.caption) } LabeledContent("Short Hash") { Text(revision.shortHash) } LabeledContent("Branch") { Text(revision.branch ?? "-") } LabeledContent("Last Author") { VStack(alignment: .trailing) { Text(revision.lastCommit.author.name) Text(revision.lastCommit.author.email) .font(.caption) } } LabeledContent("Commit Message") { Text(revision.lastCommit.subject ?? "-") } } } header: { Text("Revision") } } } }
This plugin uses SwiftPM Build Tools Plugin. So you have to use Xcode 14.0 or above.
This feature is only required on a build process. Thus, this library runs on any platform versions.
©Copyright 2023 CCF 开源发展委员会 Powered by Trustie& IntelliDE 京ICP备13000930号
Milepost
A Simple SwiftPM plugin to show Git commit on your apps
Summary
Milepost is a simple library to fetch Git commit info.
You can show Git revisions for debug builds or production builds for end-users’ inquiry.
This library provides SwiftPM Build Tools Plugin. It helps developers to integrate it easily.
Installation
1. Integrate Milepost in your project with SwiftPM
https://github.com/giginet/Milepost.git
Milepost
product2. Link Milepost in your application target
General
>Frameworks, Libraries, and Embedded Content
>+
Milepost
3. Add build phases to fetch git info
Build Phases
>Run Build Tool Plug-ins
>+
PrepareMilepost
Usage
You can fetch a latest revision with
RevisionLoader.load()
.You can easily build a setting page like followings:
Requirements
This plugin uses SwiftPM Build Tools Plugin. So you have to use Xcode 14.0 or above.
This feature is only required on a build process. Thus, this library runs on any platform versions.