Repository navigation
For Build Tools Plugin (artifactbundle)
.binaryTarget(
name: "mockolo",
url: "https://github.com/uber/mockolo/releases/download/2.7.0/mockolo.artifactbundle.zip",
checksum: "cb07e8330133fde35b235307c764a2c50ee0ab074f53bfbcb2feecea8dfa0472"
),New features
-
Add protocol-level @available annotation inheritance to generated mocks by @Keitaro0226 in #315
/// @mockable @available(iOS 18.0, *) protocol Foo: Sendable { func bar() } // Before public final class FooMock: Foo, @unchecked Sendable { // ❌ Missing @available } // After @available(iOS 18.0, *) public final class FooMock: Foo, @unchecked Sendable { }
-
Fix member-level @available attributes hoisted to mock class declaration by @farkasseb in #352
/// @mockable public protocol StorageInput: Sendable { func put(_ value: String, for key: String) async throws func string(for key: String) async throws -> String @available(*, noasync) @available(*, deprecated, message: "Use put(_:for:) async throws") @discardableResult func set(_ value: String, for key: String) -> Result<Void, Error> @available(*, noasync) @available(*, deprecated, message: "Use string(for:) async throws") func string(for key: String) -> Result<String, Error> } // Before — attributes from all deprecated members are concatenated onto the class declaration, causing a build error: @available(*, noasync) @available(*, deprecated, message: "Use put(_:for:) async throws") @discardableResult @available(*, noasync) @available(*, deprecated, message: "Use string(for:) async throws") public final class StorageInputMock: StorageInput, @unchecked Sendable { public var setCallCount: Int { ... } public func set(_ value: String, for key: String) -> Result<Void, Error> { ... } public func string(for key: String) -> Result<String, Error> { ... } } // After — only the protocol-conforming methods carry their own attributes: public final class StorageInputMock: StorageInput, @unchecked Sendable { public var setCallCount: Int { ... } public var setHandler: (...)? { ... } @available(*, noasync) @available(*, deprecated, message: "Use put(_:for:) async throws") public func set(_ value: String, for key: String) -> Result<Void, Error> { ... } public var stringForCallCount: Int { ... } public var stringForHandler: (...)? { ... } @available(*, noasync) @available(*, deprecated, message: "Use string(for:) async throws") public func string(for key: String) -> Result<String, Error> { ... } }
Fix bugs
- Fix same-type
whereconstraint generating non-generic type parameter in Swift 6 by @sidepelican with @Copilot in #348 - Fix nested bracket type overloading by @sidepelican in #349
- This is a breaking change.
- The naming may change when overridden functions are mocked.
protocol P { func update() -> Int func update() -> [String] } // Before class PMock: P { ... var updateStringHandler: (() -> [String])? ... } // After class PMock: P { ... var updateArrayStringHandler: (() -> [String])? ... }
- Fix IUO type rendering so
T!no longer generatesT?!by @farkasseb in #354 - Declare ArgValues arrays in type position by @farkasseb in #360
Maintenances
- Add run-name to release actions by @sidepelican in #343
- ci: declare contents:read on Build Actions workflow by @arpitjain099 in #351
- Add test case for initializer with function type in its generic type by @sidepelican in #355
- ci: pin the Xcode 16.2 and 16.4 jobs to macos-15 by @fummicc1 in #359
- Correct the documented default concurrency limit by @KYHyeon in #358
- Update CI and statically link swift-std for Linux by @sidepelican in #361
New Contributors
- @Keitaro0226 made their first contribution in #315
- @sidepelican with @Copilot made their first contribution in #348
- @arpitjain099 made their first contribution in #351
- @KYHyeon made their first contribution in #358
Full Changelog: 2.6.1...2.7.0