Swift implementation of the package url specification.
- Swift 5.3+
import PackageURL
let purl: PackageURL = "pkg:swift/apple/[email protected]"
purl.type // "swift"
purl.namespace // "apple"
purl.name // "swift-argument-parser"
purl.version // "0.4.3"
purl.description // "pkg:swift/apple/[email protected]"
To use the PackageURL
library in a Swift project,
add the following line to the dependencies in your Package.swift
file:
.package(url: "https://github.com/mattt/packageurl-swift", from: "0.0.1"),
Finally, include "PackageURL"
as a dependency for your executable target:
let package = Package(
// name, platforms, products, etc.
dependencies: [
.package(url: "https://github.com/mattt/packageurl-swift", from: "0.0.1"),
// other dependencies
],
targets: [
.target(name: "<#target#>", dependencies: [
.product(name: "PackageURL", package: "packageurl-swift"),
]),
// other targets
]
)
MIT