yeokm1 / SwiftSerial

A Swift Linux and Mac library for reading and writing to serial ports.
MIT License
136 stars 40 forks source link

Support for Swift Package Manager - Swift 5 #10

Closed MotivDev closed 5 years ago

MotivDev commented 5 years ago

Looks like the latest release supports Swift 5! Love it! I did have a problem where Swift Package Manager would not resolve the dependency graph. I cloned the repo and was able to get it working by modifying the Package.swift file as follows:

// swift-tools-version:5.0
import PackageDescription

let package = Package(
    name: "SwiftSerial"
)

Then in the app directory change the Package.swift file to the following to support SPM as follows:

// 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: "TestApp",
    dependencies: [
        // Dependencies declare other packages that this package depends on.
        .package(
            url: "https://github.com/yeokm1/SwiftSerial", .upToNextMajor(from:"0.1.0")
        ),
...

I am not that fluent on SPM yet, so there are probably better ways of getting the current repository to work with Swift 5.

yeokm1 commented 5 years ago

Thanks for raising this! The change looks good. Here is a great opportunity to issue a pull request. Would you like to do so?

yeokm1 commented 5 years ago

A PR was accepted to fix this issue. https://github.com/yeokm1/SwiftSerial/pull/14