Changeset 9a754b66 in subsurface


Ignore:
Timestamp:
Feb 3, 2017, 5:45:26 PM (4 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
911d279
Parents:
ca6a241
git-author:
Dirk Hohndel <dirk@…> (02/03/17 17:27:45)
git-committer:
Dirk Hohndel <dirk@…> (02/03/17 17:45:26)
Message:

Extend Android wrapper shell to be smarter

Move it to packaging/android where it belongs
Use direct URLs to download Android components
Make sure required packages are installed (only tested on Ubuntu)

Signed-off-by: Dirk Hohndel <dirk@…>

File:
1 moved

Legend:

Unmodified
Added
Removed
  • packaging/android/android-build-wrapper.sh

    ra69852e r9a754b66  
    1111exec 1> >(tee ./build.log) 2>&1
    1212
    13 USE_X=`case "$-" in *x*) echo "-x" ;; esac`
     13USE_X=$(case "$-" in *x*) echo "-x" ;; esac)
    1414
    1515# these are the current versions for Qt, Android SDK & NDK:
     
    3434fi
    3535
     36# make sure we have the required commands installed
     37MISSING=""
     38for i in git cmake autoconf libtool java ant; do
     39        which $i > /dev/null 2>&1 ||
     40                if [ "$i" = "libtool" ] ; then
     41                        MISSING="${MISSING}libtool-bin "
     42                elif [ "$i" = "java" ] ; then
     43                        MISSING="${MISSING}openjdk-8-jdk "
     44                else
     45                        MISSING="${MISSING}${i} "
     46                fi
     47done
     48if [ "$MISSING" != "" ] ; then
     49        echo "The following packages are missing: $MISSING"
     50        echo "Please install via your package manager."
     51        exit
     52fi
     53
    3654# download the Qt installer including Android bits and unpack / install
    3755QT_DOWNLOAD_URL=https://download.qt.io/archive/qt/${QT_VERSION}/${LATEST_QT}/${QT_BINARIES}
    38 if [ ! -f ${QT_BINARIES} ] ; then
    39         wget ${QT_DOWNLOAD_URL}
     56if [ ! -d Qt${LATEST_QT} ] ; then
     57        if [ ! -f ${QT_BINARIES} ] ; then
     58                wget ${QT_DOWNLOAD_URL}
     59        fi
    4060        echo "In the binary installer select $(pwd)/${LATEST_QT} as install directory"
    41         bash ./${QT_BINARIES}
     61        chmod +x ./${QT_BINARIES}
     62        ./${QT_BINARIES}
    4263fi
    4364
    4465[ -e Qt ] || ln -s Qt${LATEST_QT} Qt
    4566
     67# patch the cmake / Qt5.7.1 incompatibility mentioned above
     68sed -i 's/set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)/# set_property(TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_FEATURES cxx_decltype)/' Qt/5.7/android_armv7/lib/cmake/Qt5Core/Qt5CoreConfigExtras.cmake
     69
    4670# next we need to get the Android SDK and NDK
    4771if [ ! -d $ANDROID_NDK ] ; then
    4872        if [ ! -f $NDK_BINARIES ] ; then
    49                 echo "Please download the Android NDK $NDK_BINARIES from Google's servers and place it in this directory"
    50                 exit
     73                wget https://dl.google.com/android/repository/$NDK_BINARIES
    5174        fi
    5275        unzip $NDK_BINARIES
     
    5578if [ ! -d $ANDROID_SDK ] ; then
    5679        if [ ! -f $SDK_TOOLS ] ; then
    57                 echo "Please download the Android SDK $SDK_TOOLS from Google's servers and place it in this directory"
    58                 exit
     80                wget https://dl.google.com/android/repository/$SDK_TOOLS
    5981        fi
    6082        mkdir $ANDROID_SDK
     
    95117        BUILDNR=$(cat ./buildnr.dat)
    96118fi
    97 BUILDNR=`expr ${BUILDNR} + 1`
     119((BUILDNR++))
    98120echo "${BUILDNR}" > ./buildnr.dat
    99121
     
    110132rm -d ./subsurface-mobile-build-arm/AndroidManifest.xml
    111133rm -d ./subsurface-mobile-build-arm/bin/AndroidManifest.xml
    112 bash $USE_X subsurface/packaging/android/build.sh $RELEASE -buildnr ${BUILDNR} arm $@
     134bash "$USE_X" subsurface/packaging/android/build.sh "$RELEASE" -buildnr "$BUILDNR" arm "$@"
    113135
     136ls -l ./subsurface-mobile-build-arm/bin/*.apk
     137
Note: See TracChangeset for help on using the changeset viewer.