Updated to Swift 5.1 and fixed deprecations #46
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I noticed, while building Publish with Swift 5.1 on Linux, that ShellOut was giving build warnings related to
launchPath
andlaunch()
being deprecated. As I was investigating, I found that several of the tests were not running on Linux, and were actually failing when included. This PR addresses the following issues:ShellOutTests.allTests
.#if os
checks inProcess.launchBash(with:outputHandle:errorHandle:)
are no longer needed, asFileHandle.readabilityHandler
was implemented and merged in Swift 5.1. This means both macOS and Linux can use the same code paths (this was not true when d18b7b6 was committed). This also fixes most of the tests.if #available(OSX 10.13, *)
checks to useexecutableURL
andrun()
on current macOS and Linux targets. Defaults to the older API on earlier versions of macOS. This gets rid of the build warnings.testSingleCommandAtPathContainingTilde()
to run at~/..
(typically/Users
on macOS and/home
on Linux) instead of~
. This is because Swift docker images, which are one of the easier ways to test Swift on Linux, have an empty home directory by default, and thus fail this test. By contrast,~/..
must contain at least~
, and still tests that paths with~
work.I think this should cut a new version release, as it changes the minimum Swift version from 4.2 to 5.1.