Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

conan 2 #80

Merged
merged 34 commits into from
Jun 23, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
6939b7c
draft
andiwand May 28, 2024
a187e5c
udpate workflow
andiwand Jun 1, 2024
c5748b8
conan install
andiwand Jun 1, 2024
56f361c
disable login and upload for now
andiwand Jun 1, 2024
ec45b12
try again
andiwand Jun 1, 2024
d679f10
try again
andiwand Jun 1, 2024
b59024a
try again
andiwand Jun 1, 2024
7da7cbf
reorganize
andiwand Jun 1, 2024
b2137bc
fix path
andiwand Jun 1, 2024
7b7d726
refactor
andiwand Jun 1, 2024
cc6c223
steal pauls ci workflow
andiwand Jun 11, 2024
c046ed2
use setup python
andiwand Jun 11, 2024
3bada7c
remove build
andiwand Jun 11, 2024
fee258b
hi
andiwand Jun 20, 2024
1b67e8c
hi
andiwand Jun 21, 2024
afdb013
hi
andiwand Jun 22, 2024
e0e8168
fix action
andiwand Jun 22, 2024
6014346
try again
andiwand Jun 22, 2024
52d5a1c
try again
andiwand Jun 22, 2024
5a6d239
try again
andiwand Jun 22, 2024
e3a80d9
try again
andiwand Jun 22, 2024
031776a
try again
andiwand Jun 22, 2024
1809a4b
patch conan files
andiwand Jun 22, 2024
eb4f3fb
hi
andiwand Jun 23, 2024
64dda2d
clean
andiwand Jun 23, 2024
f0463cb
try patch again
andiwand Jun 23, 2024
e42be40
fix fastlane
andiwand Jun 23, 2024
353ccae
clean project
andiwand Jun 23, 2024
741e2f6
extend patch
andiwand Jun 23, 2024
fe04c56
patch again
andiwand Jun 23, 2024
a512564
Update .github/workflows/ios_main.yml
andiwand Jun 23, 2024
e503623
Merge branch 'main' of github.com:opendocument-app/OpenDocument.ios i…
andiwand Jun 23, 2024
0d1c104
Merge branch 'conan-2' of github.com:opendocument-app/OpenDocument.io…
andiwand Jun 23, 2024
e63a397
use current xcode
andiwand Jun 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 54 additions & 20 deletions .github/workflows/ios_main.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,72 @@
name: OpenDocumentReader-iOS
on: [push]

on:
workflow_dispatch:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
test:
name: test
runs-on: macos-11
runs-on: macos-14
steps:
- name: checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
token: ${{ secrets.PAT_TOMTASCHE }}
submodules: true
python-version: "3.10"

- name: pods
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: "15.0.1"

- name: install pods
run: pod install

# https://stackoverflow.com/a/57758679/198996
- name: bundler
- name: install bundler
run: gem install bundler:1.17.3
- name: fastlane
- name: install fastlane
run: bundle install

- name: pip
run: python3 -m ensurepip
- name: conan
- name: install conan
run: pip3 install conan
- name: conan repo
run: conan remote add odr https://odr.jfrog.io/artifactory/api/conan/odr-conan

- name: conan remote
run: conan remote add --index 0 odr https://artifactory.opendocument.app/artifactory/api/conan/conan
- name: conan login
run: conan remote login odr admin --password ${{ secrets.ARTIFACTORY }}

- name: conan profile
run: conan profile detect

- name: conan install
run: >
conan install conan/
--output-folder=conan-output
--build=missing
--profile:host=conan/profiles/ios-simulator-x64
andiwand marked this conversation as resolved.
Show resolved Hide resolved
-s build_type=Release
-s "&:build_type=RelWithDebInfo"
-s "odrcore/*:build_type=RelWithDebInfo"
- name: conan patch
run: bash conan/patch.sh

- name: run tests
run: bundle exec fastlane tests
# - uses: actions/upload-artifact@v2
# if: ${{ always() }}
# with:
# name: logs
# path: |
# /Users/runner/Library/Developer/Xcode/DerivedData/OpenDocumentReader-*/

- uses: actions/upload-artifact@v4
if: always()
with:
name: logs
path: |
/Users/runner/Library/Developer/Xcode/DerivedData/OpenDocumentReader-*/

- name: upload binaries to conan repo
run: conan upload "*" --check --confirm --remote odr
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,5 @@ fastlane/test_output

fastlane/report.xml

conanbuildinfo.*
conaninfo.txt
conan.lock
conan-output/
graph_info.json
181 changes: 43 additions & 138 deletions OpenDocumentReader.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1130"
LastUpgradeVersion = "1540"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
10 changes: 5 additions & 5 deletions OpenDocumentReader/CoreWrapper.mm
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@

#import "CoreWrapper.h"

#include <string>
#include <optional>
#include <string>
#include <optional>
#include <odr/document.hpp>
#include <odr/document_cursor.hpp>
#include <odr/document_element.hpp>
#include <odr/file.hpp>
#include <odr/html.hpp>
#include <odr/open_document_reader.hpp>
#include <odr/exceptions.hpp>

#include <string>
#include <optional>
#include <string>
#include <optional>

@implementation CoreWrapper {
std::optional<odr::Html> html;
}
Expand Down
2 changes: 1 addition & 1 deletion Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 35cd182dc790891ebc7626066c33a6e947e7167e

COCOAPODS: 1.12.1
COCOAPODS: 1.15.2
7 changes: 0 additions & 7 deletions build-device.sh

This file was deleted.

7 changes: 0 additions & 7 deletions build-simulator.sh

This file was deleted.

17 changes: 17 additions & 0 deletions conan/conanfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from conan import ConanFile
from conan.tools.apple import XcodeDeps, XcodeToolchain

class Pkg(ConanFile):
settings = "os", "compiler", "arch", "build_type"
options = {"configuration": ["Debug", "Debug Lite", "Release", "Release Lite"]}
default_options = {"configuration": "Debug"}
requires = "odrcore/3.0.0"

def generate(self):
xcode = XcodeDeps(self)
xcode.configuration = self.options.configuration
xcode.generate()

tc = XcodeToolchain(self)
tc.configuration = self.options.configuration
tc.generate()
11 changes: 11 additions & 0 deletions conan/patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env bash

set -e

echo "patch conan generated xcconfig files"

# patch xcconfig - see https://github.com/conan-io/conan/issues/16526
sed -i '' -E 's/\]\[arch=arm64\]\[/][/g;t' conan-output/*.xcconfig
sed -i '' -E 's/\]\[arch=x86_64\]\[/][/g;t' conan-output/*.xcconfig

echo "done"
4 changes: 1 addition & 3 deletions ios → conan/profiles/ios
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include(default)
[settings]
os=iOS
os.version=14.0
os.sdk=iphoneos
arch=armv8
build_type=Release

[build_requires]
darwin-toolchain/1.0.8@theodelrieu/testing
8 changes: 8 additions & 0 deletions conan/profiles/ios-simulator-arm64
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
include(default)

[settings]
os=iOS
os.version=14.0
os.sdk=iphonesimulator
arch=armv8
build_type=Release
4 changes: 1 addition & 3 deletions ios-simulator → conan/profiles/ios-simulator-x64
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ include(default)
[settings]
os=iOS
os.version=14.0
os.sdk=iphonesimulator
arch=x86_64
build_type=Release

[build_requires]
darwin-toolchain/1.0.8@theodelrieu/testing
33 changes: 33 additions & 0 deletions conan/setup-all.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

# https://stackoverflow.com/a/246128/198996
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
cd $DIR/..

# device
for configuration in "Debug" "Debug Lite" "Release" "Release Lite"; do
conan install conan/ \
--output-folder=conan-output \
--build=missing \
--profile:host=conan/profiles/ios \
-s build_type=Release \
-s "&:build_type=Release" \
-s "odrcore/*:build_type=RelWithDebInfo" \
-o "configuration=${configuration}"
done

# simulator
for arch in "arm64" "x64"; do
for configuration in "Debug" "Debug Lite" "Release" "Release Lite"; do
conan install conan/ \
--output-folder=conan-output \
--build=missing \
--profile:host=conan/profiles/ios-simulator-${arch} \
-s build_type=Release \
-s "&:build_type=Release" \
-s "odrcore/*:build_type=RelWithDebInfo" \
-o "configuration=${configuration}"
done
done

bash conan/patch.sh
6 changes: 0 additions & 6 deletions conanfile.txt

This file was deleted.

3 changes: 2 additions & 1 deletion debug-lite.xcconfig → configs/debug-lite.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#include "Pods/Target Support Files/Pods-OpenDocumentReader/Pods-OpenDocumentReader.debug lite.xcconfig"
#include "conanbuildinfo.xcconfig"

#include "conan-output/conan_config.xcconfig"
3 changes: 2 additions & 1 deletion debug.xcconfig → configs/debug.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#include "Pods/Target Support Files/Pods-OpenDocumentReader/Pods-OpenDocumentReader.debug.xcconfig"
#include "conanbuildinfo.xcconfig"

#include "conan-output/conan_config.xcconfig"
3 changes: 2 additions & 1 deletion release-lite.xcconfig → configs/release-lite.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#include "Pods/Target Support Files/Pods-OpenDocumentReader/Pods-OpenDocumentReader.release lite.xcconfig"
#include "conanbuildinfo.xcconfig"

#include "conan-output/conan_config.xcconfig"
3 changes: 2 additions & 1 deletion release.xcconfig → configs/release.xcconfig
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
#include "Pods/Target Support Files/Pods-OpenDocumentReader/Pods-OpenDocumentReader.release.xcconfig"
#include "conanbuildinfo.xcconfig"

#include "conan-output/conan_config.xcconfig"
5 changes: 0 additions & 5 deletions fastlane/Fastfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,29 @@ default_platform(:ios)
platform :ios do
desc "Push a new release build to the App Store"
lane :deployPro do
sh("bash", "../build-device.sh")
clear_derived_data
build_app(workspace: "OpenDocumentReader.xcworkspace", scheme: "ODR Full", xcargs: "-allowProvisioningUpdates")
upload_to_app_store(
app_identifier: "at.tomtasche.reader",
skip_screenshots: true,
skip_metadata: true
)
sh("bash", "../build-simulator.sh")
clear_derived_data
end

desc "Push a new release build to the App Store"
lane :deployLite do
sh("bash", "../build-device.sh")
clear_derived_data
build_app(workspace: "OpenDocumentReader.xcworkspace", scheme: "ODR Lite", xcargs: "-allowProvisioningUpdates")
upload_to_app_store(
app_identifier: "at.tomtasche.reader.lite1",
skip_screenshots: true,
skip_metadata: true
)
sh("bash", "../build-simulator.sh")
clear_derived_data
end

lane :tests do
sh("bash", "../build-simulator.sh")
clear_derived_data
run_tests(
workspace: "OpenDocumentReader.xcworkspace",
Expand Down
Loading