Closed valentary closed 5 months ago
Hi @valentary! Thanks for opening this issue.
To add a product from this package as a dependency, you'll need to set both its name and its package:
dependencies: [
.product(name: [Product Name], package: "aws-sdk-ios-spm")
]
So your package file would look like this:
let package = Package(
name: "aws-sdk-test-package",
platforms: [
.iOS(.v15)
],
products: [
// Products define the executables and libraries a package produces, making them visible to other packages.
.library(
name: "aws-sdk-test-package",
targets: ["aws-sdk-test-package"]),
],
dependencies: [
.package(url: "https://github.com/aws-amplify/aws-sdk-ios-spm.git", from: .init(2, 34, 0))
],
targets: [
// Targets are the basic building blocks of a package, defining a module or a test suite.
// Targets can depend on other targets in this package and products from dependencies.
.target(
name: "aws-sdk-test-package",
dependencies: [
.product(name: "AWSCore", package: "aws-sdk-ios-spm")
// + other products your package uses, .e.g "AWSS3", "AWSPinpoint", etc
]
),
.testTarget(
name: "aws-sdk-test-packageTests",
dependencies: ["aws-sdk-test-package"]),
]
)
Thanks!
This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.
I was trying to separate out a component of ours into it's own swift package. This component manages uploads to our cloud service and relies on aws-sdk-ios-spm package.
In my app, the AWS package works just fine, but once I packaged all my code, and tried to add the AWS package as a dependency, I could not make it work, the dependency package would download, but there seemed no way to add it to any target. I would get errors similar to
"product
AWSiOSSDKV2
required by packageaws-sdk-test-package
targetaws-sdk-test-target
not found"I tried various different targets, products strings etc from what I could find in the AWS package file, but nothing would work
It can be recreated with any simple package structure, a default XCode created one works to replicate the issue, here is my swift.package file