Coder Social home page Coder Social logo

qtci's Introduction

QT-CI

This project collects a set of script for building Qt application for Android/iOS in command line environment.

Build Status

Check .travis.yml to see how it works. It will demonstrate how to build an apk file using QT-CI scripts.

Installation

Since this project is a collection of scripts, and the script in the bin folder does not have any dependence on each other. It is not necessary to clone/download the whole repository into your build environment. You may simply copy the script you need from this repository.

recipes/install-qt

To automatically install Qt, you can just download 2 scripts and grant them permission for execution.

"recipes/install-qt" "bin/extract-qt-installer"

Then just run script "recipes/install-qt" with the desired version of Qt Example:

bash install-qt 5.9.4

Environment variables

QT_CI_PACKAGES - packages to install. You can check available packages if set VERBOSE to 1.

Example:

export VERBOSE=1
export QT_CI_PACKAGES=qt,qt.594,qt.594.gcc_64,qt.594.doc.qtvirtualkeyboard

Setup

git clone https://github.com/benlau/qtci.git

source qtci/path.env #Add qtci/bin and qtci/recipes to $PATH

Script

(1) bin/extract-qt-installer

Usage

    extract-qt-installer [--disable-progress-report] qt-installer output_path
    extract-qt-installer --list-packages qt-installer

Extract Qt from the installer to the target path (for Qt 5.5 or above). If --list-packages is given, it will show the available packages from the installer and terminate immediately.

Example:

extract-qt-installer qt-opensource-linux-x64-android-5.5.1.run ~/Qt

Remarks: The installation path must be absolute path

Environment Variables

VERBOSE [Optional] Set to "true" will enable VERBOSE output
QT_CI_PACKAGES [Optional] Select the components to be installed instead of using default (eg. QT_CI_PACKAGES="qt.59.gcc_64")
QT_CI_LOGIN [Optional] The login name 
QT_CI_PASSWORD [Optional] The password of login

The arguments and environment required could be different due to the installer changes. Check the recipes folder or the wiki of known issues to find out the correct setting.

(2) bin/extract-ifw

Extract installer of "Qt installer framework" to the target path

Example:

extract-ifw qt-installer-framework-opensource-1.5.0-x64.run ~/QtIfw

(3) bin/install-android-sdk

Download and install Android SDK

Example:

install-android-sdk platform-tool,build-tools-20.0.0,android-19

(4) bin/build-android-gradle-project

Build a Qt Android project and sign the APK

Usage:

build-android-gradle-project project.pro

Required Environment Variables

QT_HOME [Required] The home directory of installed Qt. (e.g., ~/Qt/5.7)
KEYSTORE [Optional] The location of keystore. If it is set, it will be used to sign the created apk
KEYALIAS [Optional] The alias of the keystore
KEYPASS  [Optional] The password of keystore.
    ANDROID_TARGET_SDK_VERSION [Optional] Target Android SDK version. The default value is "19"

(5) bin/increase-android-version-code

Usage

increase-android-version-code AndroidManifest.xml

Given an AndroidManifest.xml file, it will increase the value of the versionCode field by one.

(6) bin/run-unittests

Usage

run-unittests project.pro

Build and run a unit test project in the current folder. If qpm.json were found, it would call qpm install first.

Recipes

In the folder "recipes", it contains a set of script that could download and install specific Qt toolchains for a different environment. (Include Android)

Please feel free to modify and submit a new recipe.

Example

apt-get install openjdk-8-jdk p7zip

source path.env #Add $PWD/bin and $PWD/recipes to $PATH

#Change to the installation path

qt-5.5.1-android-19 # Install Qt 5.5.1 and Android SDK

source qt-5.5.1-android-19.env # Add installed Qt path to $PATH

Reference

  1. Continuous distribution for Qt applications on desktop and mobile
  2. Andrew's Articles - Continuous deployment for Qt applications

Related Projects

  1. benlau/quickpromise - Promise library for QML
  2. benlau/quickcross - QML Cross Platform Utility Library
  3. benlau/qsyncable - Synchronize data between models
  4. benlau/testable - QML Unit Test Utilities
  5. benlau/quickflux - Message Dispatcher / Queue for Qt/QML
  6. benlau/biginteger - QML BigInteger library

qtci's People

Contributors

ablu avatar benlau avatar cguenthertuchemnitz avatar kneirinck avatar lasconic avatar martindelille avatar mrgreywater avatar tsteven4 avatar van9konst avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

qtci's Issues

./bin/extract-qt-installer not finish

In ubuntu20.04 WSL | Windows 10

After run command:

sudo ./bin/extract-qt-installer /root/qtci/qt-opensource-linux-x64-5.12.0.run /root/Qt

The extract-qt-installer keeps on [18] QTCI: Welcome Page.

Is this an error ? How can i finish de extracting and finally use Qt ?

install-qt fails on macOS for Qt < 5.9.0

Until Qt 5.9.0, the Qt packages for macOS included the word "clang". This needs to be added to the download URL used by install-qt, otherwise it will only work for Qt >= 5.9.0.

Compare:
https://download.qt.io/archive/qt/5.8/5.8.0/qt-opensource-mac-x64-clang-5.8.0.dmg
https://download.qt.io/archive/qt/5.9/5.9.0/qt-opensource-mac-x64-5.9.0.dmg

At the same time, the packages increased in size from 1.1 GB to 3.5 GB. I guess they now include the Android and iOS builds...

Note that these older versions aren't included in the autotests, since on macOS the oldest tested version is 5.9.7.

Stuck at Ready to install

Hi!

I am trying to install qt 5.12.6 in an Ubuntu 16.04 docker image.

I configured QT_CI_LOGIN and QT_CI_PASSWORD (and VERBOSE).

The result is that the installation stops at:
[942] QTCI: Ready to install

I looked at the travis.yml script but I do not see what I did wrong.

source qtci/path.env
bash install-qt 5.12.6

Downloading Qt
--2020-09-03 07:00:41-- https://download.qt.io/archive/qt/5.12/5.12.6/qt-opensource-linux-x64-5.12.6.run
Resolving download.qt.io (download.qt.io)... 77.86.229.90
Connecting to download.qt.io (download.qt.io)|77.86.229.90|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://qt-mirror.dannhauer.de/archive/qt/5.12/5.12.6/qt-opensource-linux-x64-5.12.6.run [following]
--2020-09-03 07:00:41-- http://qt-mirror.dannhauer.de/archive/qt/5.12/5.12.6/qt-opensource-linux-x64-5.12.6.run
Resolving qt-mirror.dannhauer.de (qt-mirror.dannhauer.de)... 136.243.168.226, 2a01:4f8:171:168e::2
Connecting to qt-mirror.dannhauer.de (qt-mirror.dannhauer.de)|136.243.168.226|:80... connected.
HTTP request sent, awaiting response... 304 Not Modified
File 'qt-opensource-linux-x64-5.12.6.run' not modified on server. Omitting download.

Installing Qt
QStandardPaths: XDG_RUNTIME_DIR not set, defaulting to '/tmp/runtime-jenkins'
[30] QTCI: Welcome Page
[889] QTCI: Introduction Page
[889] QTCI: Retrieving meta information from remote repository
[922] QTCI: Set target installation page: /home/jenkins/Mercurial/SW_APP/Qt
[926] QTCI: ComponentSelectionPageCallback
[926] QTCI: Select components
[928] QTCI: Use default component list
[935] QTCI: Accept license agreement
[941] QTCI: Ready to install

Extractor installs too much

When I run the extractor with
ENV QT_CI_PACKAGES="qt.qt5.5132.qtwebengine"

I still have libQt5Gamepad.so, libQt5Bluetooth.so and other various unnecessary libs.
There is also /qt/5.13.2/gcc_64/docs/.

How do I do a minimal install of the libraries i want?

[travis] Support Qt 5.10+

Running extract-qt-installer to install Qt 5.10+ on ubuntu trusty with travis yields the following error message and then a deadlock:


+./extract-qt-installer --list-packages /home/travis/Qt/qt-opensource-linux-x64-5.10.1.run
[409] QTCI:  Welcome Page
[1242] QTCI:  Introduction Page
[1242] QTCI:  Retrieving meta information from remote repository
[1288] QTCI:  Set target installation page: /tmp/Qt
[1293] QTCI:  ComponentSelectionPageCallback
[1303] QTCI:  Available components: 62
[1303] QTCI:  Packages:  qt qt.qt5.5101 qt.tools qt.license.thirdparty qt.license.python qt.license.lgpl qt.license.gplv3except qt.installer.changelog qt.qt5.5101.gcc_64 qt.qt5.5101.android_x86 qt.qt5.5101.android_armv7 qt.qt5.5101.src qt.qt5.5101.qtcharts qt.qt5.5101.qtdatavis3d qt.qt5.5101.qtpurchasing qt.qt5.5101.qtvirtualkeyboard qt.qt5.5101.qtwebengine qt.qt5.5101.qtnetworkauth qt.qt5.5101.qtremoteobjects qt.qt5.5101.qtwebglplugin qt.qt5.5101.qtscript qt.qt5.5101.doc qt.qt5.5101.examples qt.qt5.5101.qtcharts.gcc_64 qt.qt5.5101.qtcharts.android_armv7 qt.qt5.5101.qtcharts.android_x86 qt.qt5.5101.qtdatavis3d.android_armv7 qt.qt5.5101.qtdatavis3d.android_x86 qt.qt5.5101.qtdatavis3d.gcc_64 qt.qt5.5101.qtpurchasing.gcc_64 qt.qt5.5101.qtpurchasing.android_armv7 qt.qt5.5101.qtpurchasing.android_x86 qt.qt5.5101.qtvirtualkeyboard.gcc_64 qt.qt5.5101.qtwebengine.gcc_64 qt.qt5.5101.qtnetworkauth.android_armv7 qt.qt5.5101.qtnetworkauth.gcc_64 qt.qt5.5101.qtnetworkauth.android_x86 qt.qt5.5101.qtremoteobjects.gcc_64 qt.qt5.5101.qtremoteobjects.android_armv7 qt.qt5.5101.qtremoteobjects.android_x86 qt.qt5.5101.qtwebglplugin.gcc_64 qt.qt5.5101.qtscript.gcc_64 qt.qt5.5101.qtscript.android_x86 qt.qt5.5101.qtscript.android_armv7 qt.qt5.5101.doc.qtpurchasing qt.qt5.5101.doc.qtcharts qt.qt5.5101.doc.qtnetworkauth qt.qt5.5101.doc.qtdatavis3d qt.qt5.5101.doc.qtvirtualkeyboard qt.qt5.5101.doc.qtwebengine qt.qt5.5101.doc.qtremoteobjects qt.qt5.5101.doc.qtscript qt.qt5.5101.examples.qtnetworkauth qt.qt5.5101.examples.qtserialbus qt.qt5.5101.examples.qtcharts qt.qt5.5101.examples.qtpurchasing qt.qt5.5101.examples.qtremoteobjects qt.qt5.5101.examples.qtdatavis3d qt.qt5.5101.examples.qtscript qt.qt5.5101.examples.qtvirtualkeyboard qt.qt5.5101.examples.qtwebengine qt.tools.qtcreator
+./extract-qt-installer /home/travis/Qt/qt-opensource-linux-x64-5.10.1.run /home/travis/Qt
[52] QTCI:  Welcome Page
[865] QTCI:  Introduction Page
[866] QTCI:  Retrieving meta information from remote repository
[914] QTCI:  Set target installation page: /home/travis/Qt
[918] QTCI:  ComponentSelectionPageCallback
[918] QTCI:  Select components
[920] QTCI:  Select qt.qt5.5101.gcc_64
[932] QTCI:  Accept license agreement
[942] QTCI:  Ready to install
[946] QTCI:  PerformInstallationPageCallback
[977] backup  operation: Mkdir
[978] perform  operation: Mkdir
[1043] QTCI:  FinishedPageCallback
[1046] backup qt.tools.qtcreator operation: Extract
[1046] perform qt.tools.qtcreator operation: Extract
[10036] backup qt.tools.qtcreator operation: Extract
[10036] perform qt.tools.qtcreator operation: Extract
[10180] backup qt.tools.qtcreator operation: InstallIcons
[10180] perform qt.tools.qtcreator operation: InstallIcons
[10184] backup qt.tools.qtcreator operation: CreateDesktopEntry
[10186] perform qt.tools.qtcreator operation: CreateDesktopEntry
[10186] backup qt.license.lgpl operation: License
[10186] perform qt.license.lgpl operation: License
[10187] backup qt.license.thirdparty operation: Extract
[10187] perform qt.license.thirdparty operation: Extract
[10190] backup qt.qt5.5101.examples operation: Extract
[10190] perform qt.qt5.5101.examples operation: Extract
[13685] backup qt.qt5.5101.doc operation: Extract
[13685] perform qt.qt5.5101.doc operation: Extract
[26111] backup qt.qt5.5101.gcc_64 operation: Extract
[26111] perform qt.qt5.5101.gcc_64 operation: Extract
[26773] backup qt.qt5.5101.gcc_64 operation: Extract
[26773] perform qt.qt5.5101.gcc_64 operation: Extract
[27223] backup qt.qt5.5101.gcc_64 operation: Extract
[27223] perform qt.qt5.5101.gcc_64 operation: Extract
[29001] backup qt.qt5.5101.gcc_64 operation: Extract
[29001] perform qt.qt5.5101.gcc_64 operation: Extract
[29015] backup qt.qt5.5101.gcc_64 operation: Extract
[29015] perform qt.qt5.5101.gcc_64 operation: Extract
[29068] backup qt.qt5.5101.gcc_64 operation: Extract
[29068] perform qt.qt5.5101.gcc_64 operation: Extract
[29460] backup qt.qt5.5101.gcc_64 operation: Extract
[29460] perform qt.qt5.5101.gcc_64 operation: Extract
[29469] backup qt.qt5.5101.gcc_64 operation: Extract
[29470] perform qt.qt5.5101.gcc_64 operation: Extract
[29480] backup qt.qt5.5101.gcc_64 operation: Extract
[29480] perform qt.qt5.5101.gcc_64 operation: Extract
[29512] backup qt.qt5.5101.gcc_64 operation: Extract
[29512] perform qt.qt5.5101.gcc_64 operation: Extract
[29732] backup qt.qt5.5101.gcc_64 operation: Extract
[29732] perform qt.qt5.5101.gcc_64 operation: Extract
[29816] backup qt.qt5.5101.gcc_64 operation: Extract
[29816] perform qt.qt5.5101.gcc_64 operation: Extract
[29926] backup qt.qt5.5101.gcc_64 operation: Extract
[29926] perform qt.qt5.5101.gcc_64 operation: Extract
[30126] backup qt.qt5.5101.gcc_64 operation: Extract
[30126] perform qt.qt5.5101.gcc_64 operation: Extract
[30151] backup qt.qt5.5101.gcc_64 operation: Extract
[30151] perform qt.qt5.5101.gcc_64 operation: Extract
[30176] backup qt.qt5.5101.gcc_64 operation: Extract
[30176] perform qt.qt5.5101.gcc_64 operation: Extract
[30195] backup qt.qt5.5101.gcc_64 operation: Extract
[30195] perform qt.qt5.5101.gcc_64 operation: Extract
[30201] backup qt.qt5.5101.gcc_64 operation: Extract
[30201] perform qt.qt5.5101.gcc_64 operation: Extract
[30207] backup qt.qt5.5101.gcc_64 operation: Extract
[30207] perform qt.qt5.5101.gcc_64 operation: Extract
[30223] backup qt.qt5.5101.gcc_64 operation: Extract
[30223] perform qt.qt5.5101.gcc_64 operation: Extract
[30610] backup qt.qt5.5101.gcc_64 operation: Extract
[30610] perform qt.qt5.5101.gcc_64 operation: Extract
[30766] backup qt.qt5.5101.gcc_64 operation: Extract
[30766] perform qt.qt5.5101.gcc_64 operation: Extract
[30774] backup qt.qt5.5101.gcc_64 operation: Extract
[30774] perform qt.qt5.5101.gcc_64 operation: Extract
[30784] backup qt.qt5.5101.gcc_64 operation: Extract
[30784] perform qt.qt5.5101.gcc_64 operation: Extract
[30791] backup qt.qt5.5101.gcc_64 operation: Extract
[30791] perform qt.qt5.5101.gcc_64 operation: Extract
[30793] backup qt.qt5.5101.gcc_64This plugin does not support createPlatformOpenGLContext!
This plugin does not support application fonts
This plugin does not support application fonts
This plugin does not support application fonts
This plugin does not support createPlatformOpenGLContext!
This plugin does not support propagateSizeHints()
This plugin does not support propagateSizeHints()
This plugin does not support propagateSizeHints()
This plugin does not support propagateSizeHints()
No output has been received in the last 10m0s, this potentially indicates a stalled build or something wrong with the build itself.
Check the details on how to adjust your build configuration on: https://docs.travis-ci.com/user/common-build-problems/#Build-times-out-because-no-output-was-received
The build has been terminated

I assume it tries to load the gui but since it's in a headless environment it can't open a window and initialize opengl.

Would be nice if support could be added.

note: I only tried qt-opensource-linux-x64-5.10.1.run and qt-opensource-linux-x64-5.11.2.run
edit: actually, even qt 5.9.5 is giving this error and freezes when trying to install export QT_CI_PACKAGES="qt.595.gcc_64". Qt 5.9.2 with export QT_CI_PACKAGES="qt.592.gcc_64" works fine.

Qt Installer Framework Authentication

If you look at the qtaccount.ini after installation, you will find qtaccount.ini, and the values for it in the variables, Qt looks for this file on startup, and if there it will use this information, and its encrypted, so its much safer to store in Travis Environment Variables.

if [ ! -z "QT_CI_LOGIN" ]; then echo "[QtAccount]\nemail=${QT_CI_LOGIN}\njwt=${QT_JWT}\nu=${QT_U}\n" > qtaccount.ini; fi;

Thanks

Script quits on welcome screen

I've been trying to get this to work for the past few days but I cannot get this script to run. It gets to the welcome screen then crashes, with the following "/home/travis/build/tekuma-tech/qgroundcontrol/qtci/bin/extract-qt-installer: line 337: 7348 Aborted (core dumped) QT_QPA_PLATFORM=minimal $INSTALLER $ARGS --script $SCRIPT"

Installer stops after Welcome page

Hi,
I'm trying to install qt 5.13.2 and the installer stops after the Welcome page:

 Installing Qt
/dev/disk3          	GUID_partition_scheme
/dev/disk3s1        	EFI
/dev/disk3s2        	Apple_HFS                      	/Volumes/qt-opensource-mac-x64-5.13.2 1
[806] QTCI:  Welcome Page

The problems started yesterday.
Do you have a workaround?

Link in README.md Reference Andrew's Articles 404 error

Link in README.md Reference Andrew's Articles - Continuous deployment for Qt applications

Corrections:
1: http to https to prevent page reload
2: Remove trailing / that is causing the 404 error

http://andrewdolby.com/articles/2016/continuous-deployment-for-qt-applications/

Change to:

https://andrewdolby.com/articles/2016/continuous-deployment-for-qt-applications

At first, I thought it was just a bad link.

Thanks

Feature-Request: V-Play support

Your qt ci scripts are very helpful for a vanilla qt setup. Nevertheless the qt mobile development uses often the v-play project, which encapsulates the qt-build and provides additional stuff for faster and easier development.

So it would be nice, if this installer would also be supported by your CI scripts.

https://v-play.net/

best,
Christian

Question about env file

In your travis.yml you have this line at the bottom, I was hoping to modify it for 13.2, but ran into a question, source qt-5.12.4.env is not in your repo, but you reference it here:

- QT_CI_PACKAGES=qt.qt5.5124.gcc_64 PATH=${TRAVIS_BUILD_DIR}/recipes:${TRAVIS_BUILD_DIR}/bin:${PATH} install-qt 5.12.4 && source qt-5.12.4.env && qmake -version && test "$(qmake -query QT_VERSION)" = "5.12.4"

Where does this file come from?

I am trying to install Qt 13.2 with Qml support, and Qt Installer Framework, do you have an example of this for Linux that will work on Ubuntu 16 LTS, or some help as to how it can be done?

Thanks

[Feature request] Allow custom downloader in scripts

It would be nice if one could set a custom command for downloading before invoking the scripts. Since some of the downloads are pretty large, having a downloader that supports multiple connections such as aria2c or axel can make the difference between waiting 5 minutes, or waiting 3 seconds in travis.

Something like

export QTCI_DOWNLOAD='axel -q -c -n 16'
./install-qt 5.10.1

Internally, QTCI_DOWNLOAD could be set to a default value of 'wget -c -nv' if not defined previously.

Including source with extract-qt-installer

Hi!
Thanks for this useful repository.
Could you give me a hint as to how I could automatically include the sources by modifying extract-qt-installer?
I'm not familiar at all with Qt installation framework. I'm working on it but I guess it will take me days to figure this out on my own...
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.