according to SE-356, it should be possible to specify a custom snippets directory with snippetsDirectory
:
Similar to the ./Sources and ./Tests directories, a user may want to override the location of the ./Snippets directory with a new, optional snippetsDirectory argument to the Package initializer. Since snippet targets aren't declared individually in the manifest, the setting exists at the package level.
let package = Package(
name: "MyPackage",
snippetsDirectory: "Examples",
products: [
// ...
],
dependencies: [
// ...
],
targets: [
// ...
]
)
but when i try this, i get an error:
error: extra argument 'snippetsDirectory' in call
snippetsDirectory: "Snippets",
~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
error: ExitCode(rawValue: 1)
the manifest is using swift-tools-version:5.8
of course.