mxcl / swift-sh

Easily script with third-party Swift dependencies.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Swift 5.2 support issue

c0diq opened this issue · comments

swift-sh breaks when using repositories that have a . in their name.

import Path // mxcl/Path.swift ~> 1.0.1

The error is:

error: unknown package 'Path' in dependencies of target 'makeModule'

Here's the generated package

// swift-tools-version:5.2
import PackageDescription

let pkg = Package(name: "makeModule")

pkg.products = [
    .executable(name: "makeModule", targets: ["makeModule"])
]
pkg.dependencies = [
    .package(url: "https://github.com/kylef/Commander.git", .upToNextMajor(from: "0.9.1")),
    .package(url: "https://github.com/wlisac/Environment.git", .upToNextMajor(from: "0.11.1")),
    .package(url: "https://github.com/mxcl/Path.swift.git", .upToNextMajor(from: "1.0.1")),
    .package(url: "https://github.com/JohnSundell/ShellOut.git", .upToNextMajor(from: "2.0.0"))
]
pkg.targets = [
    .target(name: "makeModule", dependencies: [.product(name: "Commander", package: "Commander"), .product(name: "Environment", package: "Environment"), .product(name: "Path", package: "Path"), .product(name: "ShellOut", package: "ShellOut")], path: ".", sources: ["main.swift"])
]

#if swift(>=5) && os(macOS)
pkg.platforms = [
   .macOS(.v10_15)
]
#endif

The package should be Path.swift instead of just Path.

Specifically I believe this only happens when the toolchain is Swift 5.2, which probably explains the test failures in #117, #105