<!--
{
  "availability" : [

  ],
  "documentType" : "symbol",
  "framework" : "PackageDescription",
  "identifier" : "/documentation/PackageDescription/Target/path",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "PackageDescription"
    ],
    "preciseIdentifier" : "s:18PackageDescription6TargetC4pathSSSgvp"
  },
  "title" : "path"
}
-->

# path

The path of the target, relative to the package root.

```
final var path: String?
```

## Discussion

If the path is `nil`, Swift Package Manager looks for a target’s source files at
predefined search paths and in a subdirectory with the target’s name.

The predefined search paths are the following directories under the
package root:

- `Sources`, `Source`, `src`, and `srcs` for regular targets
- `Tests`, `Sources`, `Source`, `src`, and `srcs` for test targets

For example, Swift Package Manager looks for source files inside the
`[PackageRoot]/Sources/[TargetName]` directory.

Don’t escape the package root; that is, values like `../Foo` or `/Foo`
are invalid.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)