From 7059f7c9d52881448b0d626f2ecb7e4bb8980cd2 Mon Sep 17 00:00:00 2001 From: mvglasow Date: Tue, 8 Jan 2019 20:19:42 +0100 Subject: Move Android build to separate script (#727) * Add:circleci:Install dependencies before the first build step Signed-off-by: mvglasow * Refactor:core:Make style check happy Signed-off-by: mvglasow * Refactor:core:Make style check happy Signed-off-by: mvglasow * Fix:circleci:ninja-build is a build dependency Signed-off-by: mvglasow * Add:circleci:Install Android cmake instead of ninja-build Signed-off-by: mvglasow * Refactor:circleci:Move Android build to external script Signed-off-by: mvglasow * Fix:circleci:Fix globbing errors Signed-off-by: mvglasow --- scripts/build_android_arm.sh | 61 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100755 scripts/build_android_arm.sh (limited to 'scripts') diff --git a/scripts/build_android_arm.sh b/scripts/build_android_arm.sh new file mode 100755 index 000000000..74cf8e28d --- /dev/null +++ b/scripts/build_android_arm.sh @@ -0,0 +1,61 @@ +#!/bin/bash +# Build Navit for Android on ARM. +# +# This script is to be run from the root of the Navit source tree. It is used by CircleCI as well as for local builds, +# in order to keep build environments as uniform as possible and CI test results meaningful. +# +# When running this script locally, ensure all build dependencies are in place: +# - Packages required: cmake gettext libsaxonb-java librsvg2-bin pkg-config libprotobuf-c-dev protobuf-c-compiler +# - Android SDK installed +# - Environment variable $ANDROID_HOME points to Android SDK install location +# - Android NDK and CMake components installed via +# sdkmanager ndk-bundle "cmake;3.6.4111459" +# (later CMake versions from the SDK repository may also work) +# +# If any of the build steps fails, this script aborts with an error immediately. + +echo Set up environment +set - e +export PATH=$PATH:$ANDROID_HOME/tools +export JVM_OPTS="-Xmx3200m" +export GRADLE_OPTS='-Dorg.gradle.jvmargs="-Xmx2048m -XX:+HeapDumpOnOutOfMemoryError"' + +echo Run CMake +cmake ./ -Dvehicle/gpsd_dbus:BOOL=FALSE -Dsvg2png_scaling:STRING=-1,24,32,48,64,96,128,192,256 -Dsvg2png_scaling_nav:STRING=-1,24,32,48,64,96,128,192,256 -Dsvg2png_scaling_flag:STRING=-1,24,32,64,96 -DUSE_PLUGINS=n -DBUILD_MAPTOOL=n -DXSL_PROCESSING=y -DXSLTS=android -DANDROID=y -DSAMPLE_MAP=n || exit 1 + +echo Process icons +cd navit/icons +make || exit 32 +mkdir ../android/res/drawable-nodpi +rename 'y/A-Z/a-z/' ./*.png +cp ./*.png ../android/res/drawable-nodpi +cd ../../ + +echo Process translations +cd po +make || exit 64 +mkdir ../navit/android/res/raw +rename 'y/A-Z/a-z/' ./*.mo +cp ./*.mo ../navit/android/res/raw +cd ../ + +echo Process xml config files +make navit_config_xml || exit 96 +cd navit +mkdir -p ./android/assets +cp -R config ./android/assets/ +cd ../ + +echo Chmod permissions +chmod a+x ./gradlew + +echo Download dependencies +./gradlew -v + +echo Build +./gradlew assembleDebug || exit 128 + +echo Build finished. +echo APK should be in "navit/android/build/outputs/apk" and can be installed with +echo ./gradlew installDebug + -- cgit v1.2.1 From a42bba56790c3e9b4e70ef08f5d56d95732d237a Mon Sep 17 00:00:00 2001 From: mvglasow Date: Tue, 8 Jan 2019 20:47:52 +0100 Subject: Add:scripts:Make linux build script more verbose Signed-off-by: mvglasow --- scripts/build_linux.sh | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'scripts') diff --git a/scripts/build_linux.sh b/scripts/build_linux.sh index 90ba8a9a0..af3ad317c 100644 --- a/scripts/build_linux.sh +++ b/scripts/build_linux.sh @@ -11,14 +11,18 @@ pushd $BUILD_PATH if [[ "${CIRCLE_PROJECT_USERNAME}" == "navit-gps" && "${CIRCLE_BRANCH}" == "trunk" ]]; then # If we are building the official trunk code, push an update to coverity + echo "Pushing an update to coverity as we are building the official trunk code." + echo "Downloading coverity..." curl \ -X POST --data "token=${COVERITY_TOKEN}&project=${CIRCLE_PROJECT_USERNAME}" \ -o /tmp/cov-analysis-linux64-${COVERITY_VERSION}.tar.gz -s \ https://scan.coverity.com/download/linux64 + echo "Unpacking coverity..." tar xfz /tmp/cov-analysis-linux64-${COVERITY_VERSION}.tar.gz --no-same-owner -C /usr/local/share/ export PATH=/usr/local/share/cov-analysis-linux64-${COVERITY_VERSION}/bin:$PATH + echo "Building with coverity..." cmake ${cmake_opts} ../ cov-build --dir cov-int make -j $(nproc --all) tar czvf navit.tgz cov-int @@ -33,16 +37,19 @@ if [[ "${CIRCLE_PROJECT_USERNAME}" == "navit-gps" && "${CIRCLE_BRANCH}" == "trun make package # Then update the translation template on launchpad + echo "Updating the translation template on launchpad..." sed -i '/INTEGER/d' po/navit.pot cp po/navit.pot $CIRCLE_ARTIFACTS/ curl "https://translations.launchpad.net/navit/${CIRCLE_BRANCH}/+translations-upload" -H "$lp_cookie" -H "Referer: https://translations.launchpad.net/navit/${CIRCLE_BRANCH}/+translations-upload" -F file=@po/navit.pot | grep title else + echo "Not on the official trunk branch, building without coverity..." cmake ${cmake_opts} ../ make -j $(nproc --all) make package fi if [[ "$CIRCLE_ARTIFACTS" != "" ]]; then + echo "Copying icons to artifacts..." cp -r navit/icons $CIRCLE_ARTIFACTS fi -- cgit v1.2.1