From 5230990fecb6a86acad1924772c5d770e9e50bd5 Mon Sep 17 00:00:00 2001 From: Andrew McKnight Date: Tue, 9 Jul 2024 11:15:22 -0800 Subject: [PATCH] fix: define separate module names for UIKitless configurations (#4140) --- .github/workflows/build.yml | 32 ++-- CHANGELOG.md | 1 + Sentry.xcodeproj/project.pbxproj | 165 ++++++------------ Sources/Configuration/SDK.xcconfig | 14 +- Sources/Configuration/Sentry.xcconfig | 20 ++- Sources/Configuration/SentrySwiftUI.xcconfig | 8 + ...mentTargets.xcconfig => Versions.xcconfig} | 2 + .../Resources/SentryWithoutUIKit.modulemap | 6 + Sources/Sentry/Public/Sentry.h | 81 ++++----- Sources/Sentry/Public/SentryOptions.h | 12 +- Sources/Sentry/Public/SentryWithoutUIKit.h | 49 ++++++ .../HybridPublic/PrivateSentrySDKOnly.h | 10 +- .../HybridPublic/SentryAppStartMeasurement.h | 2 +- .../include/HybridPublic/SentryScreenFrames.h | 2 +- Sources/Sentry/include/SentrySwift.h | 18 +- Sources/SentrySwiftUI/SentryTracedView.swift | 4 + .../SentryReplayVideoMaker.swift | 2 +- Tests/Configuration/SentryTests.xcconfig | 8 +- develop-docs/README.md | 2 +- scripts/build-xcframework.sh | 33 ++-- scripts/check-uikit-linkage.sh | 8 +- 21 files changed, 263 insertions(+), 216 deletions(-) rename Sources/Configuration/{DeploymentTargets.xcconfig => Versions.xcconfig} (82%) create mode 100644 Sources/Resources/SentryWithoutUIKit.modulemap create mode 100644 Sources/Sentry/Public/SentryWithoutUIKit.h diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4589ad56069..12fee23456b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -213,42 +213,42 @@ jobs: - run: swift build shell: sh - check-uikit-linkage-debug-UIKitless: - name: Check no UIKit linkage (Debug_without_UIKit) + check-debug-without-UIKit: + name: Check no UIKit linkage (DebugWithoutUIKit) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Debug - run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Debug_without_UIKit uikit-check-build - - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh Debug_without_UIKit uikit-check-build unlinked + run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" DebugWithoutUIKit uikit-check-build + - name: Ensure UIKit is not linked + run: ./scripts/check-uikit-linkage.sh DebugWithoutUIKit uikit-check-build unlinked SentryWithoutUIKit - check-uikit-linkage-release-UIKitless: - name: Check no UIKit linkage (Release_without_UIKit) + check-release-without-UIKit: + name: Check no UIKit linkage (ReleaseWithoutUIKit) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Release - run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Release_without_UIKit uikit-check-build - - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh Release_without_UIKit uikit-check-build unlinked + run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" ReleaseWithoutUIKit uikit-check-build + - name: Ensure UIKit is not linked + run: ./scripts/check-uikit-linkage.sh ReleaseWithoutUIKit uikit-check-build unlinked SentryWithoutUIKit - check-uikit-linkage-debug: + check-debug-with-UIKit: name: Check UIKit linkage (Debug) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Debug run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Debug uikit-check-build - - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh Debug uikit-check-build linked + - name: Ensure UIKit is linked + run: ./scripts/check-uikit-linkage.sh Debug uikit-check-build linked Sentry - check-uikit-linkage-release: + check-release-with-UIKit: name: Check UIKit linkage (Release) runs-on: macos-13 steps: - uses: actions/checkout@v4 - name: Build for Release run: ./scripts/xcode-test.sh "iOS" "latest" $GITHUB_REF_NAME ci build "iPhone 14" Release uikit-check-build - - name: Ensure no UIKit - run: ./scripts/check-uikit-linkage.sh Release uikit-check-build linked + - name: Ensure UIKit is linked + run: ./scripts/check-uikit-linkage.sh Release uikit-check-build linked Sentry diff --git a/CHANGELOG.md b/CHANGELOG.md index 5864a914e07..0ba0db1e2c1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ ### Fixes +- UIKitless configurations now produce a module with a different name (#4140) - Sentry Replay Serialized Breadcrumbs include level name ([#4141](https://github.com/getsentry/sentry-cocoa/pull/4141)) ## 8.30.0 diff --git a/Sentry.xcodeproj/project.pbxproj b/Sentry.xcodeproj/project.pbxproj index 803c1afd7f2..f4c39e0fc5d 100644 --- a/Sentry.xcodeproj/project.pbxproj +++ b/Sentry.xcodeproj/project.pbxproj @@ -69,6 +69,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 */; }; @@ -185,7 +187,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, ); }; }; @@ -796,7 +797,6 @@ D8199DBF29376EE20074249E /* SentryInternal.m in Sources */ = {isa = PBXBuildFile; fileRef = D8199DB929376ECC0074249E /* SentryInternal.m */; }; D8199DC029376EE80074249E /* SentrySwiftUI.h in Headers */ = {isa = PBXBuildFile; fileRef = D8199DB529376ECC0074249E /* SentrySwiftUI.h */; }; D8199DC129376EEC0074249E /* SentryTracedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D8199DB629376ECC0074249E /* SentryTracedView.swift */; }; - D8199DC229376FC10074249E /* Sentry.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 63AA759B1EB8AEF500D153DE /* Sentry.framework */; }; D81A346C291AECC7005A27A9 /* PrivateSentrySDKOnly.h in Headers */ = {isa = PBXBuildFile; fileRef = D81A346B291AECC7005A27A9 /* PrivateSentrySDKOnly.h */; settings = {ATTRIBUTES = (Private, ); }; }; D81FDF12280EA1060045E0E4 /* SentryScreenShotTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = D81FDF10280EA0080045E0E4 /* SentryScreenShotTests.swift */; }; D820CDB72BB1895F00BA339D /* SentrySessionReplayIntegration.m in Sources */ = {isa = PBXBuildFile; fileRef = D820CDB62BB1895F00BA339D /* SentrySessionReplayIntegration.m */; }; @@ -1041,6 +1041,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 = ""; }; @@ -1744,10 +1745,11 @@ 84AF45A429A7FFA500FBB177 /* SentryProfiledTracerConcurrency.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = SentryProfiledTracerConcurrency.h; path = ../include/SentryProfiledTracerConcurrency.h; sourceTree = ""; }; 84AF45A529A7FFA500FBB177 /* SentryProfiledTracerConcurrency.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = SentryProfiledTracerConcurrency.mm; sourceTree = ""; }; 84B7FA3B29B2866200AD93B1 /* SentryTestUtils-ObjC-BridgingHeader.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "SentryTestUtils-ObjC-BridgingHeader.h"; sourceTree = ""; }; - 84B7FA4729B2995A00AD93B1 /* DeploymentTargets.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = DeploymentTargets.xcconfig; sourceTree = ""; }; + 84B7FA4729B2995A00AD93B1 /* Versions.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Versions.xcconfig; sourceTree = ""; }; 84C47B2B2A09239100DAEB8A /* .codecov.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = .codecov.yml; sourceTree = ""; }; 84DEE86A2B686BD400A7BC17 /* SentrySamplerDecision.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentrySamplerDecision.h; path = include/SentrySamplerDecision.h; sourceTree = ""; }; 84DEE8752B69AD6400A7BC17 /* SentryLaunchProfiling.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = SentryLaunchProfiling.h; path = Sources/Sentry/include/SentryLaunchProfiling.h; sourceTree = SOURCE_ROOT; }; + 84EACEBC2C33CA7A009B8753 /* SentryWithoutUIKit.modulemap */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.module-map"; name = SentryWithoutUIKit.modulemap; path = Sources/Resources/SentryWithoutUIKit.modulemap; sourceTree = SOURCE_ROOT; }; 84EB21952BF01CEA00EDDA28 /* SentryCrashInstallationTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SentryCrashInstallationTests.swift; sourceTree = ""; }; 84F994E52A6894B500EC0190 /* CoreData.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreData.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/CoreData.framework; sourceTree = DEVELOPER_DIR; }; 84F994E72A6894BD00EC0190 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.3.sdk/System/Library/Frameworks/SystemConfiguration.framework; sourceTree = DEVELOPER_DIR; }; @@ -2025,7 +2027,6 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - D8199DC229376FC10074249E /* Sentry.framework in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -2528,7 +2529,7 @@ isa = PBXGroup; children = ( D8BD2E27292D1F7300D96C6A /* SDK.xcconfig */, - 84B7FA4729B2995A00AD93B1 /* DeploymentTargets.xcconfig */, + 84B7FA4729B2995A00AD93B1 /* Versions.xcconfig */, 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */, D8199DCF29376FF40074249E /* SentrySwiftUI.xcconfig */, ); @@ -2551,6 +2552,7 @@ 8ECC673625C23936000E2BF6 /* Transaction */, 8E25C94F25F836AB00DC215B /* Tools */, 63AA76931EB9C1C200D153DE /* Sentry.h */, + 33EB2A8F2C3411AE004FED3D /* SentryWithoutUIKit.h */, D8B665BA2B95F54200BD0E7B /* SentryPrivate.h */, D8BBD32628FD9FBF0011F850 /* SentrySwift.h */, D81A346B291AECC7005A27A9 /* PrivateSentrySDKOnly.h */, @@ -2574,6 +2576,7 @@ 63AA769F1EB9C89800D153DE /* Supporting Files */ = { isa = PBXGroup; children = ( + 84EACEBC2C33CA7A009B8753 /* SentryWithoutUIKit.modulemap */, 7DC27E9823995F97006998B5 /* Sentry.modulemap */, 63AA75C71EB8B06100D153DE /* Info.plist */, ); @@ -3935,6 +3938,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 */, @@ -4007,7 +4011,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 */, @@ -4016,6 +4019,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 */, @@ -5149,10 +5153,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -5204,7 +5204,6 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = "RELEASE=1"; GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -5244,20 +5243,12 @@ ENABLE_STRICT_OBJC_MSGSEND = NO; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(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; @@ -5286,7 +5277,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 = ( @@ -5296,10 +5286,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; }; @@ -5413,13 +5400,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "TEST=1", - "TESTCI=1", - "SENTRY_UIKIT_LINKED=1", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -5457,14 +5437,7 @@ ENABLE_STRICT_OBJC_MSGSEND = NO; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "TEST=1", - "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 = ( @@ -5474,10 +5447,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; @@ -5520,7 +5490,7 @@ }; name = TestCI; }; - 841C60C32A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C32A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = D8BD2E27292D1F7300D96C6A /* SDK.xcconfig */; buildSettings = { @@ -5558,11 +5528,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "SENTRY_NO_UIKIT=1", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -5577,9 +5542,9 @@ VERSIONING_SYSTEM = ""; VERSION_INFO_PREFIX = ""; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C42A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C42A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */; buildSettings = { @@ -5600,12 +5565,7 @@ ENABLE_STRICT_OBJC_MSGSEND = NO; GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(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 = ( @@ -5615,17 +5575,14 @@ ); 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; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C52A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C52A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -5658,9 +5615,9 @@ SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 13.0; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C72A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C72A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = D8199DCF29376FF40074249E /* SentrySwiftUI.xcconfig */; buildSettings = { @@ -5706,9 +5663,9 @@ SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C82A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C82A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -5737,9 +5694,9 @@ SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 5.0; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; - 841C60C92A69DE6B00E1C00F /* Debug_without_UIKit */ = { + 841C60C92A69DE6B00E1C00F /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -5768,7 +5725,7 @@ SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 5.0; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; 8431EFD529B27B1100D8DC56 /* Debug */ = { isa = XCBuildConfiguration; @@ -6013,7 +5970,7 @@ }; name = Release; }; - 8483D06A2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06A2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = D8BD2E27292D1F7300D96C6A /* SDK.xcconfig */; buildSettings = { @@ -6049,10 +6006,6 @@ ENABLE_STRICT_OBJC_MSGSEND = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = ( - "SENTRY_NO_UIKIT=1", - "RELEASE=1", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -6069,9 +6022,9 @@ VERSIONING_SYSTEM = ""; VERSION_INFO_PREFIX = ""; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D06B2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06B2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA75C51EB8B00100D153DE /* Sentry.xcconfig */; buildSettings = { @@ -6093,7 +6046,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 = ( @@ -6103,16 +6055,13 @@ ); 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; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D06C2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06C2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -6145,9 +6094,9 @@ SWIFT_VERSION = 5.0; TVOS_DEPLOYMENT_TARGET = 13.0; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D06E2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06E2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = D8199DCF29376FF40074249E /* SentrySwiftUI.xcconfig */; buildSettings = { @@ -6191,9 +6140,9 @@ SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D06F2AC7627800143615 /* Release_without_UIKit */ = { + 8483D06F2AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -6221,9 +6170,9 @@ SWIFT_SWIFT3_OBJC_INFERENCE = Off; SWIFT_VERSION = 5.0; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; - 8483D0702AC7627800143615 /* Release_without_UIKit */ = { + 8483D0702AC7627800143615 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; baseConfigurationReference = 63AA76AE1EB9D5CD00D153DE /* SentryTests.xcconfig */; buildSettings = { @@ -6250,7 +6199,7 @@ SWIFT_OBJC_BRIDGING_HEADER = "SentryTestUtils/SentryTestUtils-ObjC-BridgingHeader.h"; SWIFT_VERSION = 5.0; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; D8079A6727178911004B0F61 /* Test */ = { isa = XCBuildConfiguration; @@ -6289,12 +6238,6 @@ GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - "TEST=1", - "SENTRY_UIKIT_LINKED=1", - ); GCC_TREAT_INCOMPATIBLE_POINTER_TYPE_WARNINGS_AS_ERRORS = YES; GCC_TREAT_WARNINGS_AS_ERRORS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -6333,7 +6276,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 = ( @@ -6343,10 +6285,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; @@ -6630,7 +6569,7 @@ }; name = Debug; }; - D84DAD532B17428D003CF120 /* Debug_without_UIKit */ = { + D84DAD532B17428D003CF120 /* DebugWithoutUIKit */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -6683,7 +6622,7 @@ SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; - name = Debug_without_UIKit; + name = DebugWithoutUIKit; }; D84DAD542B17428D003CF120 /* Test */ = { isa = XCBuildConfiguration; @@ -6844,7 +6783,7 @@ }; name = Release; }; - D84DAD572B17428D003CF120 /* Release_without_UIKit */ = { + D84DAD572B17428D003CF120 /* ReleaseWithoutUIKit */ = { isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; @@ -6895,7 +6834,7 @@ SWIFT_VERSION = 5.0; VERSIONING_SYSTEM = "apple-generic"; }; - name = Release_without_UIKit; + name = ReleaseWithoutUIKit; }; /* End XCBuildConfiguration section */ @@ -6904,11 +6843,11 @@ isa = XCConfigurationList; buildConfigurations = ( 6327C5E51EB8A783004E799B /* Debug */, - 841C60C32A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C32A69DE6B00E1C00F /* DebugWithoutUIKit */, D8079A6727178911004B0F61 /* Test */, 7BFC80A8282B736400E83A05 /* TestCI */, 6327C5E61EB8A783004E799B /* Release */, - 8483D06A2AC7627800143615 /* Release_without_UIKit */, + 8483D06A2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6917,11 +6856,11 @@ isa = XCConfigurationList; buildConfigurations = ( 63AA75A11EB8AEF500D153DE /* Debug */, - 841C60C42A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C42A69DE6B00E1C00F /* DebugWithoutUIKit */, D8079A6827178911004B0F61 /* Test */, 7BFC80A9282B736400E83A05 /* TestCI */, 63AA75A21EB8AEF500D153DE /* Release */, - 8483D06B2AC7627800143615 /* Release_without_UIKit */, + 8483D06B2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6930,11 +6869,11 @@ isa = XCConfigurationList; buildConfigurations = ( 63AA766D1EB8CB2F00D153DE /* Debug */, - 841C60C52A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C52A69DE6B00E1C00F /* DebugWithoutUIKit */, D8079A6927178911004B0F61 /* Test */, 7BFC80AA282B736400E83A05 /* TestCI */, 63AA766E1EB8CB2F00D153DE /* Release */, - 8483D06C2AC7627800143615 /* Release_without_UIKit */, + 8483D06C2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6943,11 +6882,11 @@ isa = XCConfigurationList; buildConfigurations = ( 8431EFD529B27B1100D8DC56 /* Debug */, - 841C60C82A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C82A69DE6B00E1C00F /* DebugWithoutUIKit */, 8431EFD629B27B1100D8DC56 /* Test */, 8431EFD729B27B1100D8DC56 /* TestCI */, 8431EFD829B27B1100D8DC56 /* Release */, - 8483D06F2AC7627800143615 /* Release_without_UIKit */, + 8483D06F2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6956,11 +6895,11 @@ isa = XCConfigurationList; buildConfigurations = ( 8431F01129B284F200D8DC56 /* Debug */, - 841C60C92A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C92A69DE6B00E1C00F /* DebugWithoutUIKit */, 8431F01229B284F200D8DC56 /* Test */, 8431F01329B284F200D8DC56 /* TestCI */, 8431F01429B284F200D8DC56 /* Release */, - 8483D0702AC7627800143615 /* Release_without_UIKit */, + 8483D0702AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6969,11 +6908,11 @@ isa = XCConfigurationList; buildConfigurations = ( D8199DAE29376E9B0074249E /* Debug */, - 841C60C72A69DE6B00E1C00F /* Debug_without_UIKit */, + 841C60C72A69DE6B00E1C00F /* DebugWithoutUIKit */, D8199DAF29376E9B0074249E /* Test */, D8199DB029376E9B0074249E /* TestCI */, D8199DB129376E9B0074249E /* Release */, - 8483D06E2AC7627800143615 /* Release_without_UIKit */, + 8483D06E2AC7627800143615 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; @@ -6982,11 +6921,11 @@ isa = XCConfigurationList; buildConfigurations = ( D84DAD522B17428D003CF120 /* Debug */, - D84DAD532B17428D003CF120 /* Debug_without_UIKit */, + D84DAD532B17428D003CF120 /* DebugWithoutUIKit */, D84DAD542B17428D003CF120 /* Test */, D84DAD552B17428D003CF120 /* TestCI */, D84DAD562B17428D003CF120 /* Release */, - D84DAD572B17428D003CF120 /* Release_without_UIKit */, + D84DAD572B17428D003CF120 /* ReleaseWithoutUIKit */, ); defaultConfigurationIsVisible = 0; defaultConfigurationName = Release; diff --git a/Sources/Configuration/SDK.xcconfig b/Sources/Configuration/SDK.xcconfig index c94888780f0..a504c9c54ad 100644 --- a/Sources/Configuration/SDK.xcconfig +++ b/Sources/Configuration/SDK.xcconfig @@ -1,4 +1,4 @@ -#include "DeploymentTargets.xcconfig" +#include "Versions.xcconfig" SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator xros xrsimulator TARGETED_DEVICE_FAMILY = 1,2,3,4,7 @@ -34,9 +34,17 @@ CLANG_CXX_LIBRARY = libc++ HEADER_SEARCH_PATHS = $(SRCROOT)/Sources/Sentry/include/** SWIFT_ACTIVE_COMPILATION_CONDITIONS_Debug = DEBUG -SWIFT_ACTIVE_COMPILATION_CONDITIONS_Debug_without_UIKit = DEBUG SENTRY_NO_UIKIT +SWIFT_ACTIVE_COMPILATION_CONDITIONS_DebugWithoutUIKit = DEBUG SENTRY_NO_UIKIT SWIFT_ACTIVE_COMPILATION_CONDITIONS_Test = TEST SWIFT_ACTIVE_COMPILATION_CONDITIONS_TestCI = TESTCI SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release = -SWIFT_ACTIVE_COMPILATION_CONDITIONS_Release_without_UIKit = SENTRY_NO_UIKIT +SWIFT_ACTIVE_COMPILATION_CONDITIONS_ReleaseWithoutUIKit = SENTRY_NO_UIKIT SWIFT_ACTIVE_COMPILATION_CONDITIONS = $(SWIFT_ACTIVE_COMPILATION_CONDITIONS_$(CONFIGURATION)) + +GCC_PREPROCESSOR_DEFINITIONS_Debug = DEBUG=1 +GCC_PREPROCESSOR_DEFINITIONS_DebugWithoutUIKit = DEBUG=1 SENTRY_NO_UIKIT=1 +GCC_PREPROCESSOR_DEFINITIONS_Test = DEBUG=1 TEST=1 +GCC_PREPROCESSOR_DEFINITIONS_TestCI = DEBUG=1 TEST=1 TESTCI=1 +GCC_PREPROCESSOR_DEFINITIONS_Release = RELEASE=1 +GCC_PREPROCESSOR_DEFINITIONS_ReleaseWithoutUIKit = RELEASE=1 SENTRY_NO_UIKIT=1 +GCC_PREPROCESSOR_DEFINITIONS = $(GCC_PREPROCESSOR_DEFINITIONS_$(CONFIGURATION)) diff --git a/Sources/Configuration/Sentry.xcconfig b/Sources/Configuration/Sentry.xcconfig index aabef971d4e..b50393e59cb 100644 --- a/Sources/Configuration/Sentry.xcconfig +++ b/Sources/Configuration/Sentry.xcconfig @@ -1,11 +1,21 @@ -PRODUCT_NAME = Sentry -INFOPLIST_FILE = Sources/Resources/Info.plist -PRODUCT_BUNDLE_IDENTIFIER = io.sentry.Sentry +#include "Versions.xcconfig" -CURRENT_PROJECT_VERSION = 8.30.0 +INFOPLIST_FILE = Sources/Resources/Info.plist -MODULEMAP_FILE = $(SRCROOT)/Sources/Resources/Sentry.modulemap +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) +PRODUCT_MODULE_NAME_TestCI = $(SENTRY_MODULE_NAME) +PRODUCT_MODULE_NAME_Release = $(SENTRY_MODULE_NAME) +PRODUCT_MODULE_NAME_ReleaseWithoutUIKit = $(SENTRY_WITHOUT_UIKIT_MODULE_NAME) +PRODUCT_MODULE_NAME = $(PRODUCT_MODULE_NAME_$(CONFIGURATION)) +PRODUCT_NAME = $(PRODUCT_MODULE_NAME) +PRODUCT_BUNDLE_IDENTIFIER = io.sentry.$(PRODUCT_MODULE_NAME) +MODULEMAP_FILE = $(SRCROOT)/Sources/Resources/$(PRODUCT_MODULE_NAME_$(CONFIGURATION)).modulemap diff --git a/Sources/Configuration/SentrySwiftUI.xcconfig b/Sources/Configuration/SentrySwiftUI.xcconfig index 195c7d84616..fb5410ac6f3 100644 --- a/Sources/Configuration/SentrySwiftUI.xcconfig +++ b/Sources/Configuration/SentrySwiftUI.xcconfig @@ -6,3 +6,11 @@ IPHONEOS_DEPLOYMENT_TARGET = 13.0 WATCHOS_DEPLOYMENT_TARGET = 6.0 TVOS_DEPLOYMENT_TARGET = 13.0 MACH_O_TYPE = mh_dylib + +OTHER_LDFLAGS_DebugWithoutUIKit = -framework SentryWithoutUIKit +OTHER_LDFLAGS_ReleaseWithoutUIKit = -framework SentryWithoutUIKit +OTHER_LDFLAGS_Debug = -framework Sentry +OTHER_LDFLAGS_Test = -framework Sentry +OTHER_LDFLAGS_TestCI = -framework Sentry +OTHER_LDFLAGS_Release = -framework Sentry +OTHER_LDFLAGS = $(OTHER_LDFLAGS_$(CONFIGURATION)) diff --git a/Sources/Configuration/DeploymentTargets.xcconfig b/Sources/Configuration/Versions.xcconfig similarity index 82% rename from Sources/Configuration/DeploymentTargets.xcconfig rename to Sources/Configuration/Versions.xcconfig index d8bdbc678e4..86b4781813a 100644 --- a/Sources/Configuration/DeploymentTargets.xcconfig +++ b/Sources/Configuration/Versions.xcconfig @@ -3,3 +3,5 @@ IPHONEOS_DEPLOYMENT_TARGET = 11.0 WATCHOS_DEPLOYMENT_TARGET = 4.0 TVOS_DEPLOYMENT_TARGET = 11.0 XROS_DEPLOYMENT_TARGET = 1.0 + +CURRENT_PROJECT_VERSION = 8.30.0 diff --git a/Sources/Resources/SentryWithoutUIKit.modulemap b/Sources/Resources/SentryWithoutUIKit.modulemap new file mode 100644 index 00000000000..bde8eab8097 --- /dev/null +++ b/Sources/Resources/SentryWithoutUIKit.modulemap @@ -0,0 +1,6 @@ +framework module SentryWithoutUIKit { + umbrella header "SentryWithoutUIKit.h" + + export * + module * { export * } +} diff --git a/Sources/Sentry/Public/Sentry.h b/Sources/Sentry/Public/Sentry.h index a42b8f0e23c..7971af35a16 100644 --- a/Sources/Sentry/Public/Sentry.h +++ b/Sources/Sentry/Public/Sentry.h @@ -1,4 +1,5 @@ -#import +#if __has_include() +# 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 // __has_include() diff --git a/Sources/Sentry/Public/SentryOptions.h b/Sources/Sentry/Public/SentryOptions.h index 84cc4a0302d..525448d9e9f 100644 --- a/Sources/Sentry/Public/SentryOptions.h +++ b/Sources/Sentry/Public/SentryOptions.h @@ -254,7 +254,7 @@ NS_SWIFT_NAME(Options) #if SENTRY_UIKIT_AVAILABLE /** * When enabled, the SDK tracks performance for UIViewController subclasses. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note The default is @c YES . */ @@ -262,7 +262,7 @@ NS_SWIFT_NAME(Options) /** * Automatically attaches a screenshot when capturing an error or exception. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note Default value is @c NO . */ @@ -272,7 +272,7 @@ NS_SWIFT_NAME(Options) * @warning This is an experimental feature and may still have bugs. * @brief Automatically attaches a textual representation of the view hierarchy when capturing an * error event. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note Default value is @c NO . */ @@ -281,7 +281,7 @@ NS_SWIFT_NAME(Options) /** * When enabled, the SDK creates transactions for UI events like buttons clicks, switch toggles, * and other ui elements that uses UIControl @c sendAction:to:forEvent: - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note Default value is @c YES . */ @@ -290,7 +290,7 @@ NS_SWIFT_NAME(Options) /** * How long an idle transaction waits for new children after all its child spans finished. Only UI * event transactions are idle transactions. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note The default is 3 seconds. */ @@ -304,7 +304,7 @@ NS_SWIFT_NAME(Options) * @note You can filter for different app start types in Discover with * @c app_start_type:cold.prewarmed , * @c app_start_type:warm.prewarmed , @c app_start_type:cold , and @c app_start_type:warm . - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. * @note Default value is @c NO . */ diff --git a/Sources/Sentry/Public/SentryWithoutUIKit.h b/Sources/Sentry/Public/SentryWithoutUIKit.h new file mode 100644 index 00000000000..c812ce2b2bc --- /dev/null +++ b/Sources/Sentry/Public/SentryWithoutUIKit.h @@ -0,0 +1,49 @@ +#if __has_include() +# 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 // __has_include() diff --git a/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h b/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h index 45a8156fd8d..13173b41858 100644 --- a/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h +++ b/Sources/Sentry/include/HybridPublic/PrivateSentrySDKOnly.h @@ -132,31 +132,31 @@ typedef void (^SentryOnAppStartMeasurementAvailable)( #if SENTRY_UIKIT_AVAILABLE /** * Allows hybrid SDKs to enable frame tracking measurements despite other options. - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @property (class, nonatomic, assign) BOOL framesTrackingMeasurementHybridSDKMode; /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @property (class, nonatomic, assign, readonly) BOOL isFramesTrackingRunning; /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @property (class, nonatomic, assign, readonly) SentryScreenFrames *currentScreenFrames; /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ + (NSArray *)captureScreenshots; /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ + (NSData *)captureViewHierarchy; diff --git a/Sources/Sentry/include/HybridPublic/SentryAppStartMeasurement.h b/Sources/Sentry/include/HybridPublic/SentryAppStartMeasurement.h index 7eb49470c7f..5484f064fb8 100644 --- a/Sources/Sentry/include/HybridPublic/SentryAppStartMeasurement.h +++ b/Sources/Sentry/include/HybridPublic/SentryAppStartMeasurement.h @@ -17,7 +17,7 @@ SENTRY_NO_INIT @end /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @interface SentryAppStartMeasurement : NSObject diff --git a/Sources/Sentry/include/HybridPublic/SentryScreenFrames.h b/Sources/Sentry/include/HybridPublic/SentryScreenFrames.h index 9f4f2b8ccd9..9a4bc68d092 100644 --- a/Sources/Sentry/include/HybridPublic/SentryScreenFrames.h +++ b/Sources/Sentry/include/HybridPublic/SentryScreenFrames.h @@ -10,7 +10,7 @@ typedef NSArray *> SentryFrameInfoTimeSerie # endif // SENTRY_TARGET_PROFILING_SUPPORTED /** - * @warning This feature is not available in @c Debug_without_UIKit and @c Release_without_UIKit + * @warning This feature is not available in @c DebugWithoutUIKit and @c ReleaseWithoutUIKit * configurations even when targeting iOS or tvOS platforms. */ @interface SentryScreenFrames : NSObject diff --git a/Sources/Sentry/include/SentrySwift.h b/Sources/Sentry/include/SentrySwift.h index 861a37090c8..fbada579894 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" -#else -# import -#endif +#if __has_include() +# if __has_include("SentryWithoutUIKit-Swift.h") +# import "SentryWithoutUIKit-Swift.h" +# else +# import +# endif +#else // !__has_include() +# if __has_include("Sentry-Swift.h") +# import "Sentry-Swift.h" +# else +# import +# endif +#endif // __has_include() #endif diff --git a/Sources/SentrySwiftUI/SentryTracedView.swift b/Sources/SentrySwiftUI/SentryTracedView.swift index 9a4b7087903..c983fea1ae8 100644 --- a/Sources/SentrySwiftUI/SentryTracedView.swift +++ b/Sources/SentrySwiftUI/SentryTracedView.swift @@ -1,5 +1,9 @@ import Foundation +#if SENTRY_NO_UIKIT +import SentryWithoutUIKit +#else import Sentry +#endif #if CARTHAGE || SWIFT_PACKAGE @_implementationOnly import SentryInternal #endif diff --git a/Sources/Swift/Integrations/SessionReplay/SentryReplayVideoMaker.swift b/Sources/Swift/Integrations/SessionReplay/SentryReplayVideoMaker.swift index 2661d05e788..571748cb758 100644 --- a/Sources/Swift/Integrations/SessionReplay/SentryReplayVideoMaker.swift +++ b/Sources/Swift/Integrations/SessionReplay/SentryReplayVideoMaker.swift @@ -1,4 +1,4 @@ -#if canImport(UIKit) +#if canImport(UIKit) && !SENTRY_NO_UIKIT import Foundation import UIKit diff --git a/Tests/Configuration/SentryTests.xcconfig b/Tests/Configuration/SentryTests.xcconfig index 0a8a870f710..92407a220b7 100644 --- a/Tests/Configuration/SentryTests.xcconfig +++ b/Tests/Configuration/SentryTests.xcconfig @@ -1,5 +1,9 @@ -#include "../../Sources/Configuration/Sentry.xcconfig" -#include "../../Sources/Configuration/DeploymentTargets.xcconfig" +#include "../../Sources/Configuration/Versions.xcconfig" + +// (originally added to Sentry.xcconfig in #3716, but it's only needed in the test targets, not the SDK target) +// 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_NAME = Tests INFOPLIST_FILE = Tests/SentryTests/Info.plist diff --git a/develop-docs/README.md b/develop-docs/README.md index 50943667aab..e087fa93367 100644 --- a/develop-docs/README.md +++ b/develop-docs/README.md @@ -100,7 +100,7 @@ You can use the `generate-classes.sh` to generate ViewControllers and other clas Some customers would like to not link UIKit for various reasons. Either they simply may not want to use our UIKit functionality, or they actually cannot link to it in certain circumstances, like a File Provider app extension. -There are two build configurations they can use for this: `Debug_without_UIKit` and `Release_without_UIKit`, that are essentially the same as `Debug` and `Release` with the following differences: +There are two build configurations they can use for this: `DebugWithoutUIKit` and `ReleaseWithoutUIKit`, that are essentially the same as `Debug` and `Release` with the following differences: - They set `CLANG_MODULES_AUTOLINK` to `NO`. This avoids a load command being automatically inserted for any UIKit API that make their way into the type system during compilation of SDK sources. - `GCC_PREPROCESSOR_DEFINITIONS` has an additional setting `SENTRY_NO_UIKIT=1`. This is now part of the definition of `SENTRY_HAS_UIKIT` in `SentryDefines.h` that is used to conditionally compile out any code that would otherwise use UIKit API and cause UIKit to be automatically linked as described above. There is another macro `SENTRY_UIKIT_AVAILABLE` defined as `SENTRY_HAS_UIKIT` used to be, meaning simply that compilation is targeting a platform where UIKit is available to be used. This is used in headers we deliver in the framework bundle to compile out declarations that rely on UIKit, and their corresponding implementations are switched over `SENTRY_HAS_UIKIT` to either provide the logic for configurations that link UIKit, or to provide a stub delivering a default value (`nil`, `0.0`, `NO` etc) and a warning log for publicly facing things like SentryOptions, or debug log for internal things like SentryDependencyContainer. diff --git a/scripts/build-xcframework.sh b/scripts/build-xcframework.sh index 45ee21f3a81..7c1716eb486 100755 --- a/scripts/build-xcframework.sh +++ b/scripts/build-xcframework.sh @@ -11,12 +11,15 @@ ALL_SDKS=$(xcodebuild -showsdks) generate_xcframework() { local scheme="$1" - local sufix="${2:-}" + local suffix="${2:-}" local MACH_O_TYPE="${3-mh_dylib}" - local configuration="${4-Release}" + local configuration_suffix="${4-}" local createxcframework="xcodebuild -create-xcframework " local GCC_GENERATE_DEBUGGING_SYMBOLS="YES" + local resolved_configuration="Release$configuration_suffix" + local resolved_product_name="$scheme$configuration_suffix" + if [ "$MACH_O_TYPE" = "staticlib" ]; then #For static framework we disabled symbols because they are not distributed in the framework causing warnings. GCC_GENERATE_DEBUGGING_SYMBOLS="NO" @@ -27,15 +30,15 @@ generate_xcframework() { for sdk in "${sdks[@]}"; do if [[ -n "$(grep "${sdk}" <<< "$ALL_SDKS")" ]]; then - xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$configuration" -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" + xcodebuild archive -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$resolved_configuration" -sdk "$sdk" -archivePath ./Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive CODE_SIGNING_REQUIRED=NO SKIP_INSTALL=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" - createxcframework+="-framework Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework " + createxcframework+="-framework Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework " if [ "$MACH_O_TYPE" = "staticlib" ]; then - local infoPlist="Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework/Info.plist" + local infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework/Info.plist" if [ ! -e "$infoPlist" ]; then - infoPlist="Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/Products/Library/Frameworks/${scheme}.framework/Resources/Info.plist" + infoPlist="Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/Products/Library/Frameworks/${resolved_product_name}.framework/Resources/Info.plist" fi # This workaround is necessary to make Sentry Static framework to work # More information in here: https://github.com/getsentry/sentry-cocoa/issues/3769 @@ -43,9 +46,9 @@ generate_xcframework() { plutil -replace "MinimumOSVersion" -string "100.0" "$infoPlist" fi - if [ -d "Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/dSYMs/${scheme}.framework.dSYM" ]; then + if [ -d "Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/dSYMs/${resolved_product_name}.framework.dSYM" ]; then # Has debug symbols - createxcframework+="-debug-symbols $(pwd -P)/Carthage/archive/${scheme}${sufix}/${sdk}.xcarchive/dSYMs/${scheme}.framework.dSYM " + createxcframework+="-debug-symbols $(pwd -P)/Carthage/archive/${scheme}${suffix}/${sdk}.xcarchive/dSYMs/${resolved_product_name}.framework.dSYM " fi else echo "${sdk} SDK not found" @@ -53,19 +56,19 @@ generate_xcframework() { done #Create framework for mac catalyst - xcodebuild -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$configuration" -sdk iphoneos -destination 'platform=macOS,variant=Mac Catalyst' -derivedDataPath ./Carthage/DerivedData CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE SUPPORTS_MACCATALYST=YES ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" + xcodebuild -project Sentry.xcodeproj/ -scheme "$scheme" -configuration "$resolved_configuration" -sdk iphoneos -destination 'platform=macOS,variant=Mac Catalyst' -derivedDataPath ./Carthage/DerivedData CODE_SIGNING_REQUIRED=NO CODE_SIGN_IDENTITY= CARTHAGE=YES MACH_O_TYPE=$MACH_O_TYPE SUPPORTS_MACCATALYST=YES ENABLE_CODE_COVERAGE=NO GCC_GENERATE_DEBUGGING_SYMBOLS="$GCC_GENERATE_DEBUGGING_SYMBOLS" if [ "$MACH_O_TYPE" = "staticlib" ]; then - local infoPlist="Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework/Resources/Info.plist" + local infoPlist="Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${scheme}.framework/Resources/Info.plist" plutil -replace "MinimumOSVersion" -string "100.0" "$infoPlist" fi - createxcframework+="-framework Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework " - if [ -d "Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework.dSYM" ]; then - createxcframework+="-debug-symbols $(pwd -P)/Carthage/DerivedData/Build/Products/"$configuration"-maccatalyst/${scheme}.framework.dSYM " + createxcframework+="-framework Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${resolved_product_name}.framework " + if [ -d "Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${resolved_product_name}.framework.dSYM" ]; then + createxcframework+="-debug-symbols $(pwd -P)/Carthage/DerivedData/Build/Products/"$resolved_configuration"-maccatalyst/${resolved_product_name}.framework.dSYM " fi - createxcframework+="-output Carthage/${scheme}${sufix}.xcframework" + createxcframework+="-output Carthage/${scheme}${suffix}.xcframework" $createxcframework } @@ -75,4 +78,4 @@ generate_xcframework "Sentry" "" staticlib generate_xcframework "SentrySwiftUI" -generate_xcframework "Sentry" "-WithoutUIKitOrAppKit" mh_dylib Release_without_UIKit +generate_xcframework "Sentry" "-WithoutUIKitOrAppKit" mh_dylib WithoutUIKit diff --git a/scripts/check-uikit-linkage.sh b/scripts/check-uikit-linkage.sh index 329ae77fb64..25355b99a9a 100755 --- a/scripts/check-uikit-linkage.sh +++ b/scripts/check-uikit-linkage.sh @@ -6,14 +6,16 @@ set -eou pipefail CONFIGURATION="${1}" DERIVED_DATA_PATH="${2}" +LINKAGE_TEST="${3}" +MODULE_NAME="${4}" -SENTRY_BUILD_PRODUCT_PATH="$DERIVED_DATA_PATH/Build/Products/$CONFIGURATION-iphonesimulator/Sentry.framework/Sentry" +SENTRY_BUILD_PRODUCT_PATH="$DERIVED_DATA_PATH/Build/Products/$CONFIGURATION-iphonesimulator/$MODULE_NAME.framework/$MODULE_NAME" stat $SENTRY_BUILD_PRODUCT_PATH -MATCHES=$(otool -L $SENTRY_BUILD_PRODUCT_PATH | grep -c UIKit.framework ||:) +MATCHES=$(otool -L $SENTRY_BUILD_PRODUCT_PATH | grep -c -e "UIKit.framework/UIKit" -e "libswiftUIKit.dylib" ||:) -case "${3}" in +case "$LINKAGE_TEST" in "linked") if [ $MATCHES == 0 ]; then echo "UIKit.framework linkage not found."