There has been high activity on Swift Package Manager recently starting with Kostiantyn Koval and me receiving commit access \o/. Here is a summary of changes which are worth looking at and will affect you if you’re developing packages with swiftpm.
Brian Croomupdated the tests in swiftpm since now you don’t have to conform to XCTestCaseProvider for XCTestCase subclasses on linux and instead allTests becomes a static computed property which you pass as param to testCase method in XCTMain. Something like this :
then in LinuxMain.swift :
Irefactored the init mode of swiftpm which can now generate both library and executable packages default being executable package.
$ swift build --init # same as `swift build --init executable`
$ swift build --init library
Ifixed the issue where exclude in Package.swift was not working for folders inside tests directory. Now you can exclude tests or any of the subfolders.
I added better error handling in swift test which will now suggest to run swift build if someone forgets it before running swift test. Also if there is no test module then swift test now shows a nice one liner error.
Iimprovedswift test by adding -h/--help and eliminating the need of adding -XCTest to pass arguments to it.
Internal swiftpm changes
Max Howell raised a PR which would give bootstrap script powers to parse swiftpm’s Package.swift so the targets don’t need to be duplicated inside the script 😍
Ichanged the PackageDescription module such that it would read Package.swift and write the TOML represention to a file if a fd is passed to it instead of dumping it on stdout.
Irefactored the Build module and created models for llbuild tools using protocols and protocol extension instead of subclassing which worked out great.