Skip to content

Commit 74f9005

Browse files
author
Thomas Taschauer
committed
upgrade dependencies, add unit tests
1 parent d0a32cf commit 74f9005

8 files changed

Lines changed: 456 additions & 122 deletions

File tree

OpenDocumentReader.xcodeproj/project.pbxproj

Lines changed: 255 additions & 23 deletions
Large diffs are not rendered by default.

OpenDocumentReader.xcodeproj/xcshareddata/xcschemes/ODR Full.xcscheme

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,16 @@
3737
</BuildableReference>
3838
</MacroExpansion>
3939
<Testables>
40+
<TestableReference
41+
skipped = "NO">
42+
<BuildableReference
43+
BuildableIdentifier = "primary"
44+
BlueprintIdentifier = "E22B252B2557F0E2001D0C52"
45+
BuildableName = "OpenDocumentReaderTests.xctest"
46+
BlueprintName = "OpenDocumentReaderTests"
47+
ReferencedContainer = "container:OpenDocumentReader.xcodeproj">
48+
</BuildableReference>
49+
</TestableReference>
4050
</Testables>
4151
</TestAction>
4252
<LaunchAction

OpenDocumentReader.xcodeproj/xcshareddata/xcschemes/ODR Lite.xcscheme

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,16 @@
2828
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
2929
shouldUseLaunchSchemeArgsEnv = "YES">
3030
<Testables>
31+
<TestableReference
32+
skipped = "NO">
33+
<BuildableReference
34+
BuildableIdentifier = "primary"
35+
BlueprintIdentifier = "E22B252B2557F0E2001D0C52"
36+
BuildableName = "OpenDocumentReaderTests.xctest"
37+
BlueprintName = "OpenDocumentReaderTests"
38+
ReferencedContainer = "container:OpenDocumentReader.xcodeproj">
39+
</BuildableReference>
40+
</TestableReference>
3141
</Testables>
3242
</TestAction>
3343
<LaunchAction

OpenDocumentReaderTests/Info.plist

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>$(DEVELOPMENT_LANGUAGE)</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleVersion</key>
20+
<string>1</string>
21+
</dict>
22+
</plist>
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
//
2+
// OpenDocumentReaderTests.swift
3+
// OpenDocumentReaderTests
4+
//
5+
// Created by Thomas Taschauer on 08.11.20.
6+
// Copyright © 2020 Thomas Taschauer. All rights reserved.
7+
//
8+
9+
import XCTest
10+
11+
@testable import OpenDocumentReader
12+
13+
class OpenDocumentReaderTests: XCTestCase {
14+
15+
private var saveURL: URL?
16+
17+
override func setUpWithError() throws {
18+
let url = URL(string: "https://api.libreoffice.org/examples/cpp/DocumentLoader/test.odt")
19+
20+
let documentsURL = try
21+
FileManager.default.url(for: .documentDirectory,
22+
in: .userDomainMask,
23+
appropriateFor: nil,
24+
create: false)
25+
26+
saveURL = documentsURL.appendingPathComponent(url!.lastPathComponent)
27+
28+
if (FileManager.default.fileExists(atPath: saveURL!.path)) {
29+
return
30+
}
31+
32+
let downloadTask = URLSession.shared.downloadTask(with: url!) {
33+
urlOrNil, responseOrNil, errorOrNil in
34+
// check for and handle errors:
35+
// * errorOrNil should be nil
36+
// * responseOrNil should be an HTTPURLResponse with statusCode in 200..<299
37+
38+
guard let fileURL = urlOrNil else { return }
39+
do {
40+
try FileManager.default.moveItem(at: fileURL, to: self.saveURL!)
41+
} catch {
42+
print ("file error: \(error)")
43+
}
44+
}
45+
downloadTask.resume()
46+
}
47+
48+
func testExample() throws {
49+
measure {
50+
let coreWrapper = CoreWrapper()
51+
52+
var translatePath = URL(fileURLWithPath: NSTemporaryDirectory())
53+
translatePath.appendPathComponent("translate.html")
54+
55+
coreWrapper.translate(saveURL?.path, into: translatePath.path, at: 0, with: nil, editable: true)
56+
XCTAssert(coreWrapper.errorCode == nil)
57+
58+
var backTranslatePath = URL(fileURLWithPath: NSTemporaryDirectory())
59+
backTranslatePath.appendPathComponent("backtranslate.html")
60+
61+
let diff = "{\"modifiedText\":{\"3\":\"This is a simple test document to demonstrate the DocumentLoadewwwwr example!\"}}"
62+
63+
coreWrapper.backTranslate(diff, into: backTranslatePath.path)
64+
XCTAssert(coreWrapper.errorCode == nil)
65+
}
66+
}
67+
}

Podfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,8 @@ target 'OpenDocumentReader' do
1010
pod 'Google-Mobile-Ads-SDK'
1111
pod 'Firebase/Crashlytics'
1212
pod 'Firebase/Analytics'
13+
14+
target 'OpenDocumentReaderTests' do
15+
inherit! :search_paths
16+
end
1317
end

Podfile.lock

Lines changed: 84 additions & 96 deletions
Original file line numberDiff line numberDiff line change
@@ -1,93 +1,87 @@
11
PODS:
2-
- Firebase/Analytics (6.22.0):
2+
- Firebase/Analytics (7.0.0):
33
- Firebase/Core
4-
- Firebase/Core (6.22.0):
4+
- Firebase/Core (7.0.0):
55
- Firebase/CoreOnly
6-
- FirebaseAnalytics (= 6.4.1)
7-
- Firebase/CoreOnly (6.22.0):
8-
- FirebaseCore (= 6.6.6)
9-
- Firebase/Crashlytics (6.22.0):
6+
- FirebaseAnalytics (= 7.0.0)
7+
- Firebase/CoreOnly (7.0.0):
8+
- FirebaseCore (= 7.0.0)
9+
- Firebase/Crashlytics (7.0.0):
1010
- Firebase/CoreOnly
11-
- FirebaseCrashlytics (~> 4.0.0-beta.7)
12-
- Firebase/Storage (6.22.0):
11+
- FirebaseCrashlytics (~> 7.0.0)
12+
- Firebase/Storage (7.0.0):
1313
- Firebase/CoreOnly
14-
- FirebaseStorage (~> 3.6.0)
15-
- FirebaseAnalytics (6.4.1):
16-
- FirebaseCore (~> 6.6)
17-
- FirebaseInstallations (~> 1.1)
18-
- GoogleAppMeasurement (= 6.4.1)
19-
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
20-
- GoogleUtilities/MethodSwizzler (~> 6.0)
21-
- GoogleUtilities/Network (~> 6.0)
22-
- "GoogleUtilities/NSData+zlib (~> 6.0)"
23-
- nanopb (= 0.3.9011)
24-
- FirebaseAnalyticsInterop (1.5.0)
25-
- FirebaseAuthInterop (1.1.0)
26-
- FirebaseCore (6.6.6):
27-
- FirebaseCoreDiagnostics (~> 1.2)
28-
- FirebaseCoreDiagnosticsInterop (~> 1.2)
29-
- GoogleUtilities/Environment (~> 6.5)
30-
- GoogleUtilities/Logger (~> 6.5)
31-
- FirebaseCoreDiagnostics (1.2.3):
32-
- FirebaseCoreDiagnosticsInterop (~> 1.2)
33-
- GoogleDataTransportCCTSupport (~> 2.0)
34-
- GoogleUtilities/Environment (~> 6.5)
35-
- GoogleUtilities/Logger (~> 6.5)
36-
- nanopb (~> 0.3.901)
37-
- FirebaseCoreDiagnosticsInterop (1.2.0)
38-
- FirebaseCrashlytics (4.0.0-beta.7):
39-
- FirebaseAnalyticsInterop (~> 1.2)
40-
- FirebaseCore (~> 6.6)
41-
- FirebaseInstallations (~> 1.1)
42-
- GoogleDataTransport (>= 5.1.1, ~> 5.1)
43-
- GoogleDataTransportCCTSupport (>= 2.0.2, ~> 2.0)
44-
- nanopb (~> 0.3.901)
14+
- FirebaseStorage (~> 7.0.0)
15+
- FirebaseAnalytics (7.0.0):
16+
- FirebaseCore (~> 7.0)
17+
- FirebaseInstallations (~> 7.0)
18+
- GoogleAppMeasurement (= 7.0.0)
19+
- GoogleUtilities/AppDelegateSwizzler (~> 7.0)
20+
- GoogleUtilities/MethodSwizzler (~> 7.0)
21+
- GoogleUtilities/Network (~> 7.0)
22+
- "GoogleUtilities/NSData+zlib (~> 7.0)"
23+
- nanopb (~> 2.30906.0)
24+
- FirebaseCore (7.0.0):
25+
- FirebaseCoreDiagnostics (~> 7.0)
26+
- GoogleUtilities/Environment (~> 7.0)
27+
- GoogleUtilities/Logger (~> 7.0)
28+
- FirebaseCoreDiagnostics (7.0.0):
29+
- GoogleDataTransport (~> 8.0)
30+
- GoogleUtilities/Environment (~> 7.0)
31+
- GoogleUtilities/Logger (~> 7.0)
32+
- nanopb (~> 2.30906.0)
33+
- FirebaseCrashlytics (7.0.0):
34+
- FirebaseCore (~> 7.0)
35+
- FirebaseInstallations (~> 7.0)
36+
- GoogleDataTransport (~> 8.0)
37+
- nanopb (~> 2.30906.0)
4538
- PromisesObjC (~> 1.2)
46-
- FirebaseInstallations (1.1.1):
47-
- FirebaseCore (~> 6.6)
48-
- GoogleUtilities/UserDefaults (~> 6.5)
39+
- FirebaseInstallations (7.0.0):
40+
- FirebaseCore (~> 7.0)
41+
- GoogleUtilities/Environment (~> 7.0)
42+
- GoogleUtilities/UserDefaults (~> 7.0)
4943
- PromisesObjC (~> 1.2)
50-
- FirebaseStorage (3.6.0):
51-
- FirebaseAuthInterop (~> 1.1)
52-
- FirebaseCore (~> 6.6)
53-
- GTMSessionFetcher/Core (~> 1.1)
54-
- Google-Mobile-Ads-SDK (7.58.0):
55-
- GoogleAppMeasurement (~> 6.0)
56-
- GoogleAppMeasurement (6.4.1):
57-
- GoogleUtilities/AppDelegateSwizzler (~> 6.0)
58-
- GoogleUtilities/MethodSwizzler (~> 6.0)
59-
- GoogleUtilities/Network (~> 6.0)
60-
- "GoogleUtilities/NSData+zlib (~> 6.0)"
61-
- nanopb (= 0.3.9011)
62-
- GoogleDataTransport (5.1.1)
63-
- GoogleDataTransportCCTSupport (2.0.2):
64-
- GoogleDataTransport (~> 5.1)
65-
- nanopb (~> 0.3.901)
66-
- GoogleUtilities/AppDelegateSwizzler (6.5.2):
44+
- FirebaseStorage (7.0.0):
45+
- FirebaseCore (~> 7.0)
46+
- GTMSessionFetcher/Core (~> 1.4)
47+
- Google-Mobile-Ads-SDK (7.68.0):
48+
- GoogleAppMeasurement (~> 7.0)
49+
- GoogleUserMessagingPlatform (~> 1.1)
50+
- GoogleAppMeasurement (7.0.0):
51+
- GoogleUtilities/AppDelegateSwizzler (~> 7.0)
52+
- GoogleUtilities/MethodSwizzler (~> 7.0)
53+
- GoogleUtilities/Network (~> 7.0)
54+
- "GoogleUtilities/NSData+zlib (~> 7.0)"
55+
- nanopb (~> 2.30906.0)
56+
- GoogleDataTransport (8.0.0):
57+
- nanopb (~> 2.30906.0)
58+
- GoogleUserMessagingPlatform (1.3.0)
59+
- GoogleUtilities/AppDelegateSwizzler (7.0.0):
6760
- GoogleUtilities/Environment
6861
- GoogleUtilities/Logger
6962
- GoogleUtilities/Network
70-
- GoogleUtilities/Environment (6.5.2)
71-
- GoogleUtilities/Logger (6.5.2):
63+
- GoogleUtilities/Environment (7.0.0):
64+
- PromisesObjC (~> 1.2)
65+
- GoogleUtilities/Logger (7.0.0):
7266
- GoogleUtilities/Environment
73-
- GoogleUtilities/MethodSwizzler (6.5.2):
67+
- GoogleUtilities/MethodSwizzler (7.0.0):
7468
- GoogleUtilities/Logger
75-
- GoogleUtilities/Network (6.5.2):
69+
- GoogleUtilities/Network (7.0.0):
7670
- GoogleUtilities/Logger
7771
- "GoogleUtilities/NSData+zlib"
7872
- GoogleUtilities/Reachability
79-
- "GoogleUtilities/NSData+zlib (6.5.2)"
80-
- GoogleUtilities/Reachability (6.5.2):
73+
- "GoogleUtilities/NSData+zlib (7.0.0)"
74+
- GoogleUtilities/Reachability (7.0.0):
8175
- GoogleUtilities/Logger
82-
- GoogleUtilities/UserDefaults (6.5.2):
76+
- GoogleUtilities/UserDefaults (7.0.0):
8377
- GoogleUtilities/Logger
84-
- GTMSessionFetcher/Core (1.3.1)
85-
- nanopb (0.3.9011):
86-
- nanopb/decode (= 0.3.9011)
87-
- nanopb/encode (= 0.3.9011)
88-
- nanopb/decode (0.3.9011)
89-
- nanopb/encode (0.3.9011)
90-
- PromisesObjC (1.2.8)
78+
- GTMSessionFetcher/Core (1.5.0)
79+
- nanopb (2.30906.0):
80+
- nanopb/decode (= 2.30906.0)
81+
- nanopb/encode (= 2.30906.0)
82+
- nanopb/decode (2.30906.0)
83+
- nanopb/encode (2.30906.0)
84+
- PromisesObjC (1.2.11)
9185
- ScrollableSegmentedControl (1.5.0)
9286

9387
DEPENDENCIES:
@@ -102,45 +96,39 @@ SPEC REPOS:
10296
trunk:
10397
- Firebase
10498
- FirebaseAnalytics
105-
- FirebaseAnalyticsInterop
106-
- FirebaseAuthInterop
10799
- FirebaseCore
108100
- FirebaseCoreDiagnostics
109-
- FirebaseCoreDiagnosticsInterop
110101
- FirebaseCrashlytics
111102
- FirebaseInstallations
112103
- FirebaseStorage
113104
- Google-Mobile-Ads-SDK
114105
- GoogleAppMeasurement
115106
- GoogleDataTransport
116-
- GoogleDataTransportCCTSupport
107+
- GoogleUserMessagingPlatform
117108
- GoogleUtilities
118109
- GTMSessionFetcher
119110
- nanopb
120111
- PromisesObjC
121112
- ScrollableSegmentedControl
122113

123114
SPEC CHECKSUMS:
124-
Firebase: 32f9520684e87c7af3f0704f7f88042626d6b536
125-
FirebaseAnalytics: 83f822fd0d33a46f49f89b8c3ab16ab4d89df08a
126-
FirebaseAnalyticsInterop: 3f86269c38ae41f47afeb43ebf32a001f58fcdae
127-
FirebaseAuthInterop: a0f37ae05833af156e72028f648d313f7e7592e9
128-
FirebaseCore: 9aca0f1fffb405176ba15311a5621fcde4106fcf
129-
FirebaseCoreDiagnostics: 13a6564cd6d5375066bbc8940cc1753af24497f3
130-
FirebaseCoreDiagnosticsInterop: 296e2c5f5314500a850ad0b83e9e7c10b011a850
131-
FirebaseCrashlytics: ad2e8527a7efd9a7e708d5abe57318ced2e1dbd1
132-
FirebaseInstallations: acb3216eb9784d3b1d2d2d635ff74fa892cc0c44
133-
FirebaseStorage: b43ee271294227e1a3225544b073f3b49b427f46
134-
Google-Mobile-Ads-SDK: 7052557293c75c676db55feb707ace9b790f32c1
135-
GoogleAppMeasurement: e49be3954045b17d046f271b9cc1ec052bad9702
136-
GoogleDataTransport: 6ffa4dd0b6d547f8d27b91bd92fa9e197a3f5f1f
137-
GoogleDataTransportCCTSupport: 12f02e5c8f09c055615de90bcd5ba2c375546051
138-
GoogleUtilities: ad0f3b691c67909d03a3327cc205222ab8f42e0e
139-
GTMSessionFetcher: cea130bbfe5a7edc8d06d3f0d17288c32ffe9925
140-
nanopb: 18003b5e52dab79db540fe93fe9579f399bd1ccd
141-
PromisesObjC: c119f3cd559f50b7ae681fa59dc1acd19173b7e6
115+
Firebase: 50be68416f50eb4eb2ecb0e78acab9a051ef95df
116+
FirebaseAnalytics: c1166b7990bae464c6436132510bb718c6680f80
117+
FirebaseCore: cf3122185fce1cf71cedbbc498ea84d2b3e7cb69
118+
FirebaseCoreDiagnostics: 5f4aa04fdb04923693cc704c7ef9158bdf41a48b
119+
FirebaseCrashlytics: bd430b7323e8b49492a93e563e81899d0615f917
120+
FirebaseInstallations: c28d4bcbb5c6884d1a39afbc0bd7fc590e31e9b7
121+
FirebaseStorage: ea52bc7a1cb540406ed1e1acfc2bf3946621ed34
122+
Google-Mobile-Ads-SDK: 29bbdb182d69ff606cc0301da1590b40be8d2205
123+
GoogleAppMeasurement: 7790ef975d1d463c8614cd949a847e612edf087a
124+
GoogleDataTransport: 6ce8004a961db1b905740d7be106c61ba7e89c21
125+
GoogleUserMessagingPlatform: 1d4b6946710d18cec34742054092e2c2bddae61f
126+
GoogleUtilities: ffb2f4159f2c897c6e8992bd7fbcdef8a300589c
127+
GTMSessionFetcher: b3503b20a988c4e20cc189aa798fd18220133f52
128+
nanopb: 1bf24dd71191072e120b83dd02d08f3da0d65e53
129+
PromisesObjC: 8c196f5a328c2cba3e74624585467a557dcb482f
142130
ScrollableSegmentedControl: 2e64bbe8968a7fcd8aae5014434481464fcdfe60
143131

144-
PODFILE CHECKSUM: 29b95d485a27c81711e78d9b14662503a45807e8
132+
PODFILE CHECKSUM: 81230f2a7c739520d917e920cbe16ed450bc19b4
145133

146134
COCOAPODS: 1.9.1

upload-symbols.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
1-
#!/bin/bash
1+
TODAY=$(date '+%Y-%m-%d')
22

3-
Pods/FirebaseCrashlytics/upload-symbols -gsp OpenDocumentReader/GoogleService-Info.plist -p ios ~/Downloads/appDsyms-full.zip
3+
Pods/FirebaseCrashlytics/upload-symbols -gsp OpenDocumentReader/GoogleService-Info.plist -p ios ~/Library/Developer/Xcode/Archives/$TODAY/OpenDocumentReader\ Full*.xcarchive/dSYMs/
4+
5+
Pods/FirebaseCrashlytics/upload-symbols -gsp OpenDocumentReader/GoogleService-Info-Lite.plist -p ios ~/Library/Developer/Xcode/Archives/$TODAY/OpenDocumentReader\ Lite*.xcarchive/dSYMs/
46

5-
Pods/FirebaseCrashlytics/upload-symbols -gsp OpenDocumentReader/GoogleService-Info-Lite.plist -p ios ~/Downloads/appDsyms-lite.zip

0 commit comments

Comments
 (0)