0.19.0: Night Owl
Targets
Framework
- Xcode 13.2 / Swift 5.5.2
- iOS 9.0+, macOS 10.10+, tvOS 9.0+, watchOS 7.4+
Generator
- macOS 10.15+
Migrating from 0.18
Re-configure SwiftPM projects
Mockingbird 0.19 improves support and guidance for setting up SwiftPM projects and packages. Previously, setting up a SwiftPM test target would use a path relative to $HOME
for the generator executable, which wasn’t portable between development environments. If you use SwiftPM, you should consider re-configuring test targets with the new configure
command to apply the fixes in 0.19.
Switch to the configure command
The install
and download
commands have been replaced with configure
, which is a superset of the old commands but is not backwards compatible. Most workflows should be unaffected as these commands are only used to initially set up a project, not to generate mocks. See the Configure Command Options documentation for more information.
New Features
Configurator
Mockingbird now provides a streamlined configurator to improve the setup process for all package managers, especially SwiftPM. It supports referencing executables located in the project’s default derived data directory and advanced features like generating mocks for source targets located in another project with the --srcproject
option. Supporting source files are also automatically downloaded and managed when running the configurator, making it even easier to set up projects for the first time.
$ mockingbird configure MockingbirdTests -- --targets MockingbirdTestsHost
🛠 Project: ~/mockingbird/Mockingbird.xcodeproj
🎯 Test Target: MockingbirdTests
🧰 Supporting sources: ~/mockingbird/MockingbirdSupport
✅ Downloaded supporting source files
✅ Added build phase 'Generate Mockingbird Mocks'
🎉 Successfully configured MockingbirdTests in 1s
🚀 Usage:
1. Initialize a mock in your test with `mock(SomeType.self)`
2. Build 'MockingbirdTests' (⇧⌘U) to generate mocks
3. Write some Swifty tests!
Revamped Documentation
The README, wiki, and API reference are now unified and available at MockingbirdSwift.com which is powered by DocC, Apple’s fancy documentation compiler tool. The new site is better organized and prettier, but more importantly it’ll be much more searchable once Google finishes indexing it. The example projects have also been streamlined and include a new SwiftPM package example.
Enhancements
- Fixed wildcard argument matching for Objective-C parameter types (#247)
Andrew Chang | jdschin - Optimized dependency graph traversal for JSON project descriptions (#249)
Andrew Chang | Jonathan Ueki - Fixed stubbing
nil
values on Objective-C mocks implicitly bridging toNSNull
(#246)
Andrew Chang | molenick-mov | Bohdan Orlov - Fixed nested optional codegen causing warnings about implicit type coercion to
Any?
(#248)
Andrew Chang | Bohdan Orlov - Fixed cache invalidation when generating mocks for a source target in a different Xcode project (#250)
Andrew Chang | Muzammil Mahmood - Fixed unavailable generic protocol mock initializer codegen (#251)
Andrew Chang | Luke - Replaced SwiftPM argument parsing utils with Swift Argument Parser (#245)
Andrew Chang - Added help message to file when no mockable types are generated (#252)
Andrew Chang - Refactored build automation pipeline (#256)
Andrew Chang