Programmatically access information from Package.swift

Use the package manager itself:

https://github.com/apple/swift-package-manager/blob/master/Examples/package-info/Sources/package-info/main.swift

(There is no tag that corresponds to Swift 5.1, because it has not been release yet. You can use 0.4.0 with Swift 5.0, but some of the convenient helpers were not yet available then. If you need to use an older version of Swift (or you don’t want to worry about hunting down the compiler executable), you can use the equivalent helpers I provide in my SDGSwift wrapper.)

3 Likes