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.swift of the project, determined by traversing up the directory structure starting at the directory containing the executable).

    Note: Because BasePath.project depends on the existence of a Package.swift file somewhere in a parent folder of the executable, changing its location using swift build --build-path is not supported.

    Declaration

    Swift

    case project
  • pwd

    Relative to the present working directory (PWD).

    Note: When running in Xcode, PWD is set to the directory containing the Package.swift of 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