-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathbt_le_x.pro
184 lines (155 loc) · 5.39 KB
/
bt_le_x.pro
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
# ekke (Ekkehard Gentz) @ekkescorner
TEMPLATE = app
TARGET = bt_le_x
QT += qml quick core bluetooth xml
LIBS += -lz
CONFIG += c++11
HEADERS += \
cpp/applicationui.hpp \
cpp/uiconstants.hpp \
cpp/bt/bluetoothmanager.hpp \
cpp/bt/mybluetoothdeviceinfo.hpp \
cpp/bt/mybluetoothserviceinfo.hpp \
cpp/bt/heartratemanager.hpp \
cpp/bt/waiterlockmanager.hpp \
cpp/bt/mybluetoothcharacteristic.hpp \
cpp/bt/mybluetoothdescriptor.hpp \
cpp/bt/addimatmapping.hpp \
cpp/bt/heartratemessages.hpp \
cpp/bt/nfcreadermanager.hpp \
cpp/bt/nfcreadermapping.hpp \
cpp/bt/generalscanmanager.hpp \
cpp/bt/feitiancardreadermanager.hpp
SOURCES += cpp/main.cpp \
cpp/applicationui.cpp \
cpp/bt/bluetoothmanager.cpp \
cpp/bt/mybluetoothdeviceinfo.cpp \
cpp/bt/mybluetoothserviceinfo.cpp \
cpp/bt/heartratemanager.cpp \
cpp/bt/waiterlockmanager.cpp \
cpp/bt/mybluetoothcharacteristic.cpp \
cpp/bt/mybluetoothdescriptor.cpp \
cpp/bt/addimatmapping.cpp \
cpp/bt/heartratemessages.cpp \
cpp/bt/nfcreadermanager.cpp \
cpp/bt/nfcreadermapping.cpp \
cpp/bt/generalscanmanager.cpp \
cpp/bt/feitiancardreadermanager.cpp
OTHER_FILES += qml/main.qml \
qml/common/*.qml \
qml/navigation/*.qml \
qml/pages/*.qml \
qml/popups/*.qml \
qml/tabs/*.qml \
qml/bt/*.qml
OTHER_FILES += images/black/*.png \
images/black/x18/*.png \
images/black/x36/*.png \
images/black/x48/*.png \
images/white/*.png \
images/white/x18/*.png \
images/white/x36/*.png \
images/white/x48/*.png \
images/extra/*.png \
translations/*.* \
images/LICENSE \
LICENSE \
*.md \
ios/*.png \
ios/Images.xcassets/AppIcon.appiconset/*.*
# can be placed under android only, but I prefer to see them always
OTHER_FILES += android/src/org/ekkescorner/utils/QAndroidUtils.java
RESOURCES += \
translations.qrc \
qml.qrc \
images.qrc
# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =
# Default rules for deployment.
include(deployment.pri)
# T R A N S L A T I O N S
# if languages are added:
# 1. rebuild project to generate *.qm
# 2. add existing .qm files to translations.qrc
# if changes to translatable strings:
# 1. Run Tools-External-Linguist-Update
# 2. Run Linguist and do translations
# 3. Build and run on iOS and Android to verify translations
# 4. Optional: if translations not done: Run Tools-External-Linguist-Release
# Supported languages
LANGUAGES = de en
# used to create .ts files
defineReplace(prependAll) {
for(a,$$1):result += $$2$${a}$$3
return($$result)
}
# Available translations
tsroot = $$join(TARGET,,,.ts)
tstarget = $$join(TARGET,,,_)
TRANSLATIONS = $$PWD/translations/$$tsroot
TRANSLATIONS += $$prependAll(LANGUAGES, $$PWD/translations/$$tstarget, .ts)
# run LRELEASE to generate the qm files
qtPrepareTool(LRELEASE, lrelease)
for(tsfile, TRANSLATIONS) {
command = $$LRELEASE $$tsfile
system($$command)|error("Failed to run: $$command")
}
DISTFILES += \
android/AndroidManifest.xml \
android/gradle/wrapper/gradle-wrapper.jar \
android/gradlew \
android/res/values/libs.xml \
android/build.gradle \
android/gradle.properties \
android/gradle/wrapper/gradle-wrapper.properties \
android/gradlew.bat
android {
QT += androidextras
ANDROID_PACKAGE_SOURCE_DIR = $$PWD/android
# deploying 32-bit and 64-bit APKs you need different VersionCode
# here's my way to solve this - per ex. Version 1.2.3
# aabcddeef aa: 21 (MY_MIN_API), b: 0 (32 Bit) or 1 (64 Bit) c: 0 (unused)
# dd: 01 (Major Release), ee: 02 (Minor Release), f: 3 (Patch Release)
# VersionName 1.2.3
# VersionCode 32 Bit: 210001023
# VersionCode 64 Bit: 211001023
defineReplace(droidVersionCode) {
segments = $$split(1, ".")
for (segment, segments): vCode = "$$first(vCode)$$format_number($$segment, width=2 zeropad)"
equals(ANDROID_ABIS, arm64-v8a): \
prefix = 1
else: equals(ANDROID_ABIS, armeabi-v7a): \
prefix = 0
else: prefix = 2
# add more cases as needed
return($$first(prefix)0$$first(vCode))
}
MY_VERSION = 1.7
MY_PATCH_VERSION = 0
MY_MIN_API = 21
ANDROID_VERSION_NAME = $$MY_VERSION"."$$MY_PATCH_VERSION
ANDROID_VERSION_CODE = $$MY_MIN_API$$droidVersionCode($$MY_VERSION)$$MY_PATCH_VERSION
# find this in shadow build android-build gradle.properties
ANDROID_MIN_SDK_VERSION = "21"
ANDROID_TARGET_SDK_VERSION = "33"
}
ios {
QMAKE_INFO_PLIST = ios/Info.plist
QMAKE_ASSET_CATALOGS = $$PWD/ios/Images.xcassets
QMAKE_ASSET_CATALOGS_APP_ICON = "AppIcon"
ios_artwork.files = $$files($$PWD/ios/iTunesArtwork*.png)
QMAKE_BUNDLE_DATA += ios_artwork
app_launch_screen.files = $$files($$PWD/ios/MyLaunchScreen.xib)
QMAKE_BUNDLE_DATA += app_launch_screen
QMAKE_IOS_DEPLOYMENT_TARGET = 12.0
disable_warning.name = GCC_WARN_64_TO_32_BIT_CONVERSION
disable_warning.value = NO
QMAKE_MAC_XCODE_SETTINGS += disable_warning
# don't need this anymore - development team will be set from ios build settings
# include(ios_signature.pri)
# see https://bugreports.qt.io/browse/QTBUG-70072
QMAKE_TARGET_BUNDLE_PREFIX = org.ekkescorner.examples
QMAKE_BUNDLE = btle
# Note for devices: 1=iPhone, 2=iPad, 1,2=Universal.
QMAKE_APPLE_TARGETED_DEVICE_FAMILY = 1,2
}