diff --git a/Package.swift b/Package.swift index e1cd13d..76e1500 100644 --- a/Package.swift +++ b/Package.swift @@ -1,10 +1,13 @@ -// swift-tools-version: 5.9 +// swift-tools-version:5.7 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "Path", + platforms: [ + .macOS(.v10_15) + ], products: [ // Products define the executables and libraries a package produces, making them visible to other packages. .library( @@ -16,7 +19,13 @@ let package = Package( // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( - name: "Path" + name: "Path", + cxxSettings: [ + .define("_CRT_SECURE_NO_WARNINGS", .when(platforms: [.windows])), + ], + linkerSettings: [ + .linkedLibrary("Pathcch", .when(platforms: [.windows])), + ] ), .testTarget( name: "PathTests", diff --git a/README.md b/README.md index d21d8c3..9c9b3f4 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,6 @@ [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftuist%2FPath%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/tuist/Path) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Ftuist%2FPath%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/tuist/Path) -[![Netlify Status](https://api.netlify.com/api/v1/badges/69daef71-b1cf-4d37-96ad-216cb953e668/deploy-status)](https://app.netlify.com/sites/Path/deploys) [![Path](https://github.com/tuist/Path/actions/workflows/Path.yml/badge.svg)](https://github.com/tuist/Path/actions/workflows/Path.yml) diff --git a/Sources/Path/Path.swift b/Sources/Path/Path.swift index 75f8d63..94799b5 100644 --- a/Sources/Path/Path.swift +++ b/Sources/Path/Path.swift @@ -620,7 +620,7 @@ extension Path { // in fact, it might well be best to return a custom iterator so we // don't have to allocate everything up-front. It would be backed by // the path string and just return a slice at a time. - let components = string.components(separatedBy: "/").filter { !$0.isEmpty } + let components = string.split(separator: "/").map(String.init).filter { !$0.isEmpty } if string.hasPrefix("/") { return ["/"] + components @@ -989,12 +989,6 @@ extension AbsolutePath { } } -extension PathValidationError: CustomNSError { - public var errorUserInfo: [String: Any] { - [NSLocalizedDescriptionKey: description] - } -} - // FIXME: We should consider whether to merge the two `normalize()` functions. // The argument for doing so is that some of the code is repeated; the argument // against doing so is that some of the details are different, and since any