bitmark-inc / tweetnacl-swiftwrap

MIT License
20 stars 23 forks source link

TweetNacl can't be incuded in SPM package descriptions #7

Open HelgeBecker opened 3 years ago

HelgeBecker commented 3 years ago

Given a Package.swift description like this:

// swift-tools-version:5.3 import PackageDescription let package = Package(name: "Foo", platforms: [ .macOS(.v10_12) ], products: [ .library( name: "Foo", targets: ["Foo"]), ], dependencies: [ .package(url: "https://github.com/bitmark-inc/tweetnacl-swiftwrap.git", from: "1.0.2"), ], targets: [ .target(name: "Foo", dependencies: ["tweetnacl-swiftwrap"]), ], swiftLanguageVersions: [.v5])

Will lead to an error during resolving: product 'tweetnacl-swiftwrap' not found. it is required by package 'Foo' target 'Foo'.

Happens with Xcode 12.4 (current) and 12.5 (12E262)

danielrbrowne commented 3 years ago

I've found that this works for me in Xcode 12.4 / 12.5:

// swift-tools-version:5.3
import PackageDescription

let package = Package(
    name: "Foo",
    platforms: [.iOS("13.0"),
                .macOS("10.15")],
    products: [
        .library(
            name: "Foo",
            targets: ["Foo"])
    ],
    dependencies: [
        .package(name: "TweetNacl",
                 url: "https://github.com/bitmark-inc/tweetnacl-swiftwrap",
                 .upToNextMajor(from: "1.0.0"))
    ],
    targets: [
        .target(
            name: "Foo",
            dependencies: [
                "TweetNacl"
            ]),
    ]
)