Skip to content

Commit 7e0f0ce

Browse files
soffesJosh Holtz
authored and
Josh Holtz
committed
Fix building iOS with Carthage (#3)
Fix building iOS with Carthage
1 parent b9eb602 commit 7e0f0ce

21 files changed

+48
-106
lines changed

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[submodule "Carthage/Checkouts/KSCrash"]
22
path = Carthage/Checkouts/KSCrash
3-
url = https://d1894ef214ee876e4fbb0b65f56a733a87d1afaa@github.com/kstenerud/KSCrash.git
3+
url = https://github.com/kstenerud/KSCrash.git

Cartfile

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
github "kstenerud/KSCrash" ~> 1.3
2-
1+
github "kstenerud/KSCrash" ~> 1.5.5

Cartfile.resolved

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
github "kstenerud/KSCrash" "1.3.4"
1+
github "kstenerud/KSCrash" "1.5.5"

Carthage/Checkouts/KSCrash

Submodule KSCrash updated 88 files

SentrySwift.xcodeproj/project.pbxproj

+29-68
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
033A342A1C605B7E00BED5AE /* EventProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = 033A34281C605B7E00BED5AE /* EventProperties.swift */; };
1313
033A342C1C60693400BED5AE /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 033A342B1C60693400BED5AE /* User.swift */; };
1414
033A342D1C60693400BED5AE /* User.swift in Sources */ = {isa = PBXBuildFile; fileRef = 033A342B1C60693400BED5AE /* User.swift */; };
15-
035242921C988D2400A65D6D /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 035242911C988D2400A65D6D /* Info.plist */; };
1615
035242981C988D2F00A65D6D /* Abort.json in Resources */ = {isa = PBXBuildFile; fileRef = 035242941C988D2F00A65D6D /* Abort.json */; };
1716
035242991C988D2F00A65D6D /* Info.plist in Resources */ = {isa = PBXBuildFile; fileRef = 035242951C988D2F00A65D6D /* Info.plist */; };
1817
035242A61C9892A700A65D6D /* SentrySwiftCrashTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 035242961C988D2F00A65D6D /* SentrySwiftCrashTests.swift */; };
@@ -41,38 +40,17 @@
4140
03D4D9FA1CA48FA800799CC9 /* Breadcrumb.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D4D9F81CA48FA800799CC9 /* Breadcrumb.swift */; };
4241
03D4DA001CA586EF00799CC9 /* SentrySwiftBreadcrumbTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D4D9FF1CA586EF00799CC9 /* SentrySwiftBreadcrumbTests.swift */; };
4342
03D4DA011CA586EF00799CC9 /* SentrySwiftBreadcrumbTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03D4D9FF1CA586EF00799CC9 /* SentrySwiftBreadcrumbTests.swift */; };
44-
03DE7D811C876E3200F789BA /* KSCrash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03DE7D801C876DEF00F789BA /* KSCrash.framework */; };
4543
03E3D1D81C3E166800F00547 /* EventSerializable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 0303BC3E1C29FC3F003E7B16 /* EventSerializable.swift */; };
4644
03E3D1F81C3E1A2800F00547 /* DSN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E3D1F71C3E1A2800F00547 /* DSN.swift */; };
4745
03E3D1F91C3E1A2800F00547 /* DSN.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E3D1F71C3E1A2800F00547 /* DSN.swift */; };
4846
03E3D21F1C3EB20F00F00547 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E3D21E1C3EB20F00F00547 /* Request.swift */; };
4947
03E3D2201C3EB20F00F00547 /* Request.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03E3D21E1C3EB20F00F00547 /* Request.swift */; };
5048
03E94AF71C22595C009F8F29 /* SentrySwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03E94AEC1C22595B009F8F29 /* SentrySwift.framework */; };
5149
03E94B151C22596A009F8F29 /* SentrySwift.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 03E94B0B1C22596A009F8F29 /* SentrySwift.framework */; };
50+
217A96231CD67746006C681F /* KSCrash.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 217A961F1CD67736006C681F /* KSCrash.framework */; };
5251
/* End PBXBuildFile section */
5352

5453
/* Begin PBXContainerItemProxy section */
55-
03DE7D7B1C876DEF00F789BA /* PBXContainerItemProxy */ = {
56-
isa = PBXContainerItemProxy;
57-
containerPortal = 03DE7D751C876DEF00F789BA /* KSCrash-iOS.xcodeproj */;
58-
proxyType = 2;
59-
remoteGlobalIDString = CB6D132617EB749A00BC2C04;
60-
remoteInfo = KSCrashLib;
61-
};
62-
03DE7D7D1C876DEF00F789BA /* PBXContainerItemProxy */ = {
63-
isa = PBXContainerItemProxy;
64-
containerPortal = 03DE7D751C876DEF00F789BA /* KSCrash-iOS.xcodeproj */;
65-
proxyType = 2;
66-
remoteGlobalIDString = CB6D133317EB749A00BC2C04;
67-
remoteInfo = KSCrashTests;
68-
};
69-
03DE7D7F1C876DEF00F789BA /* PBXContainerItemProxy */ = {
70-
isa = PBXContainerItemProxy;
71-
containerPortal = 03DE7D751C876DEF00F789BA /* KSCrash-iOS.xcodeproj */;
72-
proxyType = 2;
73-
remoteGlobalIDString = 03DE7B6A1C84DEF700F789BA;
74-
remoteInfo = KSCrash;
75-
};
7654
03E94AF81C22595C009F8F29 /* PBXContainerItemProxy */ = {
7755
isa = PBXContainerItemProxy;
7856
containerPortal = 03E94AE31C22595B009F8F29 /* Project object */;
@@ -111,13 +89,13 @@
11189
03CFCEC01C612F3E00999EB7 /* KSCrashHandler.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = KSCrashHandler.swift; sourceTree = "<group>"; };
11290
03D4D9F81CA48FA800799CC9 /* Breadcrumb.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Breadcrumb.swift; sourceTree = "<group>"; };
11391
03D4D9FF1CA586EF00799CC9 /* SentrySwiftBreadcrumbTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SentrySwiftBreadcrumbTests.swift; sourceTree = "<group>"; };
114-
03DE7D751C876DEF00F789BA /* KSCrash-iOS.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "KSCrash-iOS.xcodeproj"; path = "Carthage/Checkouts/KSCrash/iOS/KSCrash-iOS.xcodeproj"; sourceTree = "<group>"; };
11592
03E3D1F71C3E1A2800F00547 /* DSN.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DSN.swift; sourceTree = "<group>"; };
11693
03E3D21E1C3EB20F00F00547 /* Request.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Request.swift; sourceTree = "<group>"; };
11794
03E94AEC1C22595B009F8F29 /* SentrySwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SentrySwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
11895
03E94AF61C22595C009F8F29 /* SentrySwiftTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SentrySwiftTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
11996
03E94B0B1C22596A009F8F29 /* SentrySwift.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SentrySwift.framework; sourceTree = BUILT_PRODUCTS_DIR; };
12097
03E94B141C22596A009F8F29 /* SentrySwift-iOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SentrySwift-iOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
98+
217A961F1CD67736006C681F /* KSCrash.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = KSCrash.framework; path = Carthage/Build/iOS/KSCrash.framework; sourceTree = "<group>"; };
12199
/* End PBXFileReference section */
122100

123101
/* Begin PBXFrameworksBuildPhase section */
@@ -140,7 +118,7 @@
140118
isa = PBXFrameworksBuildPhase;
141119
buildActionMask = 2147483647;
142120
files = (
143-
03DE7D811C876E3200F789BA /* KSCrash.framework in Frameworks */,
121+
217A96231CD67746006C681F /* KSCrash.framework in Frameworks */,
144122
);
145123
runOnlyForDeploymentPostprocessing = 0;
146124
};
@@ -223,23 +201,13 @@
223201
name = Crash;
224202
sourceTree = "<group>";
225203
};
226-
03DE7D761C876DEF00F789BA /* Products */ = {
227-
isa = PBXGroup;
228-
children = (
229-
03DE7D7C1C876DEF00F789BA /* libKSCrashLib.a */,
230-
03DE7D7E1C876DEF00F789BA /* KSCrashTests.xctest */,
231-
03DE7D801C876DEF00F789BA /* KSCrash.framework */,
232-
);
233-
name = Products;
234-
sourceTree = "<group>";
235-
};
236204
03E94AE21C22595B009F8F29 = {
237205
isa = PBXGroup;
238206
children = (
239-
03DE7D751C876DEF00F789BA /* KSCrash-iOS.xcodeproj */,
240207
036378271C225D5200644C01 /* Sources */,
241208
035242901C988D2400A65D6D /* SentrySwift */,
242209
035242931C988D2F00A65D6D /* SentrySwiftTests */,
210+
217A96211CD67739006C681F /* Frameworks */,
243211
03E94AED1C22595B009F8F29 /* Products */,
244212
);
245213
sourceTree = "<group>";
@@ -255,6 +223,22 @@
255223
name = Products;
256224
sourceTree = "<group>";
257225
};
226+
217A96211CD67739006C681F /* Frameworks */ = {
227+
isa = PBXGroup;
228+
children = (
229+
217A96221CD6773F006C681F /* iOS */,
230+
);
231+
name = Frameworks;
232+
sourceTree = "<group>";
233+
};
234+
217A96221CD6773F006C681F /* iOS */ = {
235+
isa = PBXGroup;
236+
children = (
237+
217A961F1CD67736006C681F /* KSCrash.framework */,
238+
);
239+
name = iOS;
240+
sourceTree = "<group>";
241+
};
258242
/* End PBXGroup section */
259243

260244
/* Begin PBXHeadersBuildPhase section */
@@ -356,7 +340,7 @@
356340
isa = PBXProject;
357341
attributes = {
358342
LastSwiftUpdateCheck = 0720;
359-
LastUpgradeCheck = 0720;
343+
LastUpgradeCheck = 0730;
360344
TargetAttributes = {
361345
03E94AEB1C22595B009F8F29 = {
362346
CreatedOnToolsVersion = 7.2;
@@ -382,12 +366,6 @@
382366
mainGroup = 03E94AE21C22595B009F8F29;
383367
productRefGroup = 03E94AED1C22595B009F8F29 /* Products */;
384368
projectDirPath = "";
385-
projectReferences = (
386-
{
387-
ProductGroup = 03DE7D761C876DEF00F789BA /* Products */;
388-
ProjectRef = 03DE7D751C876DEF00F789BA /* KSCrash-iOS.xcodeproj */;
389-
},
390-
);
391369
projectRoot = "";
392370
targets = (
393371
03E94AEB1C22595B009F8F29 /* SentrySwift */,
@@ -398,37 +376,12 @@
398376
};
399377
/* End PBXProject section */
400378

401-
/* Begin PBXReferenceProxy section */
402-
03DE7D7C1C876DEF00F789BA /* libKSCrashLib.a */ = {
403-
isa = PBXReferenceProxy;
404-
fileType = archive.ar;
405-
path = libKSCrashLib.a;
406-
remoteRef = 03DE7D7B1C876DEF00F789BA /* PBXContainerItemProxy */;
407-
sourceTree = BUILT_PRODUCTS_DIR;
408-
};
409-
03DE7D7E1C876DEF00F789BA /* KSCrashTests.xctest */ = {
410-
isa = PBXReferenceProxy;
411-
fileType = wrapper.cfbundle;
412-
path = KSCrashTests.xctest;
413-
remoteRef = 03DE7D7D1C876DEF00F789BA /* PBXContainerItemProxy */;
414-
sourceTree = BUILT_PRODUCTS_DIR;
415-
};
416-
03DE7D801C876DEF00F789BA /* KSCrash.framework */ = {
417-
isa = PBXReferenceProxy;
418-
fileType = wrapper.framework;
419-
path = KSCrash.framework;
420-
remoteRef = 03DE7D7F1C876DEF00F789BA /* PBXContainerItemProxy */;
421-
sourceTree = BUILT_PRODUCTS_DIR;
422-
};
423-
/* End PBXReferenceProxy section */
424-
425379
/* Begin PBXResourcesBuildPhase section */
426380
03E94AEA1C22595B009F8F29 /* Resources */ = {
427381
isa = PBXResourcesBuildPhase;
428382
buildActionMask = 2147483647;
429383
files = (
430384
035242981C988D2F00A65D6D /* Abort.json in Resources */,
431-
035242921C988D2400A65D6D /* Info.plist in Resources */,
432385
035242991C988D2F00A65D6D /* Info.plist in Resources */,
433386
);
434387
runOnlyForDeploymentPostprocessing = 0;
@@ -705,6 +658,10 @@
705658
DYLIB_COMPATIBILITY_VERSION = 1;
706659
DYLIB_CURRENT_VERSION = 1;
707660
DYLIB_INSTALL_NAME_BASE = "@rpath";
661+
FRAMEWORK_SEARCH_PATHS = (
662+
"$(inherited)",
663+
"$(PROJECT_DIR)/Carthage/Build/iOS",
664+
);
708665
INFOPLIST_FILE = SentrySwift/Info.plist;
709666
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
710667
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@@ -728,6 +685,10 @@
728685
DYLIB_COMPATIBILITY_VERSION = 1;
729686
DYLIB_CURRENT_VERSION = 1;
730687
DYLIB_INSTALL_NAME_BASE = "@rpath";
688+
FRAMEWORK_SEARCH_PATHS = (
689+
"$(inherited)",
690+
"$(PROJECT_DIR)/Carthage/Build/iOS",
691+
);
731692
INFOPLIST_FILE = SentrySwift/Info.plist;
732693
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
733694
IPHONEOS_DEPLOYMENT_TARGET = 8.0;

SentrySwift.xcodeproj/xcshareddata/xcschemes/SentrySwift-iOS.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0720"
3+
LastUpgradeVersion = "0730"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

SentrySwift.xcodeproj/xcshareddata/xcschemes/SentrySwift.xcscheme

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "0720"
3+
LastUpgradeVersion = "0730"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

Sources/AppleCrashReport.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,4 @@ extension AppleCrashReport: EventSerializable {
3434
"system": system
3535
]
3636
}
37-
38-
}
37+
}

Sources/Breadcrumb.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -149,5 +149,4 @@ extension Breadcrumb: EventSerializable {
149149
"data": data
150150
]
151151
}
152-
153-
}
152+
}

Sources/BreadcrumbStore.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,4 @@ extension BreadcrumbStore: EventSerializable {
5353
public var serialized: SerializedType {
5454
return crumbs.values.flatMap{$0.map{$0.serialized}}.flatMap{$0}
5555
}
56-
57-
}
56+
}

Sources/CrashHandler.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ import Foundation
1111
@objc public protocol CrashHandler: EventProperties {
1212
var breadcrumbsSerialized: BreadcrumbStore.SerializedType? { get set }
1313
func startCrashReporting(createdEvent: (event: Event) -> ())
14-
}
14+
}

Sources/DSN.swift

-1
Original file line numberDiff line numberDiff line change
@@ -94,5 +94,4 @@ import Foundation
9494
// Removing first and getting second
9595
return url.pathComponents?.dropFirst().first
9696
}
97-
9897
}

Sources/Event.swift

+4-7
Original file line numberDiff line numberDiff line change
@@ -125,19 +125,16 @@ extension Event: EventSerializable {
125125
]
126126

127127
// Reduce attributes so only non-nill attribute are sent
128-
return attributes.reduce(SerializedType()) { (var serializedType, attribute) -> SerializedType in
128+
return attributes.reduce(SerializedType()) { serializedType, attribute in
129+
var output = serializedType
129130
if let value = attribute.value {
130-
serializedType[attribute.key] = value
131+
output[attribute.key] = value
131132
}
132-
return serializedType
133+
return output
133134
}
134135
}
135-
136-
137136
}
138137

139-
140-
141138
@objc public enum SentrySeverity: Int {
142139
case Fatal
143140
case Error

Sources/EventOffline.swift

-2
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,4 @@ extension SentryClient {
105105
let data = try NSJSONSerialization.dataWithJSONObject(event.serialized, options: [])
106106
return NSString(data: data, encoding: NSUTF8StringEncoding) as? String
107107
}
108-
109108
}
110-

Sources/EventProperties.swift

-1
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,4 @@ extension EventProperties {
6565

6666
return base
6767
}
68-
6968
}

Sources/EventSerializable.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ public typealias SerializedTypeArray = [SerializedTypeDictionary]
1414
/// A protocol used for complex structures (ex: Event, User, AppleCrashReport)
1515
/// on how to serialize them.
1616
public protocol EventSerializable {
17-
typealias SerializedType
17+
associatedtype SerializedType
1818
var serialized: SerializedType { get }
1919
}

Sources/KSCrashHandler.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ extension SentryClient {
141141
}
142142
}
143143

144-
145144
installation?.install()
146145
}
147146

@@ -172,4 +171,4 @@ extension SentryClient {
172171
userInfo?[keyBreadcrumbsSerialized] as? BreadcrumbStore.SerializedType
173172
)
174173
}
175-
}
174+
}

Sources/Request.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,4 @@ extension SentryClient {
6868
});
6969
task.resume()
7070
}
71-
72-
}
71+
}

Sources/Sentry.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -148,4 +148,4 @@ public struct SentryInfo {
148148
/// Platforms that this client is running on
149149
public enum OS {
150150
case IOS, OSX, Other
151-
}
151+
}

Sources/SentrySwift.h

-5
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,8 @@
88

99
#import <Foundation/Foundation.h>
1010

11-
#if TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR
12-
@import KSCrash;
13-
#endif
14-
1511
//! Project version number for SentrySwift.
1612
FOUNDATION_EXPORT double SentrySwiftVersionNumber;
1713

1814
//! Project version string for SentrySwift.
1915
FOUNDATION_EXPORT const unsigned char SentrySwiftVersionString[];
20-

Sources/User.swift

+1-2
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,4 @@ extension User: EventSerializable {
5656

5757
return info
5858
}
59-
60-
}
59+
}

0 commit comments

Comments
 (0)