diff --git a/system-images/android/sdk/build-generic b/system-images/android/sdk/build-generic index fb5982d..77892b0 100755 --- a/system-images/android/sdk/build-generic +++ b/system-images/android/sdk/build-generic @@ -1,54 +1,23 @@ #!/bin/bash set -e # trap 'err_report echo "error: ${BASH_SOURCE}":"${LINENO}"' exit 1 DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" export PATH=$DIR:$PATH export PERSIST=1 package=$1 shift build-kde-dependencies $package # we now do the actual application separately # first we download the project and look for the manifest file pushd src git clone --depth 1 kde:$package $APP_GIT_EXTRA || true popd -manifestFile=`find $(pwd)/src/$package -name AndroidManifest.xml` -targetname=$(python3 ci-tooling/helpers/getsetting.py --project $package --product Applications --platform AndroidQt5.12 --key target-name || true) -if [[ -z "$targetname" && -n "$manifestFile" ]] -then - targetname=`python3 $DIR/target-from-manifest.py $manifestFile | tr '\n' ';' | head -c -1` - EXTRA+=" "-DANDROID_APK_DIR=$(dirname $manifestFile | tr '\n' ';' | head -c -1 ) -fi - -if [[ -z "$targetname" || "$targetname" =~ ".*%%.*" ]] -then - appdataFile=$(find $(pwd)/src/$package -name "*.appdata.xml") - if [[ -z "$appdataFile" ]]; then - echo "error: No AndroidManifest.xml or *.appdata.xml file :(" - exit 1 - fi - targetname=`python3 $DIR/target-from-appdata.py $appdataFile | tr '\n' ';' | head -c -1` -fi - -build-kde-project $package Applications -DQTANDROID_EXPORTED_TARGET=$targetname $EXTRA $@ - -pushd build/$package - -if [ -f /keys/${package}keystore-config ]; then - ARGS="`cat /keys/${package}keystore-config` $ARGS" make create-apk -elif [ -f /keys/androidkeystore-config ]; then - ARGS="`cat /keys/androidkeystore-config` $ARGS" make create-apk -else - make create-apk -fi - -if [ -d /output ] -then - find *_build_apk/build/outputs/apk/ -name \*.apk -print0 | xargs -I{} -0 cp -v {} /output -fi +APK_ARGS=`get-apk-args $package` +build-kde-project $package Applications $APK_ARGS $@ +create-apk $package diff --git a/system-images/android/sdk/create-apk b/system-images/android/sdk/create-apk new file mode 100755 index 0000000..20336d0 --- /dev/null +++ b/system-images/android/sdk/create-apk @@ -0,0 +1,20 @@ +#!/bin/bash +set -e + +package=$1 +shift + +pushd build/$package + +if [ -f /keys/${package}keystore-config ]; then + ARGS="`cat /keys/${package}keystore-config` $ARGS" make create-apk +elif [ -f /keys/androidkeystore-config ]; then + ARGS="`cat /keys/androidkeystore-config` $ARGS" make create-apk +else + make create-apk +fi + +if [ -d /output ] +then + find *_build_apk/build/outputs/apk/ -name \*.apk -print0 | xargs -I{} -0 cp -v {} /output +fi diff --git a/system-images/android/sdk/build-generic b/system-images/android/sdk/get-apk-args similarity index 52% copy from system-images/android/sdk/build-generic copy to system-images/android/sdk/get-apk-args index fb5982d..3abb395 100755 --- a/system-images/android/sdk/build-generic +++ b/system-images/android/sdk/get-apk-args @@ -1,54 +1,27 @@ #!/bin/bash set -e -# trap 'err_report echo "error: ${BASH_SOURCE}":"${LINENO}"' exit 1 - -DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -export PATH=$DIR:$PATH -export PERSIST=1 package=$1 shift -build-kde-dependencies $package - -# we now do the actual application separately - -# first we download the project and look for the manifest file -pushd src -git clone --depth 1 kde:$package $APP_GIT_EXTRA || true -popd +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" manifestFile=`find $(pwd)/src/$package -name AndroidManifest.xml` targetname=$(python3 ci-tooling/helpers/getsetting.py --project $package --product Applications --platform AndroidQt5.12 --key target-name || true) if [[ -z "$targetname" && -n "$manifestFile" ]] then targetname=`python3 $DIR/target-from-manifest.py $manifestFile | tr '\n' ';' | head -c -1` EXTRA+=" "-DANDROID_APK_DIR=$(dirname $manifestFile | tr '\n' ';' | head -c -1 ) fi if [[ -z "$targetname" || "$targetname" =~ ".*%%.*" ]] then appdataFile=$(find $(pwd)/src/$package -name "*.appdata.xml") if [[ -z "$appdataFile" ]]; then echo "error: No AndroidManifest.xml or *.appdata.xml file :(" exit 1 fi targetname=`python3 $DIR/target-from-appdata.py $appdataFile | tr '\n' ';' | head -c -1` fi -build-kde-project $package Applications -DQTANDROID_EXPORTED_TARGET=$targetname $EXTRA $@ - -pushd build/$package - -if [ -f /keys/${package}keystore-config ]; then - ARGS="`cat /keys/${package}keystore-config` $ARGS" make create-apk -elif [ -f /keys/androidkeystore-config ]; then - ARGS="`cat /keys/androidkeystore-config` $ARGS" make create-apk -else - make create-apk -fi - -if [ -d /output ] -then - find *_build_apk/build/outputs/apk/ -name \*.apk -print0 | xargs -I{} -0 cp -v {} /output -fi +echo "-DQTANDROID_EXPORTED_TARGET=$targetname $EXTRA"