-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SPM Module name conflicts with Contentstack
struct
#21
Comments
Thanks for raising the issue @TheNightmanCodeth, We will look into this. |
Thanks! You guys rock 🥳 |
Hi @TheNightmanCodeth , we are still checking this issue, meanwhile can you please give it a try to change the module name from // swift-tools-version:5.5
import PackageDescription
let package = Package(
name: "Contentstack",
products: [
.library(
name: "ContentstackSwift", // Change the module name here
targets: ["ContentstackSwift"]) // Update the target name as well
],
dependencies: [],
targets: [
.target(
name: "ContentstackSwift", // Change the target name here
dependencies: [],
path: "Sources"
),
.testTarget(
name: "ContentstackTests",
dependencies: ["ContentstackSwift"],
path: "Tests"
)
]
) By changing both the module name and target name to Please let us know if above does not resolve the issue. |
Hi, @ishaileshmishra, yes, that is what I said. It does me no good until y'all merge the changes in on your end so we can add the SPM dependency without conflict. |
Great, @TheNightmanCodeth or could we use CS for the main struct within the Contentstack like Alamofire uses AF, Kingfisher user KF |
@ishaileshmishra Any update on this, as it is blocking us to upgrade the dependency |
Hi @ishaileshmishra Any updates on this issue? We are past a year on the original PR. |
Hi @DanAckermanPFJ, I'll check with the team and get back to you shortly. |
Is there any Update as I can't Access the APIError declared in the Package with ContentStack.APIError syntax |
@abhinav-from-contentstack are you folks planning to fix this issue? |
@ishaileshmishra @abhinav-from-contentstack any planned fixed for this? |
When adding the library via SPM, the module name does not match that of the Cocoapods version and conflicts with the
Contentstack
struct.This leads to issues when a type name in the library conflicts with one in the project it's added to. For example:
APIError
is a common type name. In order to differentiate, we might useContentstackSwift.APIError
. In the SPM library, this is not possible because the module name isContentstack
. When differentiating viaContentstack.APIError
, the compiler thinks we want to referenceContentstack(module).Contentstack(struct).APIError
which does not exist.This can be resolved simply by changing the module name in
Package.swift
toContentstackSwift
like so:Additionally, this allows migration to SPM without any need to refactor pre-existing code
The text was updated successfully, but these errors were encountered: