Skip to content

Commit 87990d7

Browse files
committed
Document that swiftpmConfig.name must match the manifest's product
The aggregator depends on a self-managed library as .product(name: "<SwiftName>", package: "<SwiftName>"), so the library's Package.swift has to declare a product with that name. The rule holds for a manifest at the root, in ios/ or in apple/.
1 parent 5d2b2e8 commit 87990d7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

‎packages/react-native/scripts/spm/__docs__/spm-scripts.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,6 +613,12 @@ then in `ios/`, then in `apple/`, and uses the first one it did not generate
613613
itself. A manifest in `ios/` or `apple/` keeps SwiftPM artifacts (`.build/`,
614614
`.swiftpm/`, `Package.resolved`) out of the npm package root.
615615

616+
For a self-managed library, `swiftpmConfig.name` must equal the name of a
617+
product its `Package.swift` declares. The aggregator depends on the library as
618+
`.product(name: "<SwiftName>", package: "<SwiftName>")`, and SwiftPM fails to
619+
resolve the package graph if no product has that name. A manifest in `ios/` or
620+
`apple/` follows the same rule as one at the root.
621+
616622
SwiftPM derives package identity from the path basename, and several libs may
617623
put their manifest inside an `ios/` or `apple/` subdir. To keep identity unique,
618624
each self-managed dep is exposed through a uniquely-named symlink at

0 commit comments

Comments
 (0)