Skip to content

Commit

Permalink
[Fastlane.Swift] Allow overriding LaneFileProtocol lifecycles when su…
Browse files Browse the repository at this point in the history
…bclassing LaneFile (fastlane#20563)

* Refactored onError to be open instead of public

Allowing subclasses to override the onError function

* Added beforeAll and afterAll lifecycles

Allowing subclasses to override the lifecycles
  • Loading branch information
SvenTiigi authored Sep 28, 2024
1 parent c7572d2 commit af0c597
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion fastlane/swift/LaneFileProtocol.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ open class LaneFile: NSObject, LaneFileProtocol {
private static func trimLaneWithOptionsFromName(laneName: String) -> String {
return String(laneName.prefix(laneName.count - 12))
}

open func beforeAll(with lane: String) {}

open func afterAll(with lane: String) {}

public func onError(currentLane: String, errorInfo _: String, errorClass _: String?, errorMessage _: String?) {
open func onError(currentLane: String, errorInfo _: String, errorClass _: String?, errorMessage _: String?) {
LaneFile.onErrorCalled.insert(currentLane)
}

Expand Down

0 comments on commit af0c597

Please sign in to comment.