Brendonovich / swift-rs

Call Swift functions from Rust with ease!
Apache License 2.0
246 stars 28 forks source link

repo can't be depended on in new swift projects #53

Closed devsnek closed 11 months ago

devsnek commented 11 months ago

i'm pretty unfamiliar with the swift ecosystem but from what i can tell, package(name:url:from:) delegates to package(url:from:) because it is deprecated, and package(url:from:) thinks that the name is swift-rs, while the actual name is SwiftRs. this means it can't be depended on at all. I tested this by creating a fork named SwiftRs which i was successfully able to depend on.

Brendonovich commented 11 months ago

Have you tried explicitly adding SwiftRs as a dependency of your target?

let package = Package(
    dependencies: [
        .package(url: "https://github.com/Brendonovich/swift-rs", from: "1.0.5")
    ],
    targets: [
        .target(
            dependencies: [
                .product(
                    name: "SwiftRs",
                    package: "swift-rs"
                )
            ]
        )
    ]
)
devsnek commented 11 months ago

ah, the package: "swift-rs" seems to have been what i was missing, thank you!

Brendonovich commented 11 months ago

Interesting, I'll update the docs accordingly.