Closed pavm035 closed 3 years ago
That error tells you how to fix this.
xxxx/Package.swift: dependency 'OHHTTPStubsSwift' in target 'MyFrameworkTests' requires explicit declaration; reference the package in the target dependency with '.product(name: "OHHTTPStubsSwift", package: "OHHTTPStubs")'
In the test target dependencies use this .product(name: "OHHTTPStubsSwift", package: "OHHTTPStubs")
Change your .testTarget
to:
.testTarget(
name: "MyFrameworkTests",
dependencies: [
"MyFramework",
.product(name: "OHHTTPStubsSwift", package: "OHHTTPStubs")
]
)
It also appears you can now do the following, which I have opted for:
.testTarget(
name: "MyFrameworkTests",
dependencies: [
.target(name: "MyFramework"),
.product(name: "OHHTTPStubsSwift", package: "OHHTTPStubs")
]
)
New Issue Checklist
OHHTTPStubs
for your project sectionEnvironment
Issue Description
I'm trying to add OHHTTPStubs ad my pakcage dependency in my Swift package, I can import OHHTTPStubs but not OHHTTPStubsSwift into my project, i have added dependency like this
.package(url: "https://github.com/AliSoftware/OHHTTPStubs.git", .upToNextMajor(from: "9.0.0")),
NOTE: There is someone posted similar problem here https://stackoverflow.com/questions/61069763/swift-package-manifest-for-multiple-library-products
Complete output when you encounter the issue (if any)