qt-android/qt-build

31 lines
1 KiB
Text
Raw Normal View History

2022-07-28 23:29:11 +02:00
#!/bin/bash
set -e
[[ -z "${PLUGIN_QMAKE_ARGUMENTS}" ]] && QMAKE_ARGUMENTS=$1 || QMAKE_ARGUMENTS="${PLUGIN_QMAKE_ARGUMENTS}"
[[ -z "${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}" ]] && ANDROIDDEPLOYQT_ARGUMENTS=$2 || ANDROIDDEPLOYQT_ARGUMENTS="${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}"
2022-08-02 23:47:27 +02:00
[[ -z "${PLUGIN_SRC_DIR}" ]] && SRC_DIR=$(pwd) || SRC_DIR=$(realpath "${PLUGIN_SRC_DIR}")
2022-07-29 09:01:06 +02:00
2022-07-29 09:08:16 +02:00
echo "**** environment: ****"
echo "* QMAKE_ARGUMENTS=${QMAKE_ARGUMENTS}"
echo "* ANDROIDDEPLOYQT_ARGUMENTS=${PLUGIN_ANDROIDDEPLOYQT_ARGUMENTS}"
echo "* SRC_DIR=${SRC_DIR}"
echo "**********************"
echo ""
2022-07-28 23:29:11 +02:00
echo "**** prepare ****"
rm -rf /build
mkdir -p /build
cd /build
echo "**** qmake ****"
2022-07-29 09:01:06 +02:00
qmake $QMAKE_ARGUMENTS $SRC_DIR
2022-07-28 23:29:11 +02:00
echo "**** build native code ****"
make -j8
make INSTALL_ROOT=/build/android-build install
echo "**** android build ****"
androiddeployqt --input $(ls -1 /build/android-*-deployment-settings.json) --output /build/android-build --gradle $ANDROIDDEPLOYQT_ARGUMENTS
echo "**** finish up ****"
2022-07-29 09:01:06 +02:00
mv /build/android-build//build/outputs $SRC_DIR/outputs