LXSemVer
LXSemVer aims to provide a simple yet specification compliant implementation of Semantic Versioning 2.0.0 (SemVer) in Swift 4.x.
Features
- Parsing version string into
Versioninstances. -
DotSeparatedValues(DSV) class to represent prerelease and/or build metadata. -
DotSeparatedValuesandVersioninstances supportnext(), which provides a list of logical next DSVs and/or versions. -
DotSeparatedValuesandVersioninstances follows SemVer's precedence rule.
Requirements
- Mac OS X 10.10+ / iOS 8.0+
- Xcode 9.0+
Installation
CocoaPods
pod "LXSemVer", "~> 3.0"Carthage
github "trifia/LXSemVer" ~> 3.0
Usage
Parsing a Version String
import LXSemVer
if let version = Version(string: "1.0.0") {
print(version)
}From String Literal and Getting Next Verions
import LXSemVer
let version: Version = "1.0.1-alpha.1"
print(version.next())Compatibility
LXSemVer 3.0 uses Swift 4.
For projects using Swift 3, please use LXSemVer 2.0.
For projects using Swift 2.2 or older, please use LXSemVer 1.2.
Concept
Version Graph
LXSemVer unique point is its concept of version graph. SemVer precedence rule (SemVer Specification 11) allow for logical digraph of versioning.
At any specific version, there are multiple logical paths leading to the next versions and these versions have logical ordering between them as well.
LXSemVer extends on SemVer by recognizing alpha, beta and rc as the first prerelease identifiers.
Together, they make LXSemVer an excellent choice for versioning management.
License
LXSemVer is released under the MIT license. See LICENSE for details.
