Compare commits
2 commits
ee60c4a54d
...
84beb35c31
Author | SHA1 | Date | |
---|---|---|---|
84beb35c31 | |||
46ea97ed6f |
2 changed files with 58 additions and 3 deletions
47
README.md
47
README.md
|
@ -1,3 +1,50 @@
|
||||||
# qt-android
|
# qt-android
|
||||||
|
|
||||||
A drone plugin for building Qt apps for 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.
|
||||||
|
|
||||||
|
Below is an example `.drone.yml` that uses this plugin.
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
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_attributes: "CONFIG+=release"
|
||||||
|
androiddeployqt_attributes: "--aab"
|
||||||
|
```
|
||||||
|
|
||||||
|
# Building
|
||||||
|
|
||||||
|
Build the plugin image:
|
||||||
|
|
||||||
|
```text
|
||||||
|
docker build -t itsblue.dev/plugins/qt-android -f Dockerfile .
|
||||||
|
```
|
||||||
|
|
||||||
|
# Testing
|
||||||
|
|
||||||
|
Execute the plugin from your current working directory:
|
||||||
|
|
||||||
|
```text
|
||||||
|
docker run --rm -e PLUGIN_FOLDER=public -e PLUGIN_SSH_KEY=foo \
|
||||||
|
-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"
|
||||||
|
-w /drone/src \
|
||||||
|
-v $(pwd):/drone/src \
|
||||||
|
itsblue.dev/plugins/qt-android
|
||||||
|
```
|
||||||
|
|
12
qt-build
12
qt-build
|
@ -4,13 +4,21 @@ set -e
|
||||||
[[ -z "${PLUGIN_QMAKE_ARGUMENTS}" ]] && QMAKE_ARGUMENTS=$1 || QMAKE_ARGUMENTS="${PLUGIN_QMAKE_ARGUMENTS}"
|
[[ -z "${PLUGIN_QMAKE_ARGUMENTS}" ]] && QMAKE_ARGUMENTS=$1 || QMAKE_ARGUMENTS="${PLUGIN_QMAKE_ARGUMENTS}"
|
||||||
[[ -z "${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}" ]] && ANDROIDDEPLOYQT_ARGUMENTS=$2 || ANDROIDDEPLOYQT_ARGUMENTS="${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}"
|
[[ -z "${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}" ]] && ANDROIDDEPLOYQT_ARGUMENTS=$2 || ANDROIDDEPLOYQT_ARGUMENTS="${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}"
|
||||||
|
|
||||||
|
SRC_DIR=$(pwd)
|
||||||
|
|
||||||
|
echo "**** environment: ****"
|
||||||
|
echo "* QMAKE_ARGUMENTS=${QMAKE_ARGUMENTS}"
|
||||||
|
echo "* ANDROIDDEPLOYQT_ARGUMENTS=${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}"
|
||||||
|
echo "* SRC_DIR=${SRC_DIR}"
|
||||||
|
echo "**********************"
|
||||||
|
echo ""
|
||||||
echo "**** prepare ****"
|
echo "**** prepare ****"
|
||||||
rm -rf /build
|
rm -rf /build
|
||||||
mkdir -p /build
|
mkdir -p /build
|
||||||
cd /build
|
cd /build
|
||||||
|
|
||||||
echo "**** qmake ****"
|
echo "**** qmake ****"
|
||||||
qmake $QMAKE_ARGUMENTS /src
|
qmake $QMAKE_ARGUMENTS $SRC_DIR
|
||||||
|
|
||||||
echo "**** build native code ****"
|
echo "**** build native code ****"
|
||||||
make -j8
|
make -j8
|
||||||
|
@ -20,4 +28,4 @@ echo "**** android build ****"
|
||||||
androiddeployqt --input $(ls -1 /build/android-*-deployment-settings.json) --output /build/android-build --gradle $ANDROIDDEPLOYQT_ARGUMENTS
|
androiddeployqt --input $(ls -1 /build/android-*-deployment-settings.json) --output /build/android-build --gradle $ANDROIDDEPLOYQT_ARGUMENTS
|
||||||
|
|
||||||
echo "**** finish up ****"
|
echo "**** finish up ****"
|
||||||
mv /build/android-build//build/outputs /src/outputs
|
mv /build/android-build//build/outputs $SRC_DIR/outputs
|
||||||
|
|
Loading…
Reference in a new issue