Skip to content

Commit 51e7374

Browse files
authored
conan 2 (#80)
1 parent fafdc22 commit 51e7374

22 files changed

Lines changed: 194 additions & 210 deletions

.github/workflows/ios_main.yml

Lines changed: 56 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,72 @@
11
name: OpenDocumentReader-iOS
2-
on: [push]
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
pull_request:
9+
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
12+
cancel-in-progress: true
313

414
jobs:
515
test:
6-
name: test
7-
runs-on: macos-11
16+
runs-on: macos-14
817
steps:
918
- name: checkout
10-
uses: actions/checkout@v2
19+
uses: actions/checkout@v4
20+
21+
- uses: actions/setup-python@v5
22+
with:
23+
python-version: "3.10"
1124

12-
- name: pods
25+
- uses: maxim-lobanov/setup-xcode@v1
26+
with:
27+
xcode-version: "15.4"
28+
29+
- name: install pods
1330
run: pod install
1431

1532
# https://stackoverflow.com/a/57758679/198996
16-
- name: bundler
33+
- name: install bundler
1734
run: gem install bundler:1.17.3
18-
- name: fastlane
35+
- name: install fastlane
1936
run: bundle install
2037

21-
- name: pip
22-
run: python3 -m ensurepip
23-
- name: conan
24-
run: pip3 install conan==1.64.1
25-
- name: conan repo
26-
run: |
27-
conan remote clean
28-
conan remote add odr https://artifactory.opendocument.app/artifactory/api/conan/conan
29-
conan remote add conancenter https://center.conan.io
38+
- name: install conan
39+
run: pip3 install conan
40+
41+
- name: conan remote
42+
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
43+
- name: conan login
44+
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}
45+
46+
- name: conan profile
47+
run: conan profile detect
48+
49+
- name: conan install
50+
run: >
51+
conan install conan/
52+
--output-folder=conan-output
53+
--build=missing
54+
--profile:host=conan/profiles/ios-simulator-arm64
55+
-s build_type=Release
56+
-s "&:build_type=RelWithDebInfo"
57+
-s "odrcore/*:build_type=RelWithDebInfo"
58+
- name: conan patch
59+
run: bash conan/patch.sh
3060

3161
- name: run tests
3262
run: bundle exec fastlane tests
33-
# - uses: actions/upload-artifact@v2
34-
# if: ${{ always() }}
35-
# with:
36-
# name: logs
37-
# path: |
38-
# /Users/runner/Library/Developer/Xcode/DerivedData/OpenDocumentReader-*/
63+
64+
- uses: actions/upload-artifact@v4
65+
if: always()
66+
with:
67+
name: logs
68+
path: |
69+
/Users/runner/Library/Developer/Xcode/DerivedData/OpenDocumentReader-*/
70+
71+
- name: upload binaries to conan repo
72+
run: conan upload "*" --check --confirm --remote odr

.gitignore

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,5 @@ fastlane/test_output
7171

7272
fastlane/report.xml
7373

74-
conanbuildinfo.*
75-
conaninfo.txt
76-
conan.lock
74+
conan-output/
7775
graph_info.json

OpenDocumentReader.xcodeproj/project.pbxproj

Lines changed: 35 additions & 122 deletions
Large diffs are not rendered by default.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1020"
3+
LastUpgradeVersion = "1540"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
3-
LastUpgradeVersion = "1130"
3+
LastUpgradeVersion = "1540"
44
version = "1.3">
55
<BuildAction
66
parallelizeBuildables = "YES"

OpenDocumentReader/CoreWrapper.mm

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,18 @@
1010

1111
#import "CoreWrapper.h"
1212

13-
#include <string>
14-
#include <optional>
15-
#include <string>
16-
#include <optional>
1713
#include <odr/document.hpp>
1814
#include <odr/document_element.hpp>
1915
#include <odr/file.hpp>
2016
#include <odr/html.hpp>
2117
#include <odr/open_document_reader.hpp>
2218
#include <odr/exceptions.hpp>
2319

20+
#include <string>
21+
#include <optional>
22+
#include <string>
23+
#include <optional>
24+
2425
@implementation CoreWrapper {
2526
std::optional<odr::Html> html;
2627
}

build-device.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

build-simulator.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

conan/conanfile.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
from conan import ConanFile
2+
from conan.tools.apple import XcodeDeps, XcodeToolchain
3+
4+
class Pkg(ConanFile):
5+
settings = "os", "compiler", "arch", "build_type"
6+
options = {"configuration": ["Debug", "Debug Lite", "Release", "Release Lite"]}
7+
default_options = {"configuration": "Debug"}
8+
requires = "odrcore/3.0.0"
9+
10+
def generate(self):
11+
xcode = XcodeDeps(self)
12+
xcode.configuration = self.options.configuration
13+
xcode.generate()
14+
15+
tc = XcodeToolchain(self)
16+
tc.configuration = self.options.configuration
17+
tc.generate()

conan/patch.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
echo "patch conan generated xcconfig files"
6+
7+
# patch xcconfig - see https://github.com/conan-io/conan/issues/16526
8+
sed -i '' -E 's/\]\[arch=arm64\]\[/][/g;t' conan-output/*.xcconfig
9+
sed -i '' -E 's/\]\[arch=x86_64\]\[/][/g;t' conan-output/*.xcconfig
10+
11+
echo "done"

0 commit comments

Comments
 (0)