目录
目录README.md

SemanticVersioningKit

Swift 5.7.2 SPM CI

SemanticVersioningKit is a small library to create and parse Semantic Versioning conforming representations.

Installation

Swift Package Manager

To integrate using Apple’s Swift Package Manager, add the following as a dependency to your Package.swift:

dependencies: [
    .package(url: "https://github.com/alexanderwe/SemanticVersioningKit.git", from: "2.1.2")
]

Alternatively navigate to your Xcode project, select Swift Packages and click the + icon to search for SemanticVersioningKit.

Manually

If you prefer not to use any of the aforementioned dependency managers, you can integrate SemanticVersioningKit into your project manually. Simply drag the Sources Folder into your Xcode project.

Usage

At first import SemanticVersioningKit

import SemanticVersioningKit

Define a SemanticVersion instance

let version = SemanticVersion(major: 1, minor: 0, patch: 0) // "1.0.0"
let versionWithAdditions = SemanticVersion(major: 1, minor: 0, patch: 0, preReleaseIdentifiers: ["alpha", "1"], buildIdentifiers: ["exp","sha","5114f85"]) // "1.0.0-alpha.1+exp.sha.5114f85"

It is also possible to create a SemanticVersion from a String representation. Just be aware that the initialization can fail due to the used String not conforming to the Semantic Versioning format.

let version = try SemanticVersion(input: "1.0.0")
let failed = try SemanticVersion(input: ".0.0")

Contributing

Contributions are very welcome 🙌

关于
408.0 KB
邀请码
    Gitlink(确实开源)
  • 加入我们
  • 官网邮箱:gitlink@ccf.org.cn
  • QQ群
  • QQ群
  • 公众号
  • 公众号

©Copyright 2023 CCF 开源发展委员会
Powered by Trustie& IntelliDE 京ICP备13000930号