BasePath
public enum BasePath
Base paths for resolving relative paths.
-
Relative to the directory containing the executable itself.
For example, when executing your project from the command line
~/.build/release/myApp.Declaration
Swift
case executable
-
Relative to the project directory. (This is the directory containing the
Package.swiftof the project, determined by traversing up the directory structure starting at the directory containing the executable).Note: Because
BasePath.projectdepends on the existence of aPackage.swiftfile somewhere in a parent folder of the executable, changing its location usingswift build --build-pathis not supported.Declaration
Swift
case project
-
Relative to the present working directory (PWD).
Note: When running in Xcode, PWD is set to the directory containing the
Package.swiftof the project.Declaration
Swift
case pwd
-
Relative to a custom location passed in by
String.Declaration
Swift
case customPath(String)
-
Get the absolute path, as denoted by self.
Declaration
Swift
public var path: String
View on GitHub
BasePath Enumeration Reference