Skip to content

Commit

Permalink
Merge 42d7e3f into e2a3f3e
Browse files Browse the repository at this point in the history
  • Loading branch information
brustolin authored Nov 10, 2022
2 parents e2a3f3e + 42d7e3f commit 0a45bd3
Show file tree
Hide file tree
Showing 31 changed files with 618 additions and 144 deletions.
8 changes: 7 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
# Changelog

## Unreleased
## Unreleased

This version introduces a dependency on Swift, which only impacts you if you don't use Swift. If your project uses Swift already, this change will not affect you.

### Features

- Properly demangle Swift class name (#2162)

### Fixes

Expand Down
7 changes: 7 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,15 @@ let package = Package(
.library(name: "Sentry-Dynamic", type: .dynamic, targets: ["Sentry"])
],
targets: [
.target( name: "SentryPrivate",
path: "Sources",
sources: [
"Swift"
]
),
.target(
name: "Sentry",
dependencies: ["SentryPrivate"],
path: "Sources",
sources: [
"Sentry/",
Expand Down
2 changes: 1 addition & 1 deletion Samples/Carthage-Validation/Framework/input.xcfilelist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$(SRCROOT)/Carthage/Build/iOS/Sentry.framework
$(SRCROOT)/Carthage/Build/iOS/Sentry.framework
2 changes: 1 addition & 1 deletion Samples/Carthage-Validation/Framework/output.xcfilelist
Original file line number Diff line number Diff line change
@@ -1 +1 @@
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Sentry.framework
$(BUILT_PRODUCTS_DIR)/$(FRAMEWORKS_FOLDER_PATH)/Sentry.framework
15 changes: 15 additions & 0 deletions Samples/iOS-Swift/iOS-Swift.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,13 @@
remoteGlobalIDString = 637AFDA5243B02760034958B;
remoteInfo = "iOS-Swift";
};
D81A3499291D0B2C005A27A9 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = D81A3488291D0AC0005A27A9;
remoteInfo = SentryPrivate;
};
D83A30CA279F075800372D0A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 6308532C2440C44F00DDE4CE /* Sentry.xcodeproj */;
Expand Down Expand Up @@ -350,6 +357,7 @@
children = (
630853322440C44F00DDE4CE /* Sentry.framework */,
630853342440C44F00DDE4CE /* SentryTests.xctest */,
D81A349A291D0B2C005A27A9 /* SentryPrivate.framework */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -720,6 +728,13 @@
remoteRef = 630853332440C44F00DDE4CE /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
D81A349A291D0B2C005A27A9 /* SentryPrivate.framework */ = {
isa = PBXReferenceProxy;
fileType = wrapper.framework;
path = SentryPrivate.framework;
remoteRef = D81A3499291D0B2C005A27A9 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
/* End PBXReferenceProxy section */

/* Begin PBXResourcesBuildPhase section */
Expand Down
10 changes: 6 additions & 4 deletions Sentry.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ Pod::Spec.new do |s|
s.requires_arc = true
s.frameworks = 'Foundation'
s.libraries = 'z', 'c++'
s.swift_versions = "5.5"
s.pod_target_xcconfig = {
'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
Expand All @@ -26,17 +27,18 @@ Pod::Spec.new do |s|
}

s.default_subspecs = ['Core']
s.dependency "SentryPrivate"

s.subspec 'Core' do |sp|
sp.source_files = "Sources/Sentry/**/*.{h,hpp,m,mm,c,cpp}",
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}"
sp.public_header_files = "Sources/Sentry/Public/*.h"
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/Swift/Sentry.swift"
sp.public_header_files =
"Sources/Sentry/Public/*.h"
end

s.subspec 'HybridSDK' do |sp|
sp.source_files = "Sources/Sentry/**/*.{h,hpp,m,mm,c,cpp}",
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}"
"Sources/SentryCrash/**/*.{h,hpp,m,mm,c,cpp}", "Sources/Swift/Sentry.swift"

sp.public_header_files =
"Sources/Sentry/Public/*.h", "Sources/Sentry/include/PrivateSentrySDKOnly.h"
Expand Down
348 changes: 324 additions & 24 deletions Sentry.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

67 changes: 67 additions & 0 deletions Sentry.xcodeproj/xcshareddata/xcschemes/SentryPrivate.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1410"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D81A3487291D0AC0005A27A9"
BuildableName = "SentryPrivate.framework"
BlueprintName = "SentryPrivate"
ReferencedContainer = "container:Sentry.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "D81A3487291D0AC0005A27A9"
BuildableName = "SentryPrivate.framework"
BlueprintName = "SentryPrivate"
ReferencedContainer = "container:Sentry.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
35 changes: 35 additions & 0 deletions SentryPrivate.podspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Pod::Spec.new do |s|
s.name = "SentryPrivate"
s.version = "7.30.0"
s.summary = "Sentry Private Library. Do not target this directly"
s.homepage = "https://github.com/getsentry/sentry-cocoa"
s.license = "mit"
s.authors = "Sentry"
s.source = { :git => "https://github.com/getsentry/sentry-cocoa.git",
:tag => s.version.to_s }

s.ios.deployment_target = "9.0"
s.osx.deployment_target = "10.10"
s.tvos.deployment_target = "9.0"
s.watchos.deployment_target = "2.0"
s.module_name = "SentryPrivate"
s.requires_arc = true
s.frameworks = 'Foundation'
s.libraries = 'c++'
s.swift_versions = "5.5"
s.pod_target_xcconfig = {
'GCC_ENABLE_CPP_EXCEPTIONS' => 'YES',
'CLANG_CXX_LANGUAGE_STANDARD' => 'c++14',
'CLANG_CXX_LIBRARY' => 'libc++'
}
s.watchos.pod_target_xcconfig = {
'OTHER_LDFLAGS' => '$(inherited) -framework WatchKit'
}

s.default_subspecs = ['Core']

s.subspec 'Core' do |sp|
sp.source_files = "Sources/Swift/**/*.{swift}"
end

end
65 changes: 65 additions & 0 deletions Sources/Configuration/SentryPrivate.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
SDKROOT = $(SDKROOT__CARTHAGE_$(CARTHAGE)) // basically, iphoneos (unless «CARTHAGE» == «YES»)
// Carthage relies on this assumption, years standing — that SDKROOT is default or explicitly
// set to `macosx` (or equivalent) under the ‘single target, multiple platform’ paradigm
// because of a xcodebuild bug involving the sdk flag and implicit dependency: see «Carthage/Carthage#347».
SDKROOT__CARTHAGE_YES = macosx
// Importantly, the below two lines appease «Xcode.app», and get the UI to show Mac Catalyst destinations.
SDKROOT__CARTHAGE_NO = iphoneos
SDKROOT__CARTHAGE_ = iphoneos
// …in order for ‘single target, multiple platform’ extrapolations to hold true,
// all the above relies on the ability of Xcode GUI, xcodebuild, and Carthage via xcodebuild to
// override «SDKROOT» based on selected destination (particularly for appletv* and watchos* platforms.)
// …if the override behavior ever breaks, expect weird output and the probable need to migrate away from
// the ‘single target, multiple platform’ paradigm.

// …`SUPPORTED_PLATFORMS`, in service of ‘single target, multiple platform’ extrapolation, must never
// engage in dollar-parentheses syntax — unless that dollar-parentheses basis is
// entirely non-platform–derived, e.g. based upon `XCODE_VERSION_MAJOR`.
// Note: Carthage, unfortunately, as current of v0.34.0 queries rather harshly on the platform values below
// ⋯ quite early in the process, queried values not compiled into Carthage will cause hard errors.
SUPPORTED_PLATFORMS = macosx iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator
TARGETED_DEVICE_FAMILY = 1,2,3,4
SKIP_INSTALL = YES
DEFINES_MODULE = YES
DYLIB_COMPATIBILITY_VERSION = 1
DYLIB_CURRENT_VERSION = 1
DYLIB_INSTALL_NAME_BASE = @rpath
MACH_O_TYPE = mh_dylib
FRAMEWORK_VERSION = A

PRODUCT_NAME = SentryPrivate
CURRENT_PROJECT_VERSION = 7.30.0
PRODUCT_BUNDLE_IDENTIFIER = io.sentry.SentryPrivate
ALWAYS_SEARCH_USER_PATHS = NO
CLANG_ENABLE_OBJC_ARC = YES
CLANG_ENABLE_MODULES = YES
//OTHER_CFLAGS = -Wall -Wextra -Wpedantic -Wno-gnu-conditional-omitted-operand

ONLY_ACTIVE_ARCH[config=Debug] = YES
GCC_OPTIMIZATION_LEVEL[config=Debug] = 0
COPY_PHASE_STRIP[config=Debug] = NO

MACOSX_DEPLOYMENT_TARGET = 10.9
IPHONEOS_DEPLOYMENT_TARGET = 9.0
WATCHOS_DEPLOYMENT_TARGET = 2.0
TVOS_DEPLOYMENT_TARGET = 9.0

LD_RUNPATH_SEARCH_PATHS[sdk=macosx*] = $(inherited) @executable_path/../Frameworks @loader_path/../Frameworks;
LD_RUNPATH_SEARCH_PATHS[sdk=iphone*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks;
LD_RUNPATH_SEARCH_PATHS[sdk=watch*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks;
LD_RUNPATH_SEARCH_PATHS[sdk=appletv*] = $(inherited) @executable_path/Frameworks @loader_path/Frameworks;

OTHER_LDFLAGS[sdk=watch*] = $(inherited) -framework WatchKit

//SWIFT_INCLUDE_PATHS = $(SRCROOT)/Sources/Sentry

// SWIFT_VERSION is only recognized by Xcode 8 and higher.
// Prior versions of Xcode support only one Swift version.
// SWIFT_VERSION = 3.1

// Although `YES` is the default for iOS targets, command-line output via `xcodebuild -showBuildSettings`
// will not emit this value unless it is explicitly set.
SUPPORTS_MACCATALYST = YES

CLANG_CXX_LANGUAGE_STANDARD = c++14
CLANG_CXX_LIBRARY = libc++
1 change: 0 additions & 1 deletion Sources/Sentry/Public/SentryStacktrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ NS_ASSUME_NONNULL_BEGIN

@class SentryFrame;

NS_SWIFT_NAME(Stacktrace)
@interface SentryStacktrace : NSObject <SentrySerializable>
SENTRY_NO_INIT

Expand Down
1 change: 0 additions & 1 deletion Sources/Sentry/Public/SentryThread.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ NS_ASSUME_NONNULL_BEGIN

@class SentryStacktrace;

NS_SWIFT_NAME(Thread)
@interface SentryThread : NSObject <SentrySerializable>
SENTRY_NO_INIT

Expand Down
13 changes: 6 additions & 7 deletions Sources/Sentry/SentryBreadcrumbTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
#import "SentryLog.h"
#import "SentrySDK+Private.h"
#import "SentryScope.h"
#import "SentrySwift.h"
#import "SentrySwizzle.h"
#import "SentrySwizzleWrapper.h"
#import "SentryUIViewControllerSanitizer.h"

#if SENTRY_HAS_UIKIT
# import <UIKit/UIKit.h>
Expand Down Expand Up @@ -234,8 +234,7 @@ + (NSDictionary *)fetchInfoAboutViewController:(UIViewController *)controller
{
NSMutableDictionary *info = @{}.mutableCopy;

info[@"screen"] = [SentryUIViewControllerSanitizer
sanitizeViewControllerName:[NSString stringWithFormat:@"%@", controller]];
info[@"screen"] = [SwiftDescriptor getObjectClassName:controller];

if ([controller.navigationItem.title length] != 0) {
info[@"title"] = controller.navigationItem.title;
Expand All @@ -246,13 +245,13 @@ + (NSDictionary *)fetchInfoAboutViewController:(UIViewController *)controller
info[@"beingPresented"] = controller.beingPresented ? @"true" : @"false";

if (controller.presentingViewController != nil) {
info[@"presentingViewController"] = [SentryUIViewControllerSanitizer
sanitizeViewControllerName:controller.presentingViewController];
info[@"presentingViewController"] =
[SwiftDescriptor getObjectClassName:controller.presentingViewController];
}

if (controller.parentViewController != nil) {
info[@"parentViewController"] = [SentryUIViewControllerSanitizer
sanitizeViewControllerName:controller.parentViewController];
info[@"parentViewController"] =
[SwiftDescriptor getObjectClassName:controller.parentViewController];
}

if (controller.view.window != nil) {
Expand Down
4 changes: 2 additions & 2 deletions Sources/Sentry/SentryUIViewControllerPerformanceTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
#import "SentrySDK+Private.h"
#import "SentryScope.h"
#import "SentrySpanId.h"
#import "SentryUIViewControllerSanitizer.h"
#import "SentrySwift.h"
#import <SentryInAppLogic.h>
#import <SentrySpanOperations.h>
#import <objc/runtime.h>
Expand Down Expand Up @@ -89,7 +89,7 @@ - (void)createTransaction:(UIViewController *)controller
// If the user manually calls loadView outside the lifecycle we don't start a new transaction
// and override the previous id stored.
if (spanId == nil) {
NSString *name = [SentryUIViewControllerSanitizer sanitizeViewControllerName:controller];
NSString *name = [SwiftDescriptor getObjectClassName:controller];
spanId = [self.tracker startSpanWithName:name
nameSource:kSentryTransactionNameSourceComponent
operation:SentrySpanOperationUILoad];
Expand Down
34 changes: 0 additions & 34 deletions Sources/Sentry/SentryUIViewControllerSanitizer.m

This file was deleted.

Loading

0 comments on commit 0a45bd3

Please sign in to comment.