Closed daveverwer closed 4 months ago
i don’t think this is universally correct, Package.swift
can and often does occur in places that are not the root of a git repository. for example, benchmarks and examples often live in nested directories. it’s only the case that SwiftPM can use a package as a dependency if that package’s manifest lives at the root of the repository.
perhaps clarify that this only applies to packages that are intended to be used as version-controlled dependencies of other packages?
perhaps clarify that this only applies to packages that are intended to be used as version-controlled dependencies of other packages?
Thanks @tayloraswift, and of course you're correct that this is only for dependencies. I think given that , a better place for this might be in the "Creating a Library Package" section, around the file tree diagram. I just pushed an update to move it to there.
cc: @bnbarham
@swift-ci please test
Motivation:
We recently had an issue raised with SPI where someone thought the rule that
Package.swift
manifests must be located at the root of the package repository was something that SPI was enforcing rather than a SwftPM requirement.I thought (and subsequently double-checked) that it was a SwiftPM requirement for library packages, but my first step in those checks was to search the web and this page was the first official source that came up. It struck me that this would be a good place to make this requirement clear.
Modifications:
Clarified the Creating a Library Package section of the SwiftPM page to make this clear.
Result: