Skip to content

Commit 1f0e6dd

Browse files
authored
Merge pull request #74 from opendocument-app/feature/conan
conan build
2 parents ddc74c9 + 5d0dec0 commit 1f0e6dd

19 files changed

Lines changed: 93 additions & 373 deletions

.github/workflows/ios_main.yml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on: [push]
44
jobs:
55
test:
66
name: test
7-
runs-on: macos-latest
7+
runs-on: macos-11
88
steps:
99
- name: checkout
1010
uses: actions/checkout@v2
@@ -15,18 +15,19 @@ jobs:
1515
- name: pods
1616
run: pod install
1717

18-
- name: brew
19-
run: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null
20-
- name: fix ninja install
21-
run: rm '/usr/local/bin/2to3'
22-
- name: ninja
23-
run: brew install ninja
2418
# https://stackoverflow.com/a/57758679/198996
2519
- name: bundler
2620
run: gem install bundler:1.17.3
2721
- name: fastlane
2822
run: bundle install
2923

24+
- name: pip
25+
run: python3 -m ensurepip
26+
- name: conan
27+
run: pip3 install conan
28+
- name: conan repo
29+
run: conan remote add odr https://odr.jfrog.io/artifactory/api/conan/odr-conan
30+
3031
- name: run tests
3132
run: bundle exec fastlane tests
3233
# - uses: actions/upload-artifact@v2

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,8 @@ fastlane/test_output
7070
.DS_Store
7171

7272
fastlane/report.xml
73+
74+
conanbuildinfo.*
75+
conaninfo.txt
76+
conan.lock
77+
graph_info.json

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
[submodule "OpenDocument.core"]
2-
path = OpenDocument.core
3-
url = https://github.com/andiwand/OpenDocument.core.git
41
[submodule "ios-cmake"]
52
path = ios-cmake
63
url = https://github.com/leetal/ios-cmake.git

OpenDocument.core

Lines changed: 0 additions & 1 deletion
This file was deleted.

OpenDocumentReader.xcodeproj/project.pbxproj

Lines changed: 33 additions & 340 deletions
Large diffs are not rendered by default.

OpenDocumentReader/CoreWrapper.mm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,10 @@ - (bool)translate:(NSString *)inputPath into:(NSString *)outputPath with:(NSStri
6363

6464
_pageNames = pageNames;
6565
_pagePaths = pagePaths;
66-
} catch (odr::UnknownFileType) {
66+
} catch (odr::UnknownFileType&) {
6767
_errorCode = @(-5);
6868
return false;
69-
} catch (odr::WrongPassword) {
69+
} catch (odr::WrongPassword&) {
7070
_errorCode = @(-2);
7171
return false;
7272
} catch (...) {

OpenDocumentReader/Document.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,10 @@ class Document: UIDocument {
125125
delegate?.documentLoadingCompleted(self)
126126
}
127127

128+
override func handleError(_ error: Error, userInteractionPermitted: Bool) {
129+
Crashlytics.crashlytics().record(error: error)
130+
}
131+
128132
override func writeContents(_ contents: Any, to url: URL, for saveOperation: UIDocument.SaveOperation, originalContentsURL: URL?) throws {
129133
var diff = ""
130134

OpenDocumentReader/DocumentViewController.swift

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,6 @@ class DocumentViewController: UIViewController, DocumentDelegate, GADBannerViewD
233233
webview?.evaluateJavaScript("odr.searchNext(\"" + searchText + "\")", completionHandler: { (value: Any!, error: Error!) -> Void in
234234
if error != nil {
235235
Crashlytics.crashlytics().record(error: error)
236-
fatalError("search failed")
237236
}
238237
})
239238
}
@@ -242,7 +241,6 @@ class DocumentViewController: UIViewController, DocumentDelegate, GADBannerViewD
242241
webview?.evaluateJavaScript("odr.search(\"" + searchText + "\")", completionHandler: { (value: Any!, error: Error!) -> Void in
243242
if error != nil {
244243
Crashlytics.crashlytics().record(error: error)
245-
fatalError("search failed")
246244
}
247245
})
248246
}

OpenDocumentReaderTests/OpenDocumentReaderTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ class OpenDocumentReaderTests: XCTestCase {
5656
var translatePath = URL(fileURLWithPath: NSTemporaryDirectory())
5757
translatePath.appendPathComponent("translate.html")
5858

59-
coreWrapper.translate(saveURL?.path, into: translatePath.path, at: 0, with: nil, editable: true)
59+
coreWrapper.translate(saveURL?.path, into: translatePath.path, with: nil, editable: true)
6060
XCTAssertNil(coreWrapper.errorCode)
6161

6262
var backTranslatePath = URL(fileURLWithPath: NSTemporaryDirectory())
6363
backTranslatePath.appendPathComponent("backtranslate.html")
6464

65-
let diff = "{\"modifiedText\":{\"3\":\"This is a simple test document to demonstrate the DocumentLoadewwwwr example!\"}}"
65+
let diff = "{\"modifiedText\":{\"/child:3/child:0\":\"This is a simple test document to demonstrate the DocumentLoaderwwww example!\"}}"
6666

6767
coreWrapper.backTranslate(diff, into: backTranslatePath.path)
6868
XCTAssertNil(coreWrapper.errorCode)

README.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
It's Android's first OpenOffice Document Reader... for iOS!
33

44
## Setup
5-
1. run "git submodule update --init --recursive"
6-
2. run "pod install"
7-
3. run "bash build-simulator.sh" or "bash build-device.sh"
8-
4. open workspace in Xcode
5+
1. run "pod install"
6+
2. run "bash build-simulator.sh" or "bash build-device.sh"
7+
3. open workspace in Xcode

0 commit comments

Comments
 (0)