From f2fe73bcf49909b57d3cff96984793a662e1dc8a Mon Sep 17 00:00:00 2001 From: Karl Stenerud Date: Thu, 26 Sep 2024 13:29:48 +0200 Subject: [PATCH] Replace FixtureConfig with an Objective-C version so that it will be easier to split things out in a later PR without causing objc-swift issues. --- .../ios/iOSTestApp.xcodeproj/project.pbxproj | 18 ++++++---- .../project.pbxproj | 18 ++++++---- .../macOSTestApp.xcodeproj/project.pbxproj | 18 ++++++---- features/fixtures/shared/Bridge_InternalAPI.h | 10 ++++++ features/fixtures/shared/Bridge_PublicAPI.h | 9 +++++ .../CustomPluginNotifierDescriptionScenario.m | 1 + features/fixtures/shared/scenarios/Scenario.h | 4 +-- .../fixtures/shared/utils/FixtureConfig.h | 31 +++++++++++++++++ .../fixtures/shared/utils/FixtureConfig.m | 28 ++++++++++++++++ .../fixtures/shared/utils/FixtureConfig.swift | 33 ------------------- .../watchOSTestApp.xcodeproj/project.pbxproj | 6 ++++ 11 files changed, 122 insertions(+), 54 deletions(-) create mode 100644 features/fixtures/shared/Bridge_InternalAPI.h create mode 100644 features/fixtures/shared/Bridge_PublicAPI.h create mode 100644 features/fixtures/shared/utils/FixtureConfig.h create mode 100644 features/fixtures/shared/utils/FixtureConfig.m delete mode 100644 features/fixtures/shared/utils/FixtureConfig.swift diff --git a/features/fixtures/ios/iOSTestApp.xcodeproj/project.pbxproj b/features/fixtures/ios/iOSTestApp.xcodeproj/project.pbxproj index ff74fb394..296d00be4 100644 --- a/features/fixtures/ios/iOSTestApp.xcodeproj/project.pbxproj +++ b/features/fixtures/ios/iOSTestApp.xcodeproj/project.pbxproj @@ -86,11 +86,11 @@ 01F6B75E2832757F00B75C5D /* OversizedCrashReportScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F6B75C2832757F00B75C5D /* OversizedCrashReportScenario.swift */; }; 01F6B75F2832757F00B75C5D /* OversizedHandledErrorScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F6B75D2832757F00B75C5D /* OversizedHandledErrorScenario.swift */; }; 01FA9EC426D63BB20059FF4A /* AppHangInTerminationScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01FA9EC326D63BB20059FF4A /* AppHangInTerminationScenario.swift */; }; + 0915E1032CA57A44006B1815 /* FixtureConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 0915E1012CA57A44006B1815 /* FixtureConfig.m */; }; 095E095A2AF3BE8D00273F1F /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095E09592AF3BE8D00273F1F /* Logging.swift */; }; 095E095D2AF3BFDA00273F1F /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 095E095C2AF3BFDA00273F1F /* Logging.m */; }; 09F024FA2B9F3ACD007D9F73 /* Fixture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F024F92B9F3ACD007D9F73 /* Fixture.swift */; }; 09F024FC2B9F3B16007D9F73 /* MazeRunnerCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F024FB2B9F3B16007D9F73 /* MazeRunnerCommand.swift */; }; - 09F0250B2BA1E640007D9F73 /* FixtureConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F0250A2BA1E640007D9F73 /* FixtureConfig.swift */; }; 09F025172BAD7B04007D9F73 /* DelayedNotifyErrorScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F025162BAD7B04007D9F73 /* DelayedNotifyErrorScenario.swift */; }; 6526A0D4248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6526A0D3248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift */; }; 8A096DF627C7E56C00DB6ECC /* CxxUnexpectedScenario.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A096DF527C7E56C00DB6ECC /* CxxUnexpectedScenario.mm */; }; @@ -289,12 +289,15 @@ 01F6B75C2832757F00B75C5D /* OversizedCrashReportScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OversizedCrashReportScenario.swift; sourceTree = ""; }; 01F6B75D2832757F00B75C5D /* OversizedHandledErrorScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OversizedHandledErrorScenario.swift; sourceTree = ""; }; 01FA9EC326D63BB20059FF4A /* AppHangInTerminationScenario.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppHangInTerminationScenario.swift; sourceTree = ""; }; + 0915E0FF2CA57A34006B1815 /* Bridge_PublicAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Bridge_PublicAPI.h; path = ../Bridge_PublicAPI.h; sourceTree = ""; }; + 0915E1002CA57A34006B1815 /* Bridge_InternalAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Bridge_InternalAPI.h; path = ../Bridge_InternalAPI.h; sourceTree = ""; }; + 0915E1012CA57A44006B1815 /* FixtureConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FixtureConfig.m; sourceTree = ""; }; + 0915E1022CA57A44006B1815 /* FixtureConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FixtureConfig.h; sourceTree = ""; }; 095E09592AF3BE8D00273F1F /* Logging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = ""; }; 095E095B2AF3BFDA00273F1F /* Logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = ""; }; 095E095C2AF3BFDA00273F1F /* Logging.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Logging.m; sourceTree = ""; }; 09F024F92B9F3ACD007D9F73 /* Fixture.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fixture.swift; sourceTree = ""; }; 09F024FB2B9F3B16007D9F73 /* MazeRunnerCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MazeRunnerCommand.swift; sourceTree = ""; }; - 09F0250A2BA1E640007D9F73 /* FixtureConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FixtureConfig.swift; sourceTree = ""; }; 09F025162BAD7B04007D9F73 /* DelayedNotifyErrorScenario.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelayedNotifyErrorScenario.swift; sourceTree = ""; }; 6526A0D3248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadConfigFromFileAutoScenario.swift; sourceTree = ""; }; 8A096DF527C7E56C00DB6ECC /* CxxUnexpectedScenario.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CxxUnexpectedScenario.mm; sourceTree = ""; }; @@ -465,10 +468,13 @@ AA4C7F1329AEA060009B09A9 /* utils */ = { isa = PBXGroup; children = ( + 0915E1002CA57A34006B1815 /* Bridge_InternalAPI.h */, + 0915E0FF2CA57A34006B1815 /* Bridge_PublicAPI.h */, AA4C7F1429AEA0C4009B09A9 /* BugsnagWrapper.swift */, AA8BAEE22A4DD90E00A8BEA7 /* CommandReaderThread.swift */, 09F024F92B9F3ACD007D9F73 /* Fixture.swift */, - 09F0250A2BA1E640007D9F73 /* FixtureConfig.swift */, + 0915E1022CA57A44006B1815 /* FixtureConfig.h */, + 0915E1012CA57A44006B1815 /* FixtureConfig.m */, 095E095B2AF3BFDA00273F1F /* Logging.h */, 095E095C2AF3BFDA00273F1F /* Logging.m */, 095E09592AF3BE8D00273F1F /* Logging.swift */, @@ -879,6 +885,7 @@ E7A324EA247E9DA5008B0052 /* BreadcrumbCallbackOverrideScenario.swift in Sources */, F42955DB6D08642528917FAB /* CxxExceptionScenario.mm in Sources */, 017B4134276B8D9B0054C91D /* OnSendErrorPersistenceScenario.m in Sources */, + 0915E1032CA57A44006B1815 /* FixtureConfig.m in Sources */, 018F9B6528E57DBE00EAA02F /* AttemptDeliveryOnCrashScenario.swift in Sources */, 010BAB2D2833D0F20003FF36 /* DiscardClassesUnhandledExceptionScenario.swift in Sources */, 8A3B5F2B240807EE00CE4A3A /* ModifyBreadcrumbInNotifyScenario.swift in Sources */, @@ -903,7 +910,6 @@ A1117E552535A59100014FDA /* OOMLoadScenario.swift in Sources */, 8A840FBA21AF5C450041DBFA /* SwiftAssertionScenario.swift in Sources */, E753F24824927412001FB671 /* OnSendErrorCallbackCrashScenario.swift in Sources */, - 09F0250B2BA1E640007D9F73 /* FixtureConfig.swift in Sources */, 01847DD626453D4E00ADA4C7 /* InvalidCrashReportScenario.m in Sources */, 001E5502243B8FDA0009E31D /* AutoCaptureRunScenario.m in Sources */, 0104085F258CA0A100933C60 /* DispatchCrashScenario.swift in Sources */, @@ -1137,7 +1143,7 @@ STRIP_STYLE = all; STRIP_SWIFT_SYMBOLS = NO; SWIFT_INSTALL_OBJC_HEADER = YES; - SWIFT_OBJC_BRIDGING_HEADER = ../shared/scenarios/Scenario.h; + SWIFT_OBJC_BRIDGING_HEADER = ../shared/Bridge_InternalAPI.h; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = YES; SWIFT_VERSION = 4.2; @@ -1180,7 +1186,7 @@ STRIP_STYLE = all; STRIP_SWIFT_SYMBOLS = NO; SWIFT_INSTALL_OBJC_HEADER = YES; - SWIFT_OBJC_BRIDGING_HEADER = ../shared/scenarios/Scenario.h; + SWIFT_OBJC_BRIDGING_HEADER = ../shared/Bridge_InternalAPI.h; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = YES; SWIFT_VERSION = 4.2; diff --git a/features/fixtures/ios/iOSTestAppXcFramework.xcodeproj/project.pbxproj b/features/fixtures/ios/iOSTestAppXcFramework.xcodeproj/project.pbxproj index ad2cb567a..00c0caf67 100644 --- a/features/fixtures/ios/iOSTestAppXcFramework.xcodeproj/project.pbxproj +++ b/features/fixtures/ios/iOSTestAppXcFramework.xcodeproj/project.pbxproj @@ -85,11 +85,11 @@ 01F6B75E2832757F00B75C5D /* OversizedCrashReportScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F6B75C2832757F00B75C5D /* OversizedCrashReportScenario.swift */; }; 01F6B75F2832757F00B75C5D /* OversizedHandledErrorScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F6B75D2832757F00B75C5D /* OversizedHandledErrorScenario.swift */; }; 01FA9EC426D63BB20059FF4A /* AppHangInTerminationScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01FA9EC326D63BB20059FF4A /* AppHangInTerminationScenario.swift */; }; + 0915E1062CA57ABA006B1815 /* FixtureConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 0915E1042CA57ABA006B1815 /* FixtureConfig.m */; }; 095E095A2AF3BE8D00273F1F /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095E09592AF3BE8D00273F1F /* Logging.swift */; }; 095E095D2AF3BFDA00273F1F /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 095E095C2AF3BFDA00273F1F /* Logging.m */; }; 09F024FA2B9F3ACD007D9F73 /* Fixture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F024F92B9F3ACD007D9F73 /* Fixture.swift */; }; 09F024FC2B9F3B16007D9F73 /* MazeRunnerCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F024FB2B9F3B16007D9F73 /* MazeRunnerCommand.swift */; }; - 09F0250B2BA1E640007D9F73 /* FixtureConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F0250A2BA1E640007D9F73 /* FixtureConfig.swift */; }; 09F025172BAD7B04007D9F73 /* DelayedNotifyErrorScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F025162BAD7B04007D9F73 /* DelayedNotifyErrorScenario.swift */; }; 6526A0D4248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6526A0D3248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift */; }; 8A096DF627C7E56C00DB6ECC /* CxxUnexpectedScenario.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8A096DF527C7E56C00DB6ECC /* CxxUnexpectedScenario.mm */; }; @@ -304,12 +304,15 @@ 01F6B75C2832757F00B75C5D /* OversizedCrashReportScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OversizedCrashReportScenario.swift; sourceTree = ""; }; 01F6B75D2832757F00B75C5D /* OversizedHandledErrorScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OversizedHandledErrorScenario.swift; sourceTree = ""; }; 01FA9EC326D63BB20059FF4A /* AppHangInTerminationScenario.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppHangInTerminationScenario.swift; sourceTree = ""; }; + 0915E1042CA57ABA006B1815 /* FixtureConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = FixtureConfig.m; sourceTree = ""; }; + 0915E1052CA57ABA006B1815 /* FixtureConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FixtureConfig.h; sourceTree = ""; }; + 0915E1072CA57AC3006B1815 /* Bridge_PublicAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Bridge_PublicAPI.h; path = ../Bridge_PublicAPI.h; sourceTree = ""; }; + 0915E1082CA57AC3006B1815 /* Bridge_InternalAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Bridge_InternalAPI.h; path = ../Bridge_InternalAPI.h; sourceTree = ""; }; 095E09592AF3BE8D00273F1F /* Logging.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = ""; }; 095E095B2AF3BFDA00273F1F /* Logging.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = ""; }; 095E095C2AF3BFDA00273F1F /* Logging.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = Logging.m; sourceTree = ""; }; 09F024F92B9F3ACD007D9F73 /* Fixture.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Fixture.swift; sourceTree = ""; }; 09F024FB2B9F3B16007D9F73 /* MazeRunnerCommand.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MazeRunnerCommand.swift; sourceTree = ""; }; - 09F0250A2BA1E640007D9F73 /* FixtureConfig.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FixtureConfig.swift; sourceTree = ""; }; 09F025162BAD7B04007D9F73 /* DelayedNotifyErrorScenario.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DelayedNotifyErrorScenario.swift; sourceTree = ""; }; 6526A0D3248A83350002E2C9 /* LoadConfigFromFileAutoScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LoadConfigFromFileAutoScenario.swift; sourceTree = ""; }; 8A096DF527C7E56C00DB6ECC /* CxxUnexpectedScenario.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = CxxUnexpectedScenario.mm; sourceTree = ""; }; @@ -481,10 +484,13 @@ AA4C7F1329AEA060009B09A9 /* utils */ = { isa = PBXGroup; children = ( + 0915E1082CA57AC3006B1815 /* Bridge_InternalAPI.h */, + 0915E1072CA57AC3006B1815 /* Bridge_PublicAPI.h */, AA4C7F1429AEA0C4009B09A9 /* BugsnagWrapper.swift */, AA8BAEE22A4DD90E00A8BEA7 /* CommandReaderThread.swift */, 09F024F92B9F3ACD007D9F73 /* Fixture.swift */, - 09F0250A2BA1E640007D9F73 /* FixtureConfig.swift */, + 0915E1052CA57ABA006B1815 /* FixtureConfig.h */, + 0915E1042CA57ABA006B1815 /* FixtureConfig.m */, 095E095B2AF3BFDA00273F1F /* Logging.h */, 095E095C2AF3BFDA00273F1F /* Logging.m */, 095E09592AF3BE8D00273F1F /* Logging.swift */, @@ -883,6 +889,7 @@ 010BAB0B2833CE570003FF36 /* CxxExceptionOverrideScenario.mm in Sources */, 01DE903826CE99B800455213 /* CriticalThermalStateScenario.swift in Sources */, 01B6BBB625DA82B800FC4DE6 /* SendLaunchCrashesSynchronouslyScenario.swift in Sources */, + 0915E1062CA57ABA006B1815 /* FixtureConfig.m in Sources */, 095E095D2AF3BFDA00273F1F /* Logging.m in Sources */, F4295836C8AF75547C675E8D /* ReleasedObjectScenario.m in Sources */, 01E5EAD225B713990066EA8A /* OOMScenario.m in Sources */, @@ -921,7 +928,6 @@ A1117E552535A59100014FDA /* OOMLoadScenario.swift in Sources */, 8A840FBA21AF5C450041DBFA /* SwiftAssertionScenario.swift in Sources */, E753F24824927412001FB671 /* OnSendErrorCallbackCrashScenario.swift in Sources */, - 09F0250B2BA1E640007D9F73 /* FixtureConfig.swift in Sources */, 01847DD626453D4E00ADA4C7 /* InvalidCrashReportScenario.m in Sources */, 001E5502243B8FDA0009E31D /* AutoCaptureRunScenario.m in Sources */, 0104085F258CA0A100933C60 /* DispatchCrashScenario.swift in Sources */, @@ -1159,7 +1165,7 @@ STRIP_STYLE = all; STRIP_SWIFT_SYMBOLS = NO; SWIFT_INSTALL_OBJC_HEADER = YES; - SWIFT_OBJC_BRIDGING_HEADER = ../shared/scenarios/Scenario.h; + SWIFT_OBJC_BRIDGING_HEADER = ../shared/Bridge_InternalAPI.h; SWIFT_OBJC_INTERFACE_HEADER_NAME = "iOSTestApp-Swift.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = YES; @@ -1206,7 +1212,7 @@ STRIP_STYLE = all; STRIP_SWIFT_SYMBOLS = NO; SWIFT_INSTALL_OBJC_HEADER = YES; - SWIFT_OBJC_BRIDGING_HEADER = ../shared/scenarios/Scenario.h; + SWIFT_OBJC_BRIDGING_HEADER = ../shared/Bridge_InternalAPI.h; SWIFT_OBJC_INTERFACE_HEADER_NAME = "iOSTestApp-Swift.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_TREAT_WARNINGS_AS_ERRORS = YES; diff --git a/features/fixtures/macos/macOSTestApp.xcodeproj/project.pbxproj b/features/fixtures/macos/macOSTestApp.xcodeproj/project.pbxproj index 69aa80d41..e6a297aef 100644 --- a/features/fixtures/macos/macOSTestApp.xcodeproj/project.pbxproj +++ b/features/fixtures/macos/macOSTestApp.xcodeproj/project.pbxproj @@ -182,13 +182,13 @@ 01F6B74F2832381300B75C5D /* OversizedCrashReportScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F6B74B2832381300B75C5D /* OversizedCrashReportScenario.swift */; }; 01F7365A278D90440000113C /* NetworkBreadcrumbsScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01F73659278D90440000113C /* NetworkBreadcrumbsScenario.swift */; }; 01FA9EC626D64FFF0059FF4A /* AppHangInTerminationScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01FA9EC526D64FFF0059FF4A /* AppHangInTerminationScenario.swift */; }; + 0915E0FA2CA57647006B1815 /* FixtureConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 0915E0F92CA57647006B1815 /* FixtureConfig.m */; }; 095E095F2AF3C98F00273F1F /* Logging.swift in Sources */ = {isa = PBXBuildFile; fileRef = 095E095E2AF3C98F00273F1F /* Logging.swift */; }; 095E09622AF3C9A500273F1F /* Logging.m in Sources */ = {isa = PBXBuildFile; fileRef = 095E09612AF3C9A500273F1F /* Logging.m */; }; 09E045582C89A334003882D3 /* Bugsnag.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09E045572C89A334003882D3 /* Bugsnag.framework */; }; 09E045592C89A334003882D3 /* Bugsnag.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 09E045572C89A334003882D3 /* Bugsnag.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; 09E0455C2C89A33B003882D3 /* BugsnagNetworkRequestPlugin.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 09E0455B2C89A33B003882D3 /* BugsnagNetworkRequestPlugin.framework */; }; 09E0455D2C89A33B003882D3 /* BugsnagNetworkRequestPlugin.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 09E0455B2C89A33B003882D3 /* BugsnagNetworkRequestPlugin.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - 09F0250E2BA301FD007D9F73 /* FixtureConfig.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F0250C2BA301FD007D9F73 /* FixtureConfig.swift */; }; 09F0250F2BA301FD007D9F73 /* Fixture.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F0250D2BA301FD007D9F73 /* Fixture.swift */; }; 09F025112BA30225007D9F73 /* MazeRunnerCommand.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F025102BA30225007D9F73 /* MazeRunnerCommand.swift */; }; 09F025132BA30240007D9F73 /* CommandReaderThread.swift in Sources */ = {isa = PBXBuildFile; fileRef = 09F025122BA30240007D9F73 /* CommandReaderThread.swift */; }; @@ -399,6 +399,10 @@ 01F6B74B2832381300B75C5D /* OversizedCrashReportScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OversizedCrashReportScenario.swift; sourceTree = ""; }; 01F73659278D90440000113C /* NetworkBreadcrumbsScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkBreadcrumbsScenario.swift; sourceTree = ""; }; 01FA9EC526D64FFF0059FF4A /* AppHangInTerminationScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppHangInTerminationScenario.swift; sourceTree = ""; }; + 0915E0F82CA57647006B1815 /* FixtureConfig.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FixtureConfig.h; sourceTree = ""; }; + 0915E0F92CA57647006B1815 /* FixtureConfig.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FixtureConfig.m; sourceTree = ""; }; + 0915E0FD2CA57849006B1815 /* Bridge_InternalAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Bridge_InternalAPI.h; path = ../Bridge_InternalAPI.h; sourceTree = ""; }; + 0915E0FE2CA5785A006B1815 /* Bridge_PublicAPI.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = Bridge_PublicAPI.h; path = ../Bridge_PublicAPI.h; sourceTree = ""; }; 095E095E2AF3C98F00273F1F /* Logging.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Logging.swift; sourceTree = ""; }; 095E09602AF3C9A500273F1F /* Logging.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Logging.h; sourceTree = ""; }; 095E09612AF3C9A500273F1F /* Logging.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = Logging.m; sourceTree = ""; }; @@ -406,7 +410,6 @@ 09E045542C89A230003882D3 /* BugsnagNetworkRequestPlugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = BugsnagNetworkRequestPlugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 09E045572C89A334003882D3 /* Bugsnag.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = Bugsnag.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 09E0455B2C89A33B003882D3 /* BugsnagNetworkRequestPlugin.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; path = BugsnagNetworkRequestPlugin.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 09F0250C2BA301FD007D9F73 /* FixtureConfig.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FixtureConfig.swift; sourceTree = ""; }; 09F0250D2BA301FD007D9F73 /* Fixture.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Fixture.swift; sourceTree = ""; }; 09F025102BA30225007D9F73 /* MazeRunnerCommand.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MazeRunnerCommand.swift; sourceTree = ""; }; 09F025122BA30240007D9F73 /* CommandReaderThread.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandReaderThread.swift; sourceTree = ""; }; @@ -670,10 +673,13 @@ AA4C7F1629AEA1F2009B09A9 /* utils */ = { isa = PBXGroup; children = ( + 0915E0FD2CA57849006B1815 /* Bridge_InternalAPI.h */, + 0915E0FE2CA5785A006B1815 /* Bridge_PublicAPI.h */, AA4C7F1729AEA31D009B09A9 /* BugsnagWrapper.swift */, 09F025122BA30240007D9F73 /* CommandReaderThread.swift */, 09F0250D2BA301FD007D9F73 /* Fixture.swift */, - 09F0250C2BA301FD007D9F73 /* FixtureConfig.swift */, + 0915E0F82CA57647006B1815 /* FixtureConfig.h */, + 0915E0F92CA57647006B1815 /* FixtureConfig.m */, 095E09602AF3C9A500273F1F /* Logging.h */, 095E09612AF3C9A500273F1F /* Logging.m */, 095E095E2AF3C98F00273F1F /* Logging.swift */, @@ -767,7 +773,6 @@ 01F47D31254B1B3100B184AD /* OverwriteLinkRegisterScenario.m in Sources */, 01F47D08254B1B3100B184AD /* AutoSessionCustomVersionScenario.m in Sources */, 01F47CC6254B1B3100B184AD /* HandledExceptionScenario.swift in Sources */, - 09F0250E2BA301FD007D9F73 /* FixtureConfig.swift in Sources */, 01F47D0D254B1B3100B184AD /* LoadConfigFromFileScenario.swift in Sources */, 095E09622AF3C9A500273F1F /* Logging.m in Sources */, 01F47CF5254B1B3100B184AD /* StoppedSessionScenario.swift in Sources */, @@ -820,6 +825,7 @@ 01F47CD3254B1B3100B184AD /* EnabledBreadcrumbTypesIsNilScenario.swift in Sources */, 01F47CC4254B1B3100B184AD /* OriginalErrorNSExceptionScenario.swift in Sources */, 01F47D0C254B1B3100B184AD /* UserEventOverrideScenario.swift in Sources */, + 0915E0FA2CA57647006B1815 /* FixtureConfig.m in Sources */, 01F47CD6254B1B3100B184AD /* SIGILLScenario.m in Sources */, 01F47D32254B1B3100B184AD /* ResumeSessionOOMScenario.m in Sources */, 010BAB722833D34A0003FF36 /* BareboneTestHandledScenario.swift in Sources */, @@ -1087,7 +1093,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; STRIP_SWIFT_SYMBOLS = NO; - SWIFT_OBJC_BRIDGING_HEADER = ../shared/scenarios/Scenario.h; + SWIFT_OBJC_BRIDGING_HEADER = ../shared/Bridge_InternalAPI.h; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 4.2; }; @@ -1112,7 +1118,7 @@ PRODUCT_NAME = "$(TARGET_NAME)"; STRIP_INSTALLED_PRODUCT = NO; STRIP_SWIFT_SYMBOLS = NO; - SWIFT_OBJC_BRIDGING_HEADER = ../shared/scenarios/Scenario.h; + SWIFT_OBJC_BRIDGING_HEADER = ../shared/Bridge_InternalAPI.h; SWIFT_VERSION = 4.2; }; name = Release; diff --git a/features/fixtures/shared/Bridge_InternalAPI.h b/features/fixtures/shared/Bridge_InternalAPI.h new file mode 100644 index 000000000..0b4945419 --- /dev/null +++ b/features/fixtures/shared/Bridge_InternalAPI.h @@ -0,0 +1,10 @@ +// +// Bridge_InternalAPI.h +// macOSTestApp +// +// Created by Karl Stenerud on 26.09.24. +// Copyright © 2024 Bugsnag Inc. All rights reserved. +// + +#import "Bridge_PublicAPI.h" +#import "BugsnagInternals.h" diff --git a/features/fixtures/shared/Bridge_PublicAPI.h b/features/fixtures/shared/Bridge_PublicAPI.h new file mode 100644 index 000000000..7783b826d --- /dev/null +++ b/features/fixtures/shared/Bridge_PublicAPI.h @@ -0,0 +1,9 @@ +// +// Bridge_PublicAPI.h +// macOSTestApp +// +// Created by Karl Stenerud on 26.09.24. +// Copyright © 2024 Bugsnag Inc. All rights reserved. +// + +#import "Scenario.h" diff --git a/features/fixtures/shared/scenarios/CustomPluginNotifierDescriptionScenario.m b/features/fixtures/shared/scenarios/CustomPluginNotifierDescriptionScenario.m index a859006e0..0330670b8 100644 --- a/features/fixtures/shared/scenarios/CustomPluginNotifierDescriptionScenario.m +++ b/features/fixtures/shared/scenarios/CustomPluginNotifierDescriptionScenario.m @@ -1,5 +1,6 @@ #import "Scenario.h" #import "Logging.h" +#import "Bridge_InternalAPI.h" @interface CustomPluginNotifierDescriptionScenario : Scenario @end diff --git a/features/fixtures/shared/scenarios/Scenario.h b/features/fixtures/shared/scenarios/Scenario.h index 5045fd21e..ddbc6053e 100644 --- a/features/fixtures/shared/scenarios/Scenario.h +++ b/features/fixtures/shared/scenarios/Scenario.h @@ -5,7 +5,7 @@ #import #import -#import "BugsnagInternals.h" +#import "FixtureConfig.h" NS_ASSUME_NONNULL_BEGIN @@ -13,8 +13,6 @@ void logInternal(const char* level, NSString *format, va_list args); void markErrorHandledCallback(const BSG_KSCrashReportWriter *writer); -@class FixtureConfig; - @interface Scenario : NSObject @property (strong, nonatomic, nonnull) FixtureConfig *fixtureConfig; diff --git a/features/fixtures/shared/utils/FixtureConfig.h b/features/fixtures/shared/utils/FixtureConfig.h new file mode 100644 index 000000000..7e91643ff --- /dev/null +++ b/features/fixtures/shared/utils/FixtureConfig.h @@ -0,0 +1,31 @@ +// +// FixtureConfig.h +// macOSTestApp +// +// Created by Karl Stenerud on 26.09.24. +// Copyright © 2024 Bugsnag Inc. All rights reserved. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface FixtureConfig : NSObject + +@property NSString *apiKey; +@property NSURL *mazeRunnerURL; +@property NSURL *docsURL; +@property NSURL *tracesURL; +@property NSURL *commandURL; +@property NSURL *metricsURL; +@property NSURL *reflectURL; +@property NSURL *notifyURL; +@property NSURL *sessionsURL; + +//init(apiKey: String, mazeRunnerBaseAddress: URL) { + +- (instancetype) initWithApiKey:(NSString *)apiKey mazeRunnerBaseAddress:(NSURL *)mazeRunnerBaseAddress; + +@end + +NS_ASSUME_NONNULL_END diff --git a/features/fixtures/shared/utils/FixtureConfig.m b/features/fixtures/shared/utils/FixtureConfig.m new file mode 100644 index 000000000..1a784f6b4 --- /dev/null +++ b/features/fixtures/shared/utils/FixtureConfig.m @@ -0,0 +1,28 @@ +// +// FixtureConfig.m +// macOSTestApp +// +// Created by Karl Stenerud on 26.09.24. +// Copyright © 2024 Bugsnag Inc. All rights reserved. +// + +#import "FixtureConfig.h" + +@implementation FixtureConfig + +- (instancetype) initWithApiKey:(NSString *)apiKey mazeRunnerBaseAddress:(NSURL *)mazeRunnerBaseAddress { + if ((self = [super init])) { + _apiKey = apiKey; + _mazeRunnerURL = mazeRunnerBaseAddress; + _docsURL = [mazeRunnerBaseAddress URLByAppendingPathComponent:@"docs"]; + _tracesURL = [mazeRunnerBaseAddress URLByAppendingPathComponent:@"traces"]; + _commandURL = [mazeRunnerBaseAddress URLByAppendingPathComponent:@"command"]; + _metricsURL = [mazeRunnerBaseAddress URLByAppendingPathComponent:@"metrics"]; + _notifyURL = [mazeRunnerBaseAddress URLByAppendingPathComponent:@"notify"]; + _sessionsURL = [mazeRunnerBaseAddress URLByAppendingPathComponent:@"sessions"]; + _reflectURL = [mazeRunnerBaseAddress URLByAppendingPathComponent:@"reflect"]; + } + return self; +} + +@end diff --git a/features/fixtures/shared/utils/FixtureConfig.swift b/features/fixtures/shared/utils/FixtureConfig.swift deleted file mode 100644 index 825c5d082..000000000 --- a/features/fixtures/shared/utils/FixtureConfig.swift +++ /dev/null @@ -1,33 +0,0 @@ -// -// FixtureConfig.swift -// iOSTestApp -// -// Created by Karl Stenerud on 11.03.24. -// Copyright © 2024 Bugsnag. All rights reserved. -// - -import Foundation - -@objcMembers class FixtureConfig: NSObject { - var apiKey: String - let mazeRunnerURL: URL - let docsURL: URL - let tracesURL: URL - let commandURL: URL - let metricsURL: URL - let reflectURL: URL - var notifyURL: URL - var sessionsURL: URL - - init(apiKey: String, mazeRunnerBaseAddress: URL) { - self.apiKey = apiKey - mazeRunnerURL = mazeRunnerBaseAddress - docsURL = mazeRunnerBaseAddress.appendingPathComponent("docs") - tracesURL = mazeRunnerBaseAddress.appendingPathComponent("traces") - commandURL = mazeRunnerBaseAddress.appendingPathComponent("command") - metricsURL = mazeRunnerBaseAddress.appendingPathComponent("metrics") - notifyURL = mazeRunnerBaseAddress.appendingPathComponent("notify") - sessionsURL = mazeRunnerBaseAddress.appendingPathComponent("sessions") - reflectURL = mazeRunnerBaseAddress.appendingPathComponent("reflect") - } -} diff --git a/features/fixtures/watchos/watchOSTestApp.xcodeproj/project.pbxproj b/features/fixtures/watchos/watchOSTestApp.xcodeproj/project.pbxproj index 6898ff83d..c39c863c2 100644 --- a/features/fixtures/watchos/watchOSTestApp.xcodeproj/project.pbxproj +++ b/features/fixtures/watchos/watchOSTestApp.xcodeproj/project.pbxproj @@ -21,6 +21,7 @@ 01515B1D28508DBB00E498EC /* ExtensionDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 01515B1B28508DBB00E498EC /* ExtensionDelegate.swift */; }; 018F050D284F314D004EA50D /* HandledExceptionScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 018F050C284F314D004EA50D /* HandledExceptionScenario.swift */; }; 018F050F284F3155004EA50D /* NetworkBreadcrumbsScenario.swift in Sources */ = {isa = PBXBuildFile; fileRef = 018F050E284F3155004EA50D /* NetworkBreadcrumbsScenario.swift */; }; + 0915E10B2CA57B4F006B1815 /* FixtureConfig.m in Sources */ = {isa = PBXBuildFile; fileRef = 0915E1092CA57B4F006B1815 /* FixtureConfig.m */; }; C1AD3C358BC309F832CCC972 /* Pods_watchOSTestApp_WatchKit_Extension.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5B2DE4764F62DB21DAE7435C /* Pods_watchOSTestApp_WatchKit_Extension.framework */; }; /* End PBXBuildFile section */ @@ -84,6 +85,8 @@ 01515B1B28508DBB00E498EC /* ExtensionDelegate.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ExtensionDelegate.swift; sourceTree = ""; }; 018F050C284F314D004EA50D /* HandledExceptionScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = HandledExceptionScenario.swift; sourceTree = ""; }; 018F050E284F3155004EA50D /* NetworkBreadcrumbsScenario.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = NetworkBreadcrumbsScenario.swift; sourceTree = ""; }; + 0915E1092CA57B4F006B1815 /* FixtureConfig.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = FixtureConfig.m; path = ../utils/FixtureConfig.m; sourceTree = ""; }; + 0915E10A2CA57B4F006B1815 /* FixtureConfig.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FixtureConfig.h; path = ../utils/FixtureConfig.h; sourceTree = ""; }; 5B2DE4764F62DB21DAE7435C /* Pods_watchOSTestApp_WatchKit_Extension.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_watchOSTestApp_WatchKit_Extension.framework; sourceTree = BUILT_PRODUCTS_DIR; }; C7F2423F2C2AA215837EC98D /* Pods-watchOSTestApp WatchKit Extension.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-watchOSTestApp WatchKit Extension.release.xcconfig"; path = "Target Support Files/Pods-watchOSTestApp WatchKit Extension/Pods-watchOSTestApp WatchKit Extension.release.xcconfig"; sourceTree = ""; }; F7B7E9CC24320877BE6D3B95 /* Pods-watchOSTestApp WatchKit Extension.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-watchOSTestApp WatchKit Extension.debug.xcconfig"; path = "Target Support Files/Pods-watchOSTestApp WatchKit Extension/Pods-watchOSTestApp WatchKit Extension.debug.xcconfig"; sourceTree = ""; }; @@ -158,6 +161,8 @@ children = ( 01479BA72847923A00E53BB9 /* BareboneTestHandledScenario.swift */, 01479BA9284792B100E53BB9 /* BareboneTestUnhandledErrorScenario.swift */, + 0915E10A2CA57B4F006B1815 /* FixtureConfig.h */, + 0915E1092CA57B4F006B1815 /* FixtureConfig.m */, 018F050C284F314D004EA50D /* HandledExceptionScenario.swift */, 018F050E284F3155004EA50D /* NetworkBreadcrumbsScenario.swift */, 01479A46284779A400E53BB9 /* Scenario.h */, @@ -357,6 +362,7 @@ buildActionMask = 2147483647; files = ( 01479BAA284792B100E53BB9 /* BareboneTestUnhandledErrorScenario.swift in Sources */, + 0915E10B2CA57B4F006B1815 /* FixtureConfig.m in Sources */, 018F050D284F314D004EA50D /* HandledExceptionScenario.swift in Sources */, 01515B1D28508DBB00E498EC /* ExtensionDelegate.swift in Sources */, 01479A2F2847775600E53BB9 /* ComplicationController.swift in Sources */,