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.
Max Howell ported swiftpm to swift 3 api guidelines.
Max Howell added Xcode project file generation into swiftpm, that means you can use Xcode for your swift packages (on OSX).
Just run this command to generate the Xcode project file for the package.
$ swift build --generate-xcodeproj or $ swift build -X
This will generate the Xcode project in root directory of the package. If you prefer the file to be somewhere else Honza Dvorsky raised a PR to generate it in a custom location.
I started a PR adding basic support of building C language based on Daniel Dunbar’s proposal.
Brian Croom updated the tests in swiftpm since now you don’t have to conform to
XCTestCasesubclasses on linux and instead
allTestsbecomes a static computed property which you pass as param to
XCTMain. Something like this :
I refactored 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
I fixed the issue where
Package.swiftwas not working for folders inside
testsdirectory. Now you can exclude tests or any of the subfolders.
I added better error handling in
swift testwhich will now suggest to run
swift buildif someone forgets it before running
swift test. Also if there is no test module then
swift testnow shows a nice one liner error.
swift testby adding
--helpand eliminating the need of adding
-XCTestto pass arguments to it.
Internal swiftpm changes
Max Howell raised a PR which would give
bootstrapscript powers to parse swiftpm’s
Package.swiftso the targets don’t need to be duplicated inside the script 😍
I changed the
PackageDescriptionmodule such that it would read
Package.swiftand write the TOML represention to a file if a fd is passed to it instead of dumping it on stdout.
I refactored the
Buildmodule and created models for llbuild tools using protocols and protocol extension instead of subclassing which worked out great.