A drone plugin for building Qt apps for Android.
Go to file
Dorian Zedler fff744a9bb
All checks were successful
continuous-integration/drone/tag Build is passing
Fix: remove accidental paste
2023-02-05 14:00:55 +01:00
.drone.yml Update '.drone.yml' 2022-08-02 23:25:56 +02:00
Dockerfile Fix: remove accidental paste 2023-02-05 14:00:55 +01:00
qt-build Feat: Allow to provide the keystore file as base64 encoded string 2022-08-04 18:36:47 +02:00
README.md Feat: Allow to provide the keystore file as base64 encoded string 2022-08-04 18:36:47 +02:00

qt-android

A drone plugin for building Qt apps for Android.

Usage

The following settings changes this plugin's behavior.

  • qmake_arguments (optional) additional arguments for qmake.
  • androiddeployqt_arguments (optional) additional arguments for androiddeployqt.
  • src_dir (optional) the path to the source directory
  • android_keystore_path (optional) the path to the android_keystore file.
  • android_keystore_data (optional, secret recommended) the keystore file encoded as base64. If set, android_keystore_path will be ignored!
  • android_keystore_alias (required, if android_keystore_path or android_keystore_data is set) the keystore alias.
  • android_keystore_store_pass (optional, secret recommended) the password for the keystore.

Below is an example .drone.yml that uses this plugin.

kind: pipeline
name: default

steps:
- name: run itsblue.dev/plugins/qt-android plugin
  image: itsblue.dev/plugins/qt-android
  pull: if-not-exists
  settings:
    qmake_arguments: "CONFIG+=release"
    androiddeployqt_arguments: "--aab"
    src_dir: "."
    android_keystore_data:
      from_secret: android_keystore_data
    android_keystore_alias: "foo"
    android_keystore_store_pass:
      from_secret: android_keystore_store_pass

Building

Build the plugin image:

docker build -t itsblue.dev/plugins/qt-android -f Dockerfile .

Testing

Execute the plugin from your current working directory:

docker run --rm \
  -e DRONE_COMMIT_SHA=8f51ad7884c5eb69c11d260a31da7a745e6b78e2 \
  -e DRONE_COMMIT_BRANCH=master \
  -e DRONE_BUILD_NUMBER=43 \
  -e DRONE_BUILD_STATUS=success \
  -e PLUGIN_QMAKE_ARGUMENTS="CONFIG+=release" \
  -e PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS="--aab" \
  -e PLUGIN_SRC_DIR="." \
  -e PLUGIN_ANDROID_KEYSTORE_PATH="android_release.keystore" \
  -e PLUGIN_ANDROID_KEYSTORE_ALIAS="foo" \
  -e PLUGIN_ANDROID_KEYSTORE_STORE_PASS="strong_password" \
  -w /drone/src \
  -v $(pwd):/drone/src \
  itsblue.dev/plugins/qt-android

Using openssl

This image includes prebuilt openssl libraries. You may include them in your .pro file like so:

android {
    ANDROID_HOME = $$(ANDROID_HOME)
    include($$ANDROID_HOME/android_openssl/openssl.pri)
}