mxcl / PromiseKit

Promises for Swift & ObjC.
MIT License
14.24k stars 1.46k forks source link

SPM doesn't compile properly with version 8.x.x #1327

Closed cbauer10 closed 1 year ago

cbauer10 commented 1 year ago

PromiseKit major version = 8

We are using SwiftPM to install PromiseKit and get the following error using version 8.x.x:

package 'package.swift' is using Swift tools version 3.1.0 which is no longer supported; consider using '// swift-tools-version: 5.9' to specify the current tools version

We are using Swift Tools 5.9 as you can see from our Package.swift file:

// swift-tools-version:5.9
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
    name: "AllegionNetworking",
    platforms: [
        .iOS(.v13)
    ],
    products: [
        // Products define the executables and libraries a package produces, and make them visible to other packages.
        .library(
            name: "AllegionNetworking",
            targets: ["AllegionNetworking"])
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
         .package(url: "https://ircost.visualstudio.com/Allegion/_git/Allegion.Logging.iOS",
                  .upToNextMajor(from: "4.0.0")),
         .package(url: "https://ircost.visualstudio.com/Allegion/_git/Allegion.Security.iOS",
                  .upToNextMajor(from: "3.0.0")),
         .package(url: "https://github.com/mxcl/PromiseKit",
                  .upToNextMajor(from: "8.0.0")),
         .package(url: "https://github.com/PromiseKit/Foundation",
                  .upToNextMajor(from: "3.0.0")),
         .package(url: "https://github.com/realm/SwiftLint",
                  .upToNextMajor(from: "0.53.0")),
         .package(url: "https://github.com/Quick/Nimble",
                  .upToNextMajor(from: "13.0.0"))
    ],
    targets: [
        // Targets are the basic building blocks of a package. A target can define a module or a test suite.
        // Targets can depend on other targets in this package, and on products in packages this package depends on.
        .target(
            name: "AllegionNetworking",
            dependencies: [
                .product(name: "AllegionLoggingLite", package: "Allegion.Logging.iOS"),
                .product(name: "AllegionSecurity", package: "Allegion.Security.iOS"),
                "PromiseKit",
                .product(name: "PMKFoundation", package: "Foundation")
            ],
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]),
        .testTarget(
            name: "AllegionNetworking-UnitTests",
            dependencies: ["AllegionNetworking", "Nimble"],
            path: "Tests/AllegionNetworkingTests/Unit",
            resources: [
                .copy("Supporting Files/developerapi.allegion.com.cer"),
                .copy("Supporting Files/www.google.com.cer")
            ],
            swiftSettings: [
                .define("SPM")
            ],
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]),
        .testTarget(
            name: "AllegionNetworking-IntegrationTests",
            dependencies: ["AllegionNetworking", "Nimble"],
            path: "Tests/AllegionNetworkingTests/Integration",
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")]),
        .testTarget(
            name: "AllegionNetworking-FunctionalTests",
            dependencies: ["AllegionNetworking", "Nimble"],
            path: "Tests/AllegionNetworkingTests/Functional",
            plugins: [.plugin(name: "SwiftLintPlugin", package: "SwiftLint")])
    ]
)

Changing the Swift Tools version does not change anything. PromiseKit version 6.22.1 works just fine with Swift Tools 5.9 and all is well, but we would like to update to the newest version of PromiseKit.

RomanPodymov commented 1 year ago

Hello @cbauer10 What about this fix?

RomanPodymov commented 1 year ago

Hello @cbauer10 Have you tried my fork in your project? Just want to know if my fix is correct.

cbauer10 commented 1 year ago

@RomanPodymov Yes, this does resolve the issue. I support your PR #34.

@mxcl Any chance we can update Foundation to the latest version as @RomanPodymov has suggested?

mxcl commented 1 year ago

sorry for the delay