Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • alcroito/qt-ui-viewer
  • design-studio/design-viewer/qt-ui-viewer
2 results
Show changes
Commits on Source (73)
Showing
with 555 additions and 166 deletions
.DS_Store .DS_Store
ui/*.db src/ui/*.db
ui/*.qtds src/ui/*.qtds
ui/*.db-shm src/ui/*.db-shm
ui/*.db-wal src/ui/*.db-wal
src/ui/share.qrc
logcat.txt
output.junit.xml
src/ui/DesignViewer.qmlproject.qtds
src/android/AndroidManifest.xml
logcat.txt
output.junit.xml
[submodule "qtquickdesigner-components"]
path = 3rdparty/qtquickdesigner-components
url = https://git.qt.io/design-studio/kit-dependencies/qt-quickdesigner-components.git
[submodule "3rdparty/zxing-cpp"] [submodule "3rdparty/zxing-cpp"]
path = 3rdparty/zxing-cpp path = 3rdparty/zxing-cpp
url = https://github.com/zxing-cpp/zxing-cpp.git url = https://github.com/zxing-cpp/zxing-cpp.git
[submodule "3rdparty/qtquickdesigner-components"] [submodule "3rdparty/qtquickdesigner-components"]
path = 3rdparty/qtquickdesigner-components path = 3rdparty/qtquickdesigner-components
url = https://git.qt.io/design-studio/kit-dependencies/qt-quickdesigner-components url = https://codereview.qt-project.org/qt-labs/qtquickdesigner-components
Subproject commit 5f115ed120adb58972ac3a0a2b80ec42cf3769a1 Subproject commit 04a5f670d3e7ae28e54bf194a3dd70e13d05ffc4
Subproject commit c97fc94e0e129feb0c3596371f86d725540322d7 Subproject commit c98555164e3823a5d3a56cad5a04dc386d9f7e7b
cmake_minimum_required(VERSION 3.14) cmake_minimum_required(VERSION 3.14)
project(qtdesignviewer-android LANGUAGES CXX) project(qtuiviewer LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOUIC ON) set(CMAKE_CXX_STANDARD 17)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
find_package( find_package(
QT NAMES Qt6 QT NAMES Qt6
COMPONENTS Core Widgets Quick Gui Qml Multimedia MultimediaWidgets Concurrent
REQUIRED
) )
find_package( find_package(Qt6 REQUIRED COMPONENTS Core)
Qt6 qt_policy(SET QTP0002 NEW)
COMPONENTS Core Widgets Quick Gui Qml Multimedia MultimediaWidgets Concurrent
REQUIRED
)
set(QT_MINIMUM_VERSION 6.3.0) set(QT_MINIMUM_VERSION 6.7.3)
if(QT_VERSION VERSION_LESS QT_MINIMUM_VERSION) if(QT_VERSION VERSION_LESS QT_MINIMUM_VERSION)
message(FATAL_ERROR "Minimum supported Qt version: ${QT_MINIMUM_VERSION}") message(FATAL_ERROR "Minimum supported Qt version: ${QT_MINIMUM_VERSION}")
endif() endif()
if(ANDROID)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/zxing-cpp) # try to locate the OpenSSL for Android if not set
if(NOT DEFINED ANDROID_OPENSSL_PATH OR ANDROID_OPENSSL_PATH STREQUAL "")
qt_add_executable(${PROJECT_NAME} if(EXISTS "${ANDROID_SDK_ROOT}/android_openssl/ssl_3/${ANDROID_ABI}")
src/importdummy.qml set(ANDROID_OPENSSL_PATH ${ANDROID_SDK_ROOT}/android_openssl/ssl_3/${ANDROID_ABI})
src/main.cpp endif()
src/backend.cpp src/backend.h endif()
src/serviceConnector.cpp src/serviceConnector.h
src/projectManager.cpp src/projectManager.h if(NOT EXISTS ${ANDROID_OPENSSL_PATH})
src/dsConnector.cpp src/dsConnector.h message(WARNING "Cannot find OpenSSL for Android. Path: ${ANDROID_OPENSSL_PATH}")
3rdparty/zxing-cpp/example/ZXingQtReader.h message(FATAL_ERROR "Please set ANDROID_OPENSSL_PATH to the path of OpenSSL for Android.")
ui/main.qml endif()
ui/resources.qrc message(STATUS "Found OpenSSL for Android. Path: ${ANDROID_OPENSSL_PATH}")
) else()
message(STATUS "Building for Desktop")
target_link_libraries(${PROJECT_NAME} PRIVATE
Qt6::Core Qt6::Widgets
Qt6::Quick Qt6::Gui
Qt6::Qml Qt6::GuiPrivate
Qt6::Multimedia Qt6::MultimediaWidgets
Qt6::Concurrent
ZXing::ZXing
)
set_property(TARGET ${PROJECT_NAME}
APPEND PROPERTY QT_WASM_INITIAL_MEMORY "50MB"
)
set_property(TARGET ${PROJECT_NAME}
APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/android
)
if(NOT EXISTS ${ANDROID_OPENSSL_PATH})
message(WARNING "Cannot find OpenSSL for Android. Path: ${ANDROID_OPENSSL_PATH}")
message(FATAL_ERROR "Please set ANDROID_OPENSSL_PATH to the path of OpenSSL for Android.")
endif() endif()
message(STATUS "Found OpenSSL for Android. Path: ${ANDROID_OPENSSL_PATH}") qt_standard_project_setup(REQUIRES ${QT_MINIMUM_VERSION})
set_property(TARGET ${PROJECT_NAME} PROPERTY QT_ANDROID_EXTRA_LIBS
${ANDROID_OPENSSL_PATH}/libcrypto_3.so
${ANDROID_OPENSSL_PATH}/libssl_3.so)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_INSTALL_PREFIX}) set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${CMAKE_INSTALL_PREFIX})
set_property(TARGET ${PROJECT_NAME} PROPERTY QT_ANDROID_TARGET_SDK_VERSION 34) execute_process(COMMAND git describe --always --tags OUTPUT_VARIABLE CMAKE_VAR_GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
qt6_import_qml_plugins(${PROJECT_NAME}) execute_process(COMMAND git -C ${CMAKE_SOURCE_DIR}/3rdparty/qtquickdesigner-components describe --always --tags OUTPUT_VARIABLE CMAKE_VAR_QT_QUICK_COMPONENTS_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git -C ${CMAKE_SOURCE_DIR}/3rdparty/zxing-cpp describe --always --tags OUTPUT_VARIABLE CMAKE_VAR_ZXING_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND git describe --always --tags OUTPUT_VARIABLE GIT_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) add_definitions( -DCMAKE_VAR_GIT_VERSION="${CMAKE_VAR_GIT_VERSION}" )
execute_process(COMMAND git -C ${CMAKE_SOURCE_DIR}/3rdparty/qtquickdesigner-components describe --always --tags OUTPUT_VARIABLE QT_QUICK_COMPONENTS_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) add_definitions( -DCMAKE_VAR_QT_QUICK_COMPONENTS_VERSION="${CMAKE_VAR_QT_QUICK_COMPONENTS_VERSION}" )
execute_process(COMMAND git -C ${CMAKE_SOURCE_DIR}/3rdparty/zxing-cpp describe --always --tags OUTPUT_VARIABLE ZXING-CPP OUTPUT_STRIP_TRAILING_WHITESPACE) add_definitions( -DCMAKE_VAR_ZXING_VERSION="${CMAKE_VAR_ZXING_VERSION}" )
# this needs to be increased with every new release
if(NOT DEFINED GOOGLE_PLAY_APP_VERSION)
set(GOOGLE_PLAY_APP_VERSION 31)
endif()
add_definitions( -DGIT_VERSION="${GIT_VERSION}" ) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/3rdparty/zxing-cpp)
add_definitions( -DQT_QUICK_COMPONENTS_VERSION="${QT_QUICK_COMPONENTS_VERSION}" ) add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/src)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/tests)
message(STATUS "PROJECT VERSION: ${GIT_VERSION}") message(STATUS "GOOGLE_PLAY_APP_VERSION: ${GOOGLE_PLAY_APP_VERSION}")
message(STATUS "PROJECT VERSION: ${CMAKE_VAR_GIT_VERSION}")
message(STATUS "QT_VERSION: ${QT_VERSION}") message(STATUS "QT_VERSION: ${QT_VERSION}")
message(STATUS "QT_QUICK_COMPONENTS_VERSION: ${QT_QUICK_COMPONENTS_VERSION}") message(STATUS "QT_QUICK_COMPONENTS_VERSION: ${CMAKE_VAR_QT_QUICK_COMPONENTS_VERSION}")
message(STATUS "ZXING-CPP: ${ZXING-CPP}") message(STATUS "ZXING-CPP: ${CMAKE_VAR_ZXING_VERSION}")
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, “this License” refers to version 3 of the GNU Lesser General Public License, and the “GNU GPL” refers to version 3 of the GNU General Public License.
“The Library” refers to a covered work governed by this License, other than an Application or a Combined Work as defined below.
An “Application” is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library.
A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”.
The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.
The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version:
a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following:
a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license document.
c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.
1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.
e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License “or any later version” applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.
# Qt Design Viewer for Android # Qt UI Viewer
![Qt UI Viewer](assets/PlayStoreFeatureImage.svg)
## About ## About
Launch [Design Studio](https://www.qt.io/ui-design-tools) projects in your Android device. The viewer that helps you do this is done with [Qt for Android](https://doc.qt.io/qt-6/android.html).
Qt Design Viewer works with minimum Android 33. Launch [Qt Design Studio](https://www.qt.io/ui-design-tools) projects in your Android device in seconds. Qt UI Viewer is a simple app that allows you to view your Qt Design Studio projects on your Android device. It's a great tool for designers and developers to preview their designs on a real device.
Qt UI Viewer is built with [Qt for Android](https://doc.qt.io/qt-6/android.html).
## Getting the App
You can get the pre-built app from either [Google Play Store][google-play-link] or [Package Registry][package-registry]. Package registry provides the APK file for manual installation.
## Prerequisites ## Prerequisites
* Qt Design Studio 4.7 or newer
* CMake 3.16 or newer * CMake 3.16 or newer
* Qt6.5.0 or newer * Qt 6.8.0 or newer
* OpenSSL (<https://github.com/KDAB/android_openssl>) * OpenSSL (<https://github.com/KDAB/android_openssl>)
* Android SDK and NDK (<https://developer.android.com/studio>) * Android (min API 34) SDK and NDK (<https://developer.android.com/studio>)
## Code Map ## Code Map
* cicd: GitLab pipeline files * cicd: GitLab pipeline files
* resources: UI related files * resources: UI related files
* android: Files needed for Android build system * android: Files needed for Android build system
* src: Backend source files * src: All source files
* ui: UI source files
* 3rdparty: Required 3rd party libraries * 3rdparty: Required 3rd party libraries
* qtquickdesigner-components: QML components * qtquickdesigner-components: QML components
* zxing-cpp: QR code decoding/encoding * zxing-cpp: QR code decoding/encoding
* assets: Play Store Assets
* tests: Test files
## Building ## Building
...@@ -31,7 +40,6 @@ Build instructions are provided for Linux and macOS hosts. Windows should work a ...@@ -31,7 +40,6 @@ Build instructions are provided for Linux and macOS hosts. Windows should work a
> If you're building in a Docker container and you've mounted the source directory into the container, you may need to change the build path pointing out somewhere out of the source directory. Otherwise you may get errors like the following; > If you're building in a Docker container and you've mounted the source directory into the container, you may need to change the build path pointing out somewhere out of the source directory. Otherwise you may get errors like the following;
> `CMake Error at /opt/qt-v.6.5.0/android-arm64-v8a/lib/cmake/Qt6/QtSyncQtHelpers.cmake:235 (message): syncqt.cpp failed for module QtQuickStudioApplication: Unable to remove file ...` > `CMake Error at /opt/qt-v.6.5.0/android-arm64-v8a/lib/cmake/Qt6/QtSyncQtHelpers.cmake:235 (message): syncqt.cpp failed for module QtQuickStudioApplication: Unable to remove file ...`
> Note: > Note:
> Android build instructions can also be used on desktop (or host) for testing purposes. Just replace the `CMAKE_TOOLCHAIN_FILE` path with the path to your Qt host installation. > Android build instructions can also be used on desktop (or host) for testing purposes. Just replace the `CMAKE_TOOLCHAIN_FILE` path with the path to your Qt host installation.
...@@ -48,14 +56,15 @@ cmake \ ...@@ -48,14 +56,15 @@ cmake \
-DCMAKE_PREFIX_PATH=<qt-android-path> \ -DCMAKE_PREFIX_PATH=<qt-android-path> \
-DANDROID_SDK_ROOT=<android-sdk-path> \ -DANDROID_SDK_ROOT=<android-sdk-path> \
-DANDROID_NDK_ROOT=<android-sdk-path>/ndk/<ndk-version> \ -DANDROID_NDK_ROOT=<android-sdk-path>/ndk/<ndk-version> \
-DANDROID_OPENSSL_PATH=<openssl-path> -DANDROID_OPENSSL_PATH=<openssl-path> \
-DFLOWVIEW_AUTO_QMLDIR=ON
cmake --build build cmake --build build
cmake --install build cmake --install build
popd popd
``` ```
Then build the Qt Design Viewer: Then build the Qt UI Viewer:
```bash ```bash
cmake \ cmake \
...@@ -65,14 +74,64 @@ cmake \ ...@@ -65,14 +74,64 @@ cmake \
-DCMAKE_TOOLCHAIN_FILE=<qt-android-path>/lib/cmake/Qt6/qt.toolchain.cmake \ -DCMAKE_TOOLCHAIN_FILE=<qt-android-path>/lib/cmake/Qt6/qt.toolchain.cmake \
-DANDROID_SDK_ROOT=<android-sdk-path> \ -DANDROID_SDK_ROOT=<android-sdk-path> \
-DANDROID_NDK_ROOT=<android-sdk-path>/ndk/<ndk-version> \ -DANDROID_NDK_ROOT=<android-sdk-path>/ndk/<ndk-version> \
-DANDROID_OPENSSL_PATH=<openssl-path> -DANDROID_OPENSSL_PATH=<openssl-path> \
-DGOOGLE_PLAY_APP_VERSION=30 \ ## see the 'Versioning' section
-DBUILD_EXAMPLES=OFF
cmake --build build cmake --build build
``` ```
## Usage ## Usage
Upload the final APK file to your Android device and run. Then follow the instructions within the app. Upload the final APK file to your Android device or emulator and run. Then follow the instructions within the app.
### Running on Android Emulator
For creating and running an Android emulator, follow the instructions on the [avdmanager][avd-manager] and [emulator][android-emulator] pages. Please also make sure that [telnet][telnet-wiki] is installed on your system for [emulator console][emulator console] commands.
Android emulators run behind a [virtual router](https://developer.android.com/studio/run/emulator-networking) and network address translation (NAT) so they can't be accessed directly from the host machine. There is one TCP port required to be forwarded in between that virtual router and the host machine so that Qt Design Studio can communicate with the application.
After creating and spinning up the emulator, you can forward the required ports to the emulator with the following command on terminal:
> Note: This unfortunately needs to be repeated every time the emulator is started.
```bash
telnet localhost 5554 --> ( that will show you the file to get the auth code )
auth <auth-code>
redir add tcp:40000:40000
```
Then in the Qt Design Studio add a new device with the IP of 127.0.0.1
## Testing
To run the tests a running emulator or a connected device is required. There's a helper script to run the tests under `tests/scripts/run-tests.sh`. To run the tests first copy the APK file to the device and then run the script. It'll extract the test results as `output.junit.xml` file.
Test results can be viewed with any JUnit compatible viewer. For example, you can use `xunit-viewer` to view the results:
```bash
npm i -g xunit-viewer
xunit-viewer -r output.junitxml -s -w
```
It'll create a `report.html` file that can be opened in a web browser. For more information about `xunit-viewer` please visit the [GitHub repo][xunit-viewer].
## Versioning
[android:versionCode][manifest-vcode] is an integer value that should be incremented for each new release and it's required by Google Play Store. It's used to determine if the app should be updated or not.
During the development this value can be set to any arbitrary integer. But for the release it should be incremented. The value can be controlled by setting the CMake variable called `GOOGLE_PLAY_APP_VERSION` during the CMake configuration step.
It's easy for an individual developer to forget to increment it before the release. To prevent this, a GitLab pipeline is used to automatically increment this value for each new release. The pipeline is triggered by creating a new tag. The tag should be in the format of `vX.Y.Z` where `X`, `Y`, and `Z` are integers. Then the new value is determined by calculating the following formula:
```text
android:versionCode = <total_number_of_tags> + 11
```
The magic value `11` is coming from the times where `GOOGLE_PLAY_APP_VERSION` was increased without creating a tag, so we have an offset in between the tag count and the actual value. From now on the value should be incremented by creating a new tag.
There's no `AndroidManifest.xml` file in the repository. `AndroidManifest.xml.in` file is used to generate the `AndroidManifest.xml` file during the configuration step. The `versionCode` value is set to the `GOOGLE_PLAY_APP_VERSION` and the `versionName` value is set to the output of the `git describe --always --tags` command.
Both values can be seen in the `AndroidManifest.xml` file after the CMake configuration step is completed.
## 3rd Party Libraries/Components ## 3rd Party Libraries/Components
...@@ -83,3 +142,12 @@ Upload the final APK file to your Android device and run. Then follow the instru ...@@ -83,3 +142,12 @@ Upload the final APK file to your Android device and run. Then follow the instru
* [QtQuickDesigner Components](https://codereview.qt-project.org/gitweb?p=qt-labs%2Fqtquickdesigner-components.git;a=summary) * [QtQuickDesigner Components](https://codereview.qt-project.org/gitweb?p=qt-labs%2Fqtquickdesigner-components.git;a=summary)
GNU GENERAL PUBLIC LICENSE GNU GENERAL PUBLIC LICENSE
QtQuickDesigner Components is a collection of QML components for Qt Quick Designer. QtQuickDesigner Components is a collection of QML components for Qt Quick Designer.
[google-play-link]: <https://play.google.com/store/apps/details?id=io.qt.qtdesignviewer>
[package-registry]: <https://git.qt.io/design-studio/design-viewer/qt-ui-viewer/-/packages>
[xunit-viewer]: <https://github.com/lukejpreston/xunit-viewer>
[manifest-vcode]: <https://developer.android.com/studio/publish/versioning>
[avd-manager]:<https://developer.android.com/tools/avdmanager>
[android-emulator]:<https://developer.android.com/studio/run/emulator-commandline>
[telnet-wiki]:<https://en.wikipedia.org/wiki/Telnet>
[emulator console]:<https://developer.android.com/studio/run/emulator-console>
android/res/mipmap-hdpi/app_icon.png

4.36 KiB

android/res/mipmap-ldpi/app_icon.png

798 B

android/res/mipmap-mdpi/app_icon.png

1.72 KiB

android/res/mipmap-xhdpi/app_icon.png

6.22 KiB

android/res/mipmap-xxhdpi/app_icon.png

13 KiB

android/res/mipmap-xxxhdpi/app_icon.png

30 KiB

This diff is collapsed.
<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0_674_15)">
<path d="M0 32V256H224L256 224V0H32L0 32Z" fill="url(#paint0_linear_674_15)"/>
<path d="M51.046 175.993C51.046 187.179 56.733 192.772 68.107 192.772C79.481 192.772 85.168 187.179 85.168 175.993V112.12H104.626V175.57C104.626 187.32 101.571 195.968 95.461 201.514C89.445 206.966 80.327 209.692 68.107 209.692C55.887 209.692 46.722 206.966 40.612 201.514C34.596 195.968 31.588 187.32 31.588 175.57V112.12H51.046V175.993ZM173.758 112.12H194.203L171.925 208H135.97L113.692 112.12H134.137L150.775 191.08H157.12L173.758 112.12Z" fill="#2CDE85"/>
</g>
<defs>
<linearGradient id="paint0_linear_674_15" x1="-2.26125e-06" y1="208.5" x2="256" y2="48.5" gradientUnits="userSpaceOnUse">
<stop stop-color="#0F7080"/>
<stop offset="1" stop-color="#01525F"/>
</linearGradient>
<clipPath id="clip0_674_15">
<rect width="256" height="256" fill="white"/>
</clipPath>
</defs>
</svg>
variables: variables:
QDS_CI_QT_VERSION: "6.6.1" QDS_CI_QT_VERSION: "6.8.0"
QDS_CI_ARTIFACTS_PATH: "${CI_PROJECT_DIR}/artifacts" QDS_CI_ARTIFACTS_PATH: "${CI_PROJECT_DIR}/artifacts"
QDS_CI_ANDROID_SDK_VERSION: "34.0.0"
QDS_CI_SKIP_TESTS: "false"
DEBIAN_FRONTEND: non-interactive DEBIAN_FRONTEND: non-interactive
GIT_SUBMODULE_STRATEGY: recursive GIT_SUBMODULE_STRATEGY: recursive
workflow: workflow:
name: 'Qt-${QDS_CI_QT_VERSION} - ${CI_COMMIT_MESSAGE}' name: 'Qt-${QDS_CI_QT_VERSION} - ${CI_COMMIT_MESSAGE}'
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: $CI_COMMIT_BRANCH
- if: $CI_COMMIT_TAG
stages: stages:
- build - build
- test
- deploy - deploy
- release - release
include: include:
- local: "cicd/stages/*" - local: "cicd/stages/*"
.pipeline_common:
image: "git.qt.io:4567/design-studio/maintenance/docker-images/qt-full:${QDS_CI_QT_VERSION}"
tags:
- linux-blade
# QDS_CI_BUILD_QT_VERSION_ANDROID and QDS_CI_BUILD_QT_VERSION_WASM are the tags for the docker images. # QDS_CI_BUILD_QT_VERSION_ANDROID and QDS_CI_BUILD_QT_VERSION_WASM are the tags for the docker images.
# https://git.qt.io/design-studio/maintenance/docker-images/container_registry # https://git.qt.io/design-studio/maintenance/docker-images/container_registry
build-android: .build-components: &build-components
- pushd 3rdparty/qtquickdesigner-components
- |
for arch in ${QDS_CI_JOB_ARCHS}; do
QT_DIR_WITH_ARCH=${DOCKER_ENV_QT_PATH_WITH_VERSION}/${arch}
BUILD_PATH=${QDS_CI_JOB_BUILD_PATH}/components/${arch}
cmake \
-S . \
-G Ninja \
-B ${BUILD_PATH} \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${QT_DIR_WITH_ARCH}/lib/cmake/Qt6/qt.toolchain.cmake \
-DANDROID_SDK_ROOT=${DOCKER_ENV_ANDROID_SDK_ROOT} \
-DANDROID_NDK_ROOT=${DOCKER_ENV_ANDROID_NDK_ROOT} \
-DQT_HOST_PATH=${DOCKER_ENV_QT_PATH_LINUX_GCC_64} \
-DFLOWVIEW_AUTO_QMLDIR=ON \
-DCMAKE_INSTALL_PREFIX=${QT_DIR_WITH_ARCH}
cmake --build ${BUILD_PATH} --target install
rm -rf ${BUILD_PATH}
done
- popd
.build-app: &build-app
- export GOOGLE_PLAY_APP_VERSION=$(( $(git tag --list | wc -l) +11 ))
# "git tag --list | wc -l" counts the number of tags in the repository.
# The "+11" is a magic number which is the last GOOGLE_PLAY_APP_VERSION
# that was released before starting to add tags to the repository. After
# GOOGLE_PLAY_APP_VERSION=11, the tags are added to the repository, and
# the GOOGLE_PLAY_APP_VERSION is incremented by 1 for each new tag.
- 'echo "Google Play App Version: ${GOOGLE_PLAY_APP_VERSION}"'
- |
cmake \
-S . \
-B ${QDS_CI_JOB_BUILD_PATH} \
-G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_TOOLCHAIN_FILE=${QDS_CI_JOB_QT_PATH}/lib/cmake/Qt6/qt.toolchain.cmake \
-DANDROID_SDK_ROOT=${DOCKER_ENV_ANDROID_SDK_ROOT} \
-DANDROID_NDK_ROOT=${DOCKER_ENV_ANDROID_NDK_ROOT} \
-DQT_HOST_PATH=${DOCKER_ENV_QT_PATH_LINUX_GCC_64} \
-DCMAKE_INSTALL_PREFIX=${QDS_CI_JOB_QT_PATH} \
-DANDROID_OPENSSL_PATH=${QDS_CI_JOB_OPENSSL_PATH} \
-DGOOGLE_PLAY_APP_VERSION=${GOOGLE_PLAY_APP_VERSION} \
-DQT_ANDROID_BUILD_ALL_ABIS=ON \
-DQT_ANDROID_MULTI_ABI_FORWARD_VARS="GOOGLE_PLAY_APP_VERSION;ANDROID_OPENSSL_PATH" \
-DBUILD_EXAMPLES=OFF
- cat ${QDS_CI_JOB_BUILD_PATH}/src/dynamic_imports.qml
- cmake --build ${QDS_CI_JOB_BUILD_PATH} --target ${QDS_CI_JOB_CMAKE_BUILD_TARGET}
.copy-and-sign-apks: &copy-and-sign-apks
- QDS_CI_KEYSTORE_PATH=$(pwd)/android_release.keystore
- QDS_CI_APK_SIGNER_PATH=${DOCKER_ENV_ANDROID_SDK_ROOT}/build-tools/${QDS_CI_ANDROID_SDK_VERSION}/apksigner
- echo ${QDS_VAR_KEYSTORE} | base64 -d > ${QDS_CI_KEYSTORE_PATH}
- cp -r ${QDS_CI_JOB_BUILD_PATH}/src/android-build/build/outputs/apk/release/* ${QDS_CI_JOB_ARTIFACTS_PATH_APP}
- cp -r ${QDS_CI_JOB_BUILD_PATH}/tests/android-build/build/outputs/apk/release/* ${QDS_CI_JOB_ARTIFACTS_PATH_TEST}
- echo ${QDS_VAR_PASS} | ${QDS_CI_APK_SIGNER_PATH} sign -verbose -ks ${QDS_CI_KEYSTORE_PATH} -out ${QDS_CI_JOB_ARTIFACTS_PATH_APP}/android-build-release.apk ${QDS_CI_JOB_ARTIFACTS_PATH_APP}/android-build-release-unsigned.apk
- echo ${QDS_VAR_PASS} | ${QDS_CI_APK_SIGNER_PATH} sign -verbose -ks ${QDS_CI_KEYSTORE_PATH} -out ${QDS_CI_JOB_ARTIFACTS_PATH_TEST}/android-build-release.apk ${QDS_CI_JOB_ARTIFACTS_PATH_TEST}/android-build-release-unsigned.apk
- rm -f ${QDS_CI_JOB_ARTIFACTS_PATH_APP}/android-build-release-unsigned.apk ${QDS_CI_JOB_ARTIFACTS_PATH_TEST}/android-build-release-unsigned.apk
.copy-and-sign-aab: &copy-and-sign-aab
- |
if [[ -n ${CI_COMMIT_TAG} ]];
then
QDS_CI_KEYSTORE_PATH=$(pwd)/android_release.keystore
echo ${QDS_VAR_KEYSTORE} | base64 -d > ${QDS_CI_KEYSTORE_PATH}
cp -r ${QDS_CI_JOB_BUILD_PATH}/src/android-build/build/outputs/bundle/release/* ${QDS_CI_JOB_ARTIFACTS_PATH_APP}
/usr/bin/jarsigner -keystore ${QDS_CI_KEYSTORE_PATH} ${QDS_CI_JOB_ARTIFACTS_PATH_APP}/android-build-release.aab ${QDS_VAR_KEYSTORE_ALIAS} -storepass ${QDS_VAR_PASS}
fi
.build-common:
extends: .pipeline_common
stage: build stage: build
tags:
- linux-blade
rules:
- if: $CI_PIPELINE_SOURCE == "push" || $CI_PIPELINE_SOURCE == "web"
parallel:
matrix:
- QDS_CI_JOB_TARGET_ARCH: "arm64_v8a"
QDS_CI_JOB_OPENSSL_PATH: "/opt/openssl/ssl_3/arm64-v8a"
- QDS_CI_JOB_TARGET_ARCH: "armv7"
QDS_CI_JOB_OPENSSL_PATH: "/opt/openssl/ssl_3/armeabi-v7a"
- QDS_CI_JOB_TARGET_ARCH: "x86"
QDS_CI_JOB_OPENSSL_PATH: "/opt/openssl/ssl_3/x86"
- QDS_CI_JOB_TARGET_ARCH: "x86_64"
QDS_CI_JOB_OPENSSL_PATH: "/opt/openssl/ssl_3/x86_64"
variables:
QDS_CI_JOB_BUILD_PATH: "${CI_PROJECT_DIR}/outdir/build"
QDS_CI_JOB_TARGET_PLATFORM: "android"
QDS_CI_JOB_ARTIFACTS_PATH: ${QDS_CI_ARTIFACTS_PATH}/${QDS_CI_JOB_TARGET_PLATFORM}/${QDS_CI_JOB_TARGET_ARCH}
QDS_CI_JOB_QT_ANDROID_PATH: "${QDS_CI_QT_PATH}/${QDS_CI_QT_VERSION}/${QDS_CI_JOB_TARGET_PLATFORM}_${QDS_CI_JOB_TARGET_ARCH}"
image: "git.qt.io:4567/design-studio/maintenance/docker-images/qt-full:${QDS_CI_QT_VERSION}"
artifacts: artifacts:
name: design-viewer-${CI_JOB_ID}-qt${QDS_CI_QT_VERSION}-${QDS_CI_JOB_TARGET_PLATFORM}-${QDS_CI_JOB_TARGET_ARCH} name: qt_ui_viewer-${CI_JOB_ID}-qt${QDS_CI_QT_VERSION}-${QDS_CI_JOB_TARGET_PLATFORM}
expose_as: "build-artifacts" expose_as: "build-artifacts"
paths: paths:
- ${QDS_CI_ARTIFACTS_PATH} - ${QDS_CI_ARTIFACTS_PATH}
expire_in: 1 week
build-android:
extends: .build-common
variables:
QDS_CI_JOB_TARGET_PLATFORM: "android"
QDS_CI_JOB_ARCHS: android_arm64_v8a android_armv7 android_x86 android_x86_64
QDS_CI_JOB_OPENSSL_PATH: "/opt/openssl/ssl_3/arm64-v8a"
QDS_CI_JOB_BUILD_PATH: "${CI_PROJECT_DIR}/${QDS_CI_JOB_TARGET_PLATFORM}/build"
QDS_CI_JOB_ARTIFACTS_PATH: ${QDS_CI_ARTIFACTS_PATH}/${QDS_CI_JOB_TARGET_PLATFORM}
QDS_CI_JOB_ARTIFACTS_PATH_APP: ${QDS_CI_JOB_ARTIFACTS_PATH}/app
QDS_CI_JOB_ARTIFACTS_PATH_TEST: ${QDS_CI_JOB_ARTIFACTS_PATH}/test
QDS_CI_JOB_CMAKE_BUILD_TARGET: "aab"
script:
- mkdir -p ${QDS_CI_JOB_ARTIFACTS_PATH_APP} ${QDS_CI_JOB_ARTIFACTS_PATH_TEST}
- export QDS_CI_JOB_QT_PATH="${DOCKER_ENV_QT_PATH_WITH_VERSION}/android_arm64_v8a"
- *build-components
- *build-app
- *copy-and-sign-apks
- *copy-and-sign-aab
build-desktop:
extends: .build-common
variables:
QDS_CI_JOB_TARGET_PLATFORM: "desktop"
QDS_CI_JOB_ARCHS: gcc_64
QDS_CI_JOB_BUILD_PATH: "${CI_PROJECT_DIR}/${QDS_CI_JOB_TARGET_PLATFORM}/build"
QDS_CI_JOB_ARTIFACTS_PATH: ${QDS_CI_ARTIFACTS_PATH}/${QDS_CI_JOB_TARGET_PLATFORM}
QDS_CI_JOB_CMAKE_BUILD_TARGET: "all"
script: script:
- mkdir -p ${QDS_CI_JOB_ARTIFACTS_PATH} - mkdir -p ${QDS_CI_JOB_ARTIFACTS_PATH}
- ls -l ${QDS_CI_JOB_OPENSSL_PATH} - export QDS_CI_JOB_QT_PATH="${DOCKER_ENV_QT_PATH_LINUX_GCC_64}"
- pushd 3rdparty/qtquickdesigner-components - apt-get update
- export - apt-get install -y libpulse-dev
- | - *build-components
cmake \ - *build-app
-S . \ - cp -r ${QDS_CI_JOB_BUILD_PATH}/src//qtuiviewer ${QDS_CI_JOB_ARTIFACTS_PATH}
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_TOOLCHAIN_FILE=${DOCKER_ENV_QT_PATH_WITH_VERSION}/${QDS_CI_JOB_TARGET_PLATFORM}_${QDS_CI_JOB_TARGET_ARCH}/lib/cmake/Qt6/qt.toolchain.cmake \
-DANDROID_SDK_ROOT=${DOCKER_ENV_ANDROID_SDK_ROOT} \
-DANDROID_NDK_ROOT=${DOCKER_ENV_ANDROID_NDK_ROOT} \
-DQT_HOST_PATH=${DOCKER_ENV_QT_PATH_LINUX_GCC_64} \
-DCMAKE_INSTALL_PREFIX=${QDS_CI_JOB_QT_ANDROID_PATH}
- cmake --build .
- cmake --install .
- popd
- |
cmake \
-S . \
-B ${QDS_CI_JOB_BUILD_PATH} \
-G Ninja \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_TOOLCHAIN_FILE=${DOCKER_ENV_QT_PATH_WITH_VERSION}/${QDS_CI_JOB_TARGET_PLATFORM}_${QDS_CI_JOB_TARGET_ARCH}/lib/cmake/Qt6/qt.toolchain.cmake \
-DANDROID_SDK_ROOT=${DOCKER_ENV_ANDROID_SDK_ROOT} \
-DANDROID_NDK_ROOT=${DOCKER_ENV_ANDROID_NDK_ROOT} \
-DQT_HOST_PATH=${DOCKER_ENV_QT_PATH_LINUX_GCC_64} \
-DCMAKE_INSTALL_PREFIX=${QDS_CI_JOB_QT_ANDROID_PATH} \
-DANDROID_OPENSSL_PATH=${QDS_CI_JOB_OPENSSL_PATH}
- cmake --build ${QDS_CI_JOB_BUILD_PATH} --target all
- cp -r ${QDS_CI_JOB_BUILD_PATH}/android-build/build/outputs/apk/debug/* ${QDS_CI_JOB_ARTIFACTS_PATH}
create-packages: create-packages:
stage: release stage: release
image: alpine:latest image: alpine:latest
tags: extends: .pipeline_common
- linux-blade
rules: rules:
- if: $CI_COMMIT_TAG - if: $CI_COMMIT_TAG
needs: needs:
- job: test-android
optional: false
artifacts: true
- job: build-android - job: build-android
optional: false optional: false
artifacts: true artifacts: true
variables: variables:
QDS_PACKAGE_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/design-viewer/${CI_COMMIT_TAG}" QDS_PACKAGE_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/qt-ui-viewer/${CI_COMMIT_TAG}"
GIT_SUBMODULE_STRATEGY: none
script: script:
- apk add tar curl - apk add tar curl
- echo ${QDS_CI_ARTIFACTS_PATH}; ls -l ${QDS_CI_ARTIFACTS_PATH}
- ls -l ${QDS_CI_ARTIFACTS_PATH}/*
- cd ${QDS_CI_ARTIFACTS_PATH} - cd ${QDS_CI_ARTIFACTS_PATH}
- | - |
for platform in $(ls); do for arch in $(ls); do
echo "Creating packages for platform $platform" echo "Running for ${arch}. Compressing..."
cd "$platform" # app folder contains the apk for the app
for arch in $(ls); do # test folder contains the apk for the tests
echo "Running for $platform-$arch. Compressing..." # we only need to compress the app folder
cd "$arch" current_dir=$(pwd)
tar -czf "$platform-$arch.tar.gz" * cd "${arch}/app"
echo "Uploading $platform-$arch.tar.gz to GitLab Package Registry" tar -czf "${arch}.tar.gz" *
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "${platform}-${arch}.tar.gz" ${QDS_PACKAGE_URL}/design_viewer-${CI_COMMIT_TAG}-qt${QDS_CI_QT_VERSION}-${platform}-${arch}.tar.gz echo "Uploading ${arch}.tar.gz to GitLab Package Registry"
cd .. curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file "${arch}.tar.gz" ${QDS_PACKAGE_URL}/qt-ui-viewer-${CI_COMMIT_TAG}-qt${QDS_CI_QT_VERSION}-multiarch.tar.gz
done cd ${current_dir}
cd ..
done done
artifacts: artifacts:
name: design-viewer-${CI_JOB_ID}-qt${QDS_CI_QT_VERSION} name: qt-ui-viewer-${CI_JOB_ID}-qt${QDS_CI_QT_VERSION}
paths: paths:
- ${QDS_CI_ARTIFACTS_PATH} - ${QDS_CI_ARTIFACTS_PATH}
expire_in: 1 week expire_in: 1 week
...@@ -45,23 +49,24 @@ create-release: ...@@ -45,23 +49,24 @@ create-release:
- job: create-packages - job: create-packages
artifacts: true artifacts: true
variables: variables:
QDS_PACKAGE_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/design-viewer/${CI_COMMIT_TAG}" QDS_PACKAGE_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/qt-ui-viewer/${CI_COMMIT_TAG}"
QDS_RELEASE_NAME: "Design Viewer - ${CI_COMMIT_TAG}" QDS_RELEASE_NAME: "Qt UI Viewer - ${CI_COMMIT_TAG}"
QDS_RELEASE_DESCRIPTION: "This version is built with Qt-${QDS_CI_QT_VERSION}." QDS_RELEASE_DESCRIPTION: "This version is built with Qt-${QDS_CI_QT_VERSION}."
GIT_SUBMODULE_STRATEGY: none
release: release:
name: ${QDS_RELEASE_NAME} name: ${QDS_RELEASE_NAME}
description: ${QDS_RELEASE_DESCRIPTION} description: ${QDS_RELEASE_DESCRIPTION}
tag_name: ${CI_COMMIT_TAG} tag_name: ${CI_COMMIT_TAG}
assets: assets:
links: links:
- name: "Binary Packages" - name: "Google Play Store"
url: "https://git.qt.io/design-studio/cloud-services/design-viewer-app/-/packages" url: "https://play.google.com/store/apps/details?id=io.qt.qtdesignviewer"
link_type: "other"
- name: "Prebuilt APK Files"
url: "https://git.qt.io/design-studio/design-viewer/qt-ui-viewer/-/packages"
link_type: "package" link_type: "package"
- name: "Docker Images - Android" - name: "Docker Images Used in CI/CD Pipeline"
url: "https://git.qt.io/design-studio/maintenance/docker-images/container_registry/143" url: "https://git.qt.io/design-studio/maintenance/docker-images/container_registry/155"
link_type: "image"
- name: "Docker Images - WASM"
url: "https://git.qt.io/design-studio/maintenance/docker-images/container_registry/142"
link_type: "image" link_type: "image"
script: script:
- echo "Releasing ${QDS_RELEASE_NAME}" - echo "Releasing ${QDS_RELEASE_NAME}"
.test-common:
stage: test
extends: .pipeline_common
variables:
GIT_SUBMODULE_STRATEGY: none
QDS_CI_JOB_TEST_RESULTS_PATH: ${CI_PROJECT_DIR}/test
artifacts:
paths:
- ${QDS_CI_JOB_TEST_RESULTS_PATH}/
reports:
junit: ${QDS_CI_JOB_TEST_RESULTS_PATH}/test.junit.xml
expire_in: 1 week
test-android:
extends: .test-common
tags:
- qds-blade-server-shell
needs:
- job: build-android
optional: false
artifacts: true
- job: build-desktop
optional: false
artifacts: true
script:
- |
if [[ ${QDS_CI_SKIP_TESTS} == "false" ]]; then
echo "Running tests";
else
echo "Skipping tests";
exit 0;
fi
- |
export ANDROID_SDK_ROOT=/opt/android
export PATH=$PATH:${ANDROID_SDK_ROOT}/cmdline-tools/latest/bin/
export PATH=$PATH:${ANDROID_SDK_ROOT}/emulator
export PATH=$PATH:${ANDROID_SDK_ROOT}/platform-tools
- |
if [[ $(adb devices | grep emulator) ]]; then
echo "Emulator is running";
else
echo "Starting emulator";
/opt/android/emulator/emulator -avd test -no-boot-anim -no-window -no-audio -no-snapshot -accel on & 2>&1 > /dev/null
counter=0
while [[ $(/opt/android/platform-tools/adb devices -l | egrep -Ev '^$|List' | wc -l) -eq 0 ]]; do
sleep 1
counter=$((counter+1))
if [[ $counter -gt 30 ]]; then
echo "Emulator didn't start in time. Exiting."
exit 1
fi
done
# let the emulator start
sleep 60;
fi
- cd ${QDS_CI_ARTIFACTS_PATH}/android/test || exit 1
- mkdir -p ${QDS_CI_JOB_TEST_RESULTS_PATH}
- |
while ! adb install -r -g android-build-release.apk; do
sleep 5
counter=$((counter+1))
if [[ $counter -gt 10 ]]; then
echo "Can't install the APK to the device in time. Exiting."
exit 1
fi
done
- adb shell pm clear io.qt.qtdesignviewer.test
- adb shell "run-as io.qt.qtdesignviewer.test rm -rf /data/data/io.qt.qtdesignviewer.test/files/output.junitxml"
- adb shell am start -e applicationArguments "'-o output.junitxml,junitxml'" -n io.qt.qtdesignviewer.test/org.qtproject.qt.android.bindings.QtActivity
- |
counter=0
while [ -z "$(adb shell pidof -s io.qt.qtdesignviewer.test)" ]; do
echo "Waiting for test to start"
sleep 1
counter=$((counter+1))
if [ $counter -gt 20 ]; then
echo "Test did not start in time"
exit 1
fi
done
- PID_OF_TEST=$(adb shell pidof -s io.qt.qtdesignviewer.test)
- 'echo "PID of test: ${PID_OF_TEST}"'
- |
counter=0
while [ -n "$(adb shell pidof -s io.qt.qtdesignviewer.test)" ]; do
echo "Waiting for test to finish"
sleep 1
counter=$((counter+1))
if [ $counter -gt 180 ]; then
echo "Test did not finish in time or did not start"
exit 1
fi
done
- adb logcat -d --pid=${PID_OF_TEST} > ${QDS_CI_JOB_TEST_RESULTS_PATH}/logcat.txt
- adb shell "run-as io.qt.qtdesignviewer.test cat /data/data/io.qt.qtdesignviewer.test/files/output.junitxml" > output.junit.xml
- adb uninstall io.qt.qtdesignviewer.test
- mv output.junit.xml ${QDS_CI_JOB_TEST_RESULTS_PATH}/test.junit.xml
- chmod +x ${CI_PROJECT_DIR}/tests/scripts/get_test_result.sh
- ${CI_PROJECT_DIR}/tests/scripts/get_test_result.sh ${QDS_CI_JOB_TEST_RESULTS_PATH}/test.junit.xml
# it's not working as of because of the headless mode
# possible bugs:
# - https://bugreports.qt.io/browse/QTBUG-124467
# - https://bugreports.qt.io/browse/QTBUG-126508
.test-desktop:
extends: .test-common
needs:
- job: build-desktop
optional: false
artifacts: true
script:
- |
if [[ ${QDS_CI_SKIP_TESTS} == "false" ]]; then
echo "Running tests";
else
echo "Skipping tests";
exit 0;
fi
- cd ${QDS_CI_ARTIFACTS_PATH}/gcc_64 || exit 1
- apt update; apt install -y libxcb-cursor0
- ./qtuiviewer_test
- cp output.junitxml ${QDS_CI_JOB_TEST_RESULTS_PATH}/test.junit.xml
icons/Windows/uv.ico

121 KiB