Skip to content

Commit 8bbade3

Browse files
authored
Bugfix/cocoa deployment (#135)
* Update Crash CoreData and Data Model * Add CoreDataClass and CoreDataProperties NSManagedObject subclasses Disable code Generation * Remove .xcdatamodeld from Compile Sources Build Phase * Migrate Backtrace.podspec resources attribute to multi-platform resource_bundle * Add pod lib lint command to workflows and scripts * Add BacktraceResources bundle * Specify Podfile project .xcworkspace
1 parent 7809a9c commit 8bbade3

File tree

11 files changed

+319
-26
lines changed

11 files changed

+319
-26
lines changed

.github/workflows/deploy.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ jobs:
2929
- uses: actions/checkout@v3
3030
- name: Install dependencies
3131
run: sh scripts/install.sh
32+
- name: Run pod lib lint
33+
run: pod lib lint --verbose --allow-warnings --sources='https://cdn.cocoapods.org/'
3234
# END COPY PASTE FROM TEST.YML
3335

3436
deploy-cocoapods:

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,5 @@ jobs:
2929
- uses: actions/checkout@v3
3030
- name: Install dependencies
3131
run: sh scripts/install.sh
32+
- name: Run pod lib lint
33+
run: pod lib lint --verbose --allow-warnings --sources='https://cdn.cocoapods.org/'

Backtrace.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,6 @@ Pod::Spec.new do |s|
3333
s.tvos.public_header_files = ["Backtrace-tvOS/**/*.h*"]
3434
s.static_framework = true
3535
s.dependency "PLCrashReporter", '1.11'
36-
s.resources = 'Sources/**/*.xcdatamodeld'
36+
s.resource_bundle = { 'BacktraceResources' => 'Sources/**/*.xcdatamodeld' }
3737

3838
end

Backtrace.xcodeproj/project.pbxproj

Lines changed: 284 additions & 20 deletions
Large diffs are not rendered by default.

Podfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
source 'https://cdn.cocoapods.org/'
22

33
# Library
4+
project 'Backtrace.xcworkspace'
45

56
# Definitions
67
def shared_pods

Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ EXTERNAL SOURCES:
2222
:path: "./Backtrace.podspec"
2323

2424
SPEC CHECKSUMS:
25-
Backtrace: c0a4280935bff4ac8d84faedc5f79a7b582b9204
25+
Backtrace: a90dcc0f33cb29155c5b15209fbb5be30137ad29
2626
Nimble: 5316ef81a170ce87baf72dd961f22f89a602ff84
2727
PLCrashReporter: 7a9dff14a23ba5d2e28c6160f0bb6fada5e71a8d
2828
Quick: 749aa754fd1e7d984f2000fe051e18a3a9809179
2929

30-
PODFILE CHECKSUM: e47f2680ac506c05a737c701413cc45490f16077
30+
PODFILE CHECKSUM: 9879217fb9b028733c19f11520859f8869f67aba
3131

3232
COCOAPODS: 1.15.2

Sources/Features/Repository/PersistentRepository.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ final class PersistentRepository<Resource: PersistentStorable> {
3131
.persistentRepositoryInitError(details: "Couldn't find model url for name: \(momdName)")
3232
}
3333
#else
34-
guard let modelURL = Bundle(for: type(of: self)).url(forResource: momdName, withExtension: "momd") else {
34+
guard let bundleURL = Bundle(for: type(of: self)).url(forResource: "BacktraceResources", withExtension: "bundle"),
35+
let resourcesBundle = Bundle(url: bundleURL),
36+
let modelURL = resourcesBundle.url(forResource: momdName, withExtension: "momd") else {
3537
throw RepositoryError
3638
.persistentRepositoryInitError(details: "Couldn't find model url for name: \(momdName)")
3739
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Foundation
2+
import CoreData
3+
4+
@objc(Crash)
5+
public class Crash: NSManagedObject {}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import Foundation
2+
import CoreData
3+
4+
extension Crash {
5+
6+
@nonobjc public class func fetchRequest() -> NSFetchRequest<Crash> {
7+
return NSFetchRequest<Crash>(entityName: "Crash")
8+
}
9+
10+
@NSManaged public var attachmentPaths: [String]?
11+
@NSManaged public var dateAdded: Date?
12+
@NSManaged public var hashProperty: String?
13+
@NSManaged public var reportData: Data?
14+
@NSManaged public var retryCount: Int64
15+
16+
}

Sources/Features/Resources/Model.xcdatamodeld/Model.xcdatamodel/contents

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
2-
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="21513" systemVersion="22D68" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
3-
<entity name="Crash" representedClassName="Crash" syncable="YES" codeGenerationType="class">
2+
<model type="com.apple.IDECoreDataModeler.DataModel" documentVersion="1.0" lastSavedToolsVersion="22758" systemVersion="23F79" minimumToolsVersion="Automatic" sourceLanguage="Swift" userDefinedModelVersionIdentifier="">
3+
<entity name="Crash" representedClassName="Crash" syncable="YES">
44
<attribute name="attachmentPaths" attributeType="Transformable" valueTransformerName="" customClassName="[String]"/>
55
<attribute name="dateAdded" attributeType="Date" usesScalarValueType="NO"/>
66
<attribute name="hashProperty" attributeType="String"/>

0 commit comments

Comments
 (0)