kareman / SwiftShell

A Swift framework for shell scripting.
https://kareman.github.io/SwiftShell
MIT License
1.03k stars 87 forks source link

swift package build require macOS 10.13 not newer. #75

Closed KeithPiTsui closed 5 years ago

KeithPiTsui commented 5 years ago
swift build -c release
Cloning https://github.com/kareman/SwiftShell.git
Resolving https://github.com/kareman/SwiftShell.git at 5.0.0
error: the product 'SwiftShell' requires minimum platform version 10.13 for macos platform

If I understand correctly, I guess the problem would be caused by specifying require platform of 10.13 only on its Package.swift, whereas the version of MacOS I use now is 10.14.4.

Appreciate any help.

kareman commented 5 years ago

Hi, to fix this you need to include the macOS requirement in your own Package.swift file, like this:

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

import PackageDescription

let package = Package(
    name: "$NAME",
    platforms: [
        .macOS(.v10_13),
    ],
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(url: "https://github.com/kareman/SwiftShell", from: "5.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 which this package depends on.
        .target(
            name: "$NAME",
            dependencies: ["SwiftShell"]),
    ]
)

The line ".macOS(.v10_13)" means that it requires at least 10.13, so it also supports 10.14. But I see I forgot to mention that in the readme, I will fix that now. Thanks for pointing it out.

KeithPiTsui commented 5 years ago

Cool. Thanks for your help.