ios_sdk icon indicating copy to clipboard operation
ios_sdk copied to clipboard

Misleading Package Reference Name

Open tonnihyldgaard opened this issue 4 years ago • 6 comments

/* XCRemoteSwiftPackageReference "ios_sdk" */,

We have noticed that the Phrase SDK for iOS is named ios_sdk in the XCRemoteSwiftPackageReference, this could potentially lead to package conflicts if another framework uses the same name for their SDK.

It's a minor thing, but I suggest changing the reference name to reduce risk of conflicts :)

tonnihyldgaard avatar Feb 03 '21 12:02 tonnihyldgaard

Hey @tonnihyldgaard

Sorry for a bit delay in following up on this one. Thanks for the suggestion, it makes sense. I actually think we didn't even specified this on purpose, probably SPM just took the name of our public repo. Out of curiosity (I checked Phrase iOS SDK repo) - is their SDK dependency named ios_sdk (underscore) or ios-sdk (dash)?

uerceg avatar Aug 26 '21 10:08 uerceg

If no name is specified by the user, the name will be deduced from URL.

Example of integration without specifying a name:

// swift-tools-version:5.5

import PackageDescription

let package = Package(
    name: "Dependencies",
    platforms: [.iOS(.v14)],
    products: [
        .library(
            name: "Dependencies",
            targets: ["Dependencies"])
    ],
    dependencies: [
        .package(url: "https://github.com/adjust/ios_sdk",
                 revision: "v4.29.6")
    ],
    targets: [
        .target(
            name: "Dependencies",
            dependencies: [
                .product(name: "Adjust",
                         package: "ios_sdk"),
                .product(name: "Criteo",
                         package: "ios_sdk")
            ]),
        .testTarget(
            name: "DependenciesTests",
            dependencies: ["Dependencies"])
    ]
)

Example of integration with specifying a name:

// swift-tools-version:5.5

import PackageDescription

let package = Package(
    name: "Dependencies",
    platforms: [.iOS(.v14)],
    products: [
        .library(
            name: "Dependencies",
            targets: ["Dependencies"])
    ],
    dependencies: [
        .package(name: "Adjust",
                 url: "https://github.com/adjust/ios_sdk",
                 revision: "v4.29.6")
    ],
    targets: [
        .target(
            name: "Dependencies",
            dependencies: [
                .product(name: "Adjust",
                         package: "Adjust"),
                .product(name: "Criteo",
                         package: "Adjust")
            ]),
        .testTarget(
            name: "DependenciesTests",
            dependencies: ["Dependencies"])
    ]
)

Gawetaner avatar Mar 28 '22 08:03 Gawetaner

Hi @tonnihyldgaard @Gawetaner

We have included your suggestion in our roadmap for the next major iOS SDK release (v5.0.0) and will make every effort to address this improvement at that time.

We cannot modify the existing SDK version since this is a breaking change on our side.

Thank you for your feedback.

Aditi3 avatar Oct 13 '23 10:10 Aditi3