我有一个本地 swift 包Foo,它提供了两个不同的库Foo和FooB。现在我想在另一个本地包Bar 中使用它们。我只能通过路径声明来获取整个包。有没有办法命名/指定应使用哪个库?我想在我的Bar包中使用FooB。
let package = Package(
name: "Foo",
products: [
.library(name: "Foo", targets: ["Foo"]),
.library(name: "FooB", targets: ["FooB"])
]
...)
Run Code Online (Sandbox Code Playgroud)
let package = Package(
name: "Bar",
dependencies: [
.package(path: "Foo"),
.package(path: "FooB") // this one does not work
],
...)
Run Code Online (Sandbox Code Playgroud)
// inside package Bar
import Foo
import FooB // this is throwing "no such module 'FooB'"
Run Code Online (Sandbox Code Playgroud)