[go: nahoru, domu]

Skip to content

Commit

Permalink
ios build CI (cagnulein#1394)
Browse files Browse the repository at this point in the history
  • Loading branch information
cagnulein committed Apr 12, 2023
1 parent 11d0a33 commit 1f113b0
Show file tree
Hide file tree
Showing 4 changed files with 68 additions and 7 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -439,3 +439,57 @@ jobs:
- name: Build APK (not usable for production due to unpatched QT library)
run: cd src; androiddeployqt --input android-qdomyos-zwift-deployment-settings.json --output ${{ github.workspace }}/output/android/ --android-platform android-31 --gradle --aab

ios-build:
# The type of runner that the job will run on
runs-on: macos-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- name: Checkout submodule repo
uses: actions/checkout@v2
with:
repository: bluetiger9/SmtpClient-for-Qt
path: "src/smtpclient/"
ref: 3fa4a0fe5797070339422cf18b5e9ed8dcb91f9c

- uses: actions/checkout@v2
- name: Checkout submodule repo
uses: actions/checkout@v2
with:
repository: cagnulein/qmdnsengine
path: "src/qmdnsengine/"
ref: "zwift"

- uses: actions/checkout@v2
- name: Checkout submodule repo
uses: actions/checkout@v2
with:
repository: google/googletest
path: "tst/googletest/"
ref: "release-1.12.1"

- name: Install Qt iOS
uses: jurplel/install-qt-action@v2
with:
version: '5.15.2'
host: 'mac'
target: 'ios'
modules: 'qtcharts qtnetworkauth'
dir: '${{ github.workspace }}/output/ios/'

- name: fix qt
run: find ${{ github.workspace }}/output/ios/ -name 'ios.conf' -exec sed -i '' 's/ios-simulator/iphonesimulator/g' {} \;

- name: fix qt
run: find ${{ github.workspace }}/output/ios/ -name 'devices.py' -exec sed -i '' 's/\/usr\/bin\/python/\/usr\/bin\/python3/g' {} \;

- name: fix qt
run: find ./ -name 'qdomyos-zwift-lib.pro' -exec sed -i '' 's/TARGET = qdomyos-zwift/TARGET = qdomyoszwift/g' {} \;

- name: patching qt for bluetooth
run: cp qt-patches/ios/5.15.2/binary/*.* ${{ github.workspace }}/output/ios/Qt/5.15.2/ios/lib/

- name: Build
run: qmake CONFIG+=debug && make -j4

10 changes: 8 additions & 2 deletions qdomyos-zwift.pro
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
TEMPLATE = subdirs
CONFIG+=ordered

!android: {
!ios: !android: {
SUBDIRS = \
src/qdomyos-zwift-lib.pro \
src/qdomyos-zwift.pro \
Expand All @@ -10,9 +10,15 @@ SUBDIRS = \
tst.depends = src/qdomyos-zwift-lib.pro
}

android: {
android: {
SUBDIRS = \
src/qdomyos-zwift.pro
}

ios: {
SUBDIRS = \
src/qdomyos-zwift-lib.pro \
src/qdomyos-zwift.pro
}


8 changes: 4 additions & 4 deletions src/bluetooth.h
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,10 @@ class bluetooth : public QObject, public SignalHandler {
QTimer discoveryTimeout;
#endif

#ifdef Q_OS_IOS
lockscreen* h = nullptr;
#endif

/**
* @brief Store the name and other info in the settings.
* @param b The bluetooth device info.
Expand Down Expand Up @@ -306,10 +310,6 @@ class bluetooth : public QObject, public SignalHandler {
void speedChanged(double);
void inclinationChanged(double, double);
void connectedAndDiscovered();

#ifdef Q_OS_IOS
lockscreen* h = nullptr;
#endif

signals:
};
Expand Down
3 changes: 2 additions & 1 deletion src/qdomyos-zwift.pri
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ ios {

ios {
OBJECTIVE_SOURCES += ios/lockscreen.mm \
OBJECTIVE_SOURCES += ios/ios_app_delegate.mm \
ios/ios_app_delegate.mm \
fit-sdk/FitDecode.mm \
fit-sdk/FitDeveloperField.mm \
fit-sdk/FitEncode.mm \
Expand All @@ -768,6 +768,7 @@ ios {
QMAKE_INFO_PLIST = ios/Info.plist
QMAKE_ASSET_CATALOGS = $$PWD/ios/Images.xcassets
QMAKE_ASSET_CATALOGS_APP_ICON = "AppIcon"
QMAKE_ASSET_CATALOGS_BUILD_PATH = $$PWD/ios/

TARGET = qdomyoszwift
QMAKE_TARGET_BUNDLE_PREFIX = org.cagnulein
Expand Down

0 comments on commit 1f113b0

Please sign in to comment.