Swift SPM Package minimum iOS version not propagating

Viewed 1137

I am creating a simple Library Swift Package:

import PackageDescription

let package = Package(
    name: "dpo-sdk-spm",
    platforms: [
        .iOS(.v10),
    ],
    products: [
        // Products define the executables and libraries produced by a package, and make them visible to other packages.
        .library(
            name: "dpo-sdk-spm",
            targets: ["dpo-sdk-spm"]),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        // .package(url: /* package url */, from: "1.0.0"),
        .package(url: "https://github.com/Alamofire/Alamofire.git", .upToNextMajor(from: "5.2.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 which this package depends on.
        .target(
            name: "dpo-sdk-spm",
            dependencies: ["Alamofire"]),
        .testTarget(
            name: "dpo-sdk-spmTests",
            dependencies: ["dpo-sdk-spm"]),
    ]
)

I specifically did not create a project file, as working with that in source control is a pain - and its not required to develop a library that will be consumed in a iOS App, that will have the necessary build settings etc. My Library was created using swift package init --type library and here is the structure:

enter image description here

I specified under the platforms node iOS V10, then pushed the package to my git repo. I added my git account to Xcode, created a App project, added my package via Xcode 11's built in SPM and had no issues, however trying to build I got:

Showing All Messages The package product 'Alamofire' requires minimum platform version 10.0 for the iOS platform, but this target supports 8.0

enter image description here

I did specify the platform and version in my Package.swift, why is the build pipeline ignoring this variable?

0 Answers
Related