From 91282722f6207d34b9478b572e6b5cbe0472170f Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 2 Jul 2024 11:16:25 -0800 Subject: [PATCH] patch provided from dropbox that fixes the remaining issues --- Sentry.xcodeproj/project.pbxproj | 32 ++------ Sources/Configuration/Sentry.xcconfig | 4 + .../Resources/SentryWithoutUIKit.modulemap | 2 +- Sources/Sentry/Public/Sentry.h | 81 ++++++++++--------- Sources/Sentry/Public/SentryWithoutUIKit.h | 49 +++++++++++ Sources/Sentry/include/SentrySwift.h | 14 +++- Sources/Sentry/include/module.modulemap | 2 +- 7 files changed, 114 insertions(+), 70 deletions(-) create mode 100644 Sources/Sentry/Public/SentryWithoutUIKit.h diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index a454dce8018..a369d3504ef 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -72,6 +72,8 @@ 15E0A8F22411A45A00F044E3 /* SentrySession.m in Sources */ = {isa = PBXBuildFile; fileRef = 15E0A8F12411A45A00F044E3 /* SentrySession.m */; }; 33042A0D29DAF79A00C60085 /* SentryExtraContextProvider.m in Sources */ = {isa = PBXBuildFile; fileRef = 33042A0C29DAF79A00C60085 /* SentryExtraContextProvider.m */; }; 33042A1729DC2C4300C60085 /* SentryExtraContextProviderTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 33042A1629DC2C4300C60085 /* SentryExtraContextProviderTests.swift */; }; + 33EB2A912C3412E4004FED3D /* SentryWithoutUIKit.h in Headers */ = {isa = PBXBuildFile; fileRef = 33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */; settings = {ATTRIBUTES = (Public, ); }; }; + 33EB2A922C341300004FED3D /* Sentry.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76931EB9C1C200D153DE /* Sentry.h */; settings = {ATTRIBUTES = (Public, ); }; }; 51B15F7E2BE88A7C0026A2F2 /* URLSessionTaskHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51B15F7D2BE88A7C0026A2F2 /* URLSessionTaskHelper.swift */; }; 51B15F802BE88D510026A2F2 /* URLSessionTaskHelperTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51B15F7F2BE88D510026A2F2 /* URLSessionTaskHelperTests.swift */; }; 620379DB2AFE1415005AC0C1 /* SentryBuildAppStartSpans.h in Headers */ = {isa = PBXBuildFile; fileRef = 620379DA2AFE1415005AC0C1 /* SentryBuildAppStartSpans.h */; }; @@ -188,7 +190,6 @@ 63AA766A1EB8CB2F00D153DE /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63AA759B1EB8AEF500D153DE /* Sentry.framework */; settings = {ATTRIBUTES = (Required, ); }; }; 63AA76701EB8CB4B00D153DE /* SentryTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 63AA75951EB8AEDB00D153DE /* SentryTests.m */; }; 63AA767A1EB8D20500D153DE /* SentryLog.m in Sources */ = {isa = PBXBuildFile; fileRef = 63AA76781EB8D20500D153DE /* SentryLog.m */; }; - 63AA76971EB9C1C200D153DE /* Sentry.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76931EB9C1C200D153DE /* Sentry.h */; settings = {ATTRIBUTES = (Public, ); }; }; 63AA76981EB9C1C200D153DE /* SentryClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76941EB9C1C200D153DE /* SentryClient.h */; settings = {ATTRIBUTES = (Public, ); }; }; 63AA76991EB9C1C200D153DE /* SentryDefines.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76951EB9C1C200D153DE /* SentryDefines.h */; settings = {ATTRIBUTES = (Public, ); }; }; 63AA769A1EB9C1C200D153DE /* SentryLog.h in Headers */ = {isa = PBXBuildFile; fileRef = 63AA76961EB9C1C200D153DE /* SentryLog.h */; settings = {ATTRIBUTES = (Private, ); }; }; @@ -1049,6 +1050,7 @@ 33042A0B29DAF5F400C60085 /* SentryExtraContextProvider.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = SentryExtraContextProvider.h; sourceTree = ""; }; 33042A0C29DAF79A00C60085 /* SentryExtraContextProvider.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = SentryExtraContextProvider.m; sourceTree = ""; }; 33042A1629DC2C4300C60085 /* SentryExtraContextProviderTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryExtraContextProviderTests.swift; sourceTree = ""; }; + 33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryWithoutUIKit.h; path = Public/SentryWithoutUIKit.h; sourceTree = ""; }; 51B15F7D2BE88A7C0026A2F2 /* URLSessionTaskHelper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = URLSessionTaskHelper.swift; sourceTree = ""; }; 51B15F7F2BE88D510026A2F2 /* URLSessionTaskHelperTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = URLSessionTaskHelperTests.swift; sourceTree = ""; }; 620379DA2AFE1415005AC0C1 /* SentryBuildAppStartSpans.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryBuildAppStartSpans.h; path = include/SentryBuildAppStartSpans.h; sourceTree = ""; }; @@ -2560,6 +2562,7 @@ 8ECC673625C23936000E2BF6 /* Transaction */, 8E25C94F25F836AB00DC215B /* Tools */, 63AA76931EB9C1C200D153DE /* Sentry.h */, + 33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */, D8B665BA2B95F54200BD0E7B /* SentryPrivate.h */, D8BBD32628FD9FBF0011F850 /* SentrySwift.h */, D81A346B291AECC7005A27A9 /* PrivateSentrySDKOnly.h */, @@ -3952,6 +3955,7 @@ 63FE70CD20DA4C1000CDBAE8 /* SentryCrashDoctor.h in Headers */, D8C67E9B28000E24007E326E /* SentryUIApplication.h in Headers */, 7B6438AA26A70F24000D0F65 /* UIViewController+Sentry.h in Headers */, + 33EB2A912C3412E4004FED3D /* SentryWithoutUIKit.h in Headers */, 639FCFAC1EBC811400778193 /* SentryUser.h in Headers */, D8CB74192947285A00A5F964 /* SentryEnvelopeItemHeader.h in Headers */, 7D7F0A5F23DF3D2C00A4629C /* SentryGlobalEventProcessor.h in Headers */, @@ -4025,7 +4029,6 @@ 844EDC6F294143B900C86F34 /* SentryNSProcessInfoWrapper.h in Headers */, D8479328278873A100BE8E99 /* SentryByteCountFormatter.h in Headers */, 63AA76981EB9C1C200D153DE /* SentryClient.h in Headers */, - 63AA76971EB9C1C200D153DE /* Sentry.h in Headers */, 0A9E917128DC7E7000FB4182 /* SentryInternalCDefines.h in Headers */, 63FE711F20DA4C1000CDBAE8 /* SentryCrashObjC.h in Headers */, 7BC3936825B1AB3E004F03D3 /* SentryLevelMapper.h in Headers */, @@ -4034,6 +4037,7 @@ D8ACE3CE2762187D00F5A213 /* SentryNSDataTracker.h in Headers */, 03F84D2427DD414C008FE43F /* SentryCompiler.h in Headers */, 631E6D331EBC679C00712345 /* SentryQueueableRequestManager.h in Headers */, + 33EB2A922C341300004FED3D /* Sentry.h in Headers */, 7B3398632459C14000BD9C96 /* SentryEnvelopeRateLimit.h in Headers */, 6304360A1EC0595B00C4D3FA /* SentryNSDataUtils.h in Headers */, 7BF9EF7C2722B90E00B5BBEF /* SentryDefaultObjCRuntimeWrapper.h in Headers */, @@ -5271,15 +5275,11 @@ "$(inherited)", ); GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; @@ -5308,7 +5308,6 @@ GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = s; GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -5318,10 +5317,7 @@ ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; }; @@ -5486,7 +5482,6 @@ "TESTCI=1", ); GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -5496,10 +5491,7 @@ ); ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; @@ -5627,7 +5619,6 @@ "$(inherited)", ); GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -5637,10 +5628,7 @@ ); ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; @@ -6115,7 +6103,6 @@ GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = s; GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -6125,10 +6112,7 @@ ); ONLY_ACTIVE_ARCH = NO; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; }; @@ -6355,7 +6339,6 @@ GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; GCC_WARN_SHADOW = YES; - HEADER_SEARCH_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_DYLIB_INSTALL_NAME = "$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(EXECUTABLE_PATH)"; LD_RUNPATH_SEARCH_PATHS = ( @@ -6365,10 +6348,7 @@ ); ONLY_ACTIVE_ARCH = YES; OTHER_CFLAGS = "-DCARTHAGE_$(CARTHAGE)"; - PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry; - PRODUCT_NAME = Sentry; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_INCLUDE_PATHS = "$(SRCROOT)/Sources/Sentry/include/**"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; USE_HEADERMAP = YES; diff --git a/Sources/Configuration/Sentry.xcconfig b/Sources/Configuration/Sentry.xcconfig index 8710bc4e098..b50393e59cb 100644 --- a/Sources/Configuration/Sentry.xcconfig +++ b/Sources/Configuration/Sentry.xcconfig @@ -5,6 +5,10 @@ INFOPLIST_FILE = Sources/Resources/Info.plist SENTRY_MODULE_NAME = Sentry SENTRY_WITHOUT_UIKIT_MODULE_NAME = SentryWithoutUIKit +// This config is required so the test code can access the SentryPrivate module. Removing this setting +// leads to an error: no such module '_SentryPrivate' when including the XCFramework with Carthage +HEADER_SEARCH_PATHS = $(SRCROOT)/Sources/Sentry/include/** + PRODUCT_MODULE_NAME_Debug = $(SENTRY_MODULE_NAME) PRODUCT_MODULE_NAME_DebugWithoutUIKit = $(SENTRY_WITHOUT_UIKIT_MODULE_NAME) PRODUCT_MODULE_NAME_Test = $(SENTRY_MODULE_NAME) diff --git a/Sources/Resources/SentryWithoutUIKit.modulemap b/Sources/Resources/SentryWithoutUIKit.modulemap index e929e43db69..bde8eab8097 100644 --- a/Sources/Resources/SentryWithoutUIKit.modulemap +++ b/Sources/Resources/SentryWithoutUIKit.modulemap @@ -1,5 +1,5 @@ framework module SentryWithoutUIKit { - umbrella header "Sentry.h" + umbrella header "SentryWithoutUIKit.h" export * module * { export * } diff --git a/Sources/Sentry/Public/Sentry.h b/Sources/Sentry/Public/Sentry.h index a42b8f0e23c..713de13d331 100644 --- a/Sources/Sentry/Public/Sentry.h +++ b/Sources/Sentry/Public/Sentry.h @@ -1,4 +1,5 @@ -#import +#ifndef SENTRY_NO_UIKIT +# import //! Project version number for Sentry. FOUNDATION_EXPORT double SentryVersionNumber; @@ -6,41 +7,43 @@ FOUNDATION_EXPORT double SentryVersionNumber; //! Project version string for Sentry. FOUNDATION_EXPORT const unsigned char SentryVersionString[]; -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import -#import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +#endif diff --git a/Sources/Sentry/Public/SentryWithoutUIKit.h b/Sources/Sentry/Public/SentryWithoutUIKit.h new file mode 100644 index 00000000000..4e0870a9c3a --- /dev/null +++ b/Sources/Sentry/Public/SentryWithoutUIKit.h @@ -0,0 +1,49 @@ +#ifdef SENTRY_NO_UIKIT +# import + +//! Project version number for Sentry. +FOUNDATION_EXPORT double SentryVersionNumber; + +//! Project version string for Sentry. +FOUNDATION_EXPORT const unsigned char SentryVersionString[]; + +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +# import +#endif diff --git a/Sources/Sentry/include/SentrySwift.h b/Sources/Sentry/include/SentrySwift.h index 861a37090c8..f1138539bac 100644 --- a/Sources/Sentry/include/SentrySwift.h +++ b/Sources/Sentry/include/SentrySwift.h @@ -7,10 +7,18 @@ # endif #endif -#if __has_include("Sentry-Swift.h") -# import "Sentry-Swift.h" +#ifdef SENTRY_NO_UIKIT +# if __has_include("SentryWithoutUIKit-Swift.h") +# import "SentryWithoutUIKit-Swift.h" +# else +# import +# endif #else -# import +# if __has_include("Sentry-Swift.h") +# import "Sentry-Swift.h" +# else +# import +# endif #endif #endif diff --git a/Sources/Sentry/include/module.modulemap b/Sources/Sentry/include/module.modulemap index c6122cfb169..2ddf3ca7c91 100644 --- a/Sources/Sentry/include/module.modulemap +++ b/Sources/Sentry/include/module.modulemap @@ -1,3 +1,3 @@ -module _SentryWithoutUIKitPrivate { +module _SentryPrivate { header "SentryPrivate.h" }