diff options
author | rachytski <siarhei.rachytski@gmail.com> | 2012-10-27 19:26:40 +0400 |
---|---|---|
committer | Alex Zolotarev <alex@maps.me> | 2015-09-23 01:46:20 +0300 |
commit | ee663d56da8468b7ae5aff50c0e6e606be65d254 (patch) | |
tree | 029beb18bac56a617183d4987fa92fa7bcc61cad | |
parent | 67801f0fb8f25656f0960cefab1ad485a710cbf1 (diff) |
[android] added the ability to build only single architecture from command line.
-rw-r--r-- | android/common_custom_rules.xml | 21 | ||||
-rw-r--r-- | android/custom_rules.xml | 39 | ||||
-rw-r--r-- | android/jni/Application.mk | 8 | ||||
-rw-r--r-- | tools/autobuild/android.sh | 9 |
4 files changed, 58 insertions, 19 deletions
diff --git a/android/common_custom_rules.xml b/android/common_custom_rules.xml index 0f62fbc8c0..91843053ac 100644 --- a/android/common_custom_rules.xml +++ b/android/common_custom_rules.xml @@ -1,6 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <project name="MapsWithMe" default="help"> + <property name="arch" value="multiarch" /> + <property name="mwm.arch.name" value="${arch}"/> + <target name="-exclude-text-drules"> <exec executable="rm"> <arg value="${asset.absolute.dir}/drules_proto.txt"/> @@ -22,21 +25,21 @@ </target> <target name="-setup-production"> - <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-production.apk"/> - <property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-production-unsigned.apk" /> - <property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-production-unaligned.apk" /> + <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-production.apk"/> + <property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-production-unsigned.apk" /> + <property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-production-unaligned.apk" /> </target> <target name="-setup-release"> - <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-release.apk" /> - <property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-release-unsigned.apk" /> - <property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-release-unaligned.apk" /> + <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-release.apk" /> + <property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-release-unsigned.apk" /> + <property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-release-unaligned.apk" /> </target> <target name="-setup-debug"> - <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-debug.apk" /> - <property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-debug-unsigned.apk" /> - <property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-debug-unaligned.apk" /> + <property name="out.final.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-debug.apk" /> + <property name="out.packaged.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-debug-unsigned.apk" /> + <property name="out.unaligned.file" location="${out.absolute.dir}/${ant.project.name}${mwm.market.name}-${mwm.arch.name}-debug-unaligned.apk" /> </target> <target name="-setup-amazon-market"> diff --git a/android/custom_rules.xml b/android/custom_rules.xml index b37de27d6c..b25868950f 100644 --- a/android/custom_rules.xml +++ b/android/custom_rules.xml @@ -1,6 +1,30 @@ <?xml version="1.0" encoding="UTF-8"?> <project name="MapsWithMe" default="help"> + <property name="arch" value="multiarch" /> + + <condition property="build.type.multi"> + <equals arg1="${arch}" arg2="multiarch"/> + </condition> + + <target name="-setup-architectures"> + + <if condition="${build.type.multi}"> + <then> + <property name="mwm.ndk.abi" value="armeabi armeabi-v7a mips x86"/> + </then> + <else> + <property name="mwm.ndk.abi" value="${arch}"/> + </else> + </if> + + <echo> ************************************************ </echo> + <echo> ***** BUILDING THE FOLLOWING ARCHITECTURES ***** </echo> + <echo> ***** ${mwm.ndk.abi} </echo> + <echo> ************************************************ </echo> + + </target> + <property name="jni.absolute.dir" location="jni" /> <target name="clean" depends="android_rules.clean"> @@ -9,8 +33,9 @@ </exec> </target> - <target name="-ndk-production"> + <target name="-ndk-production" depends="-setup-architectures"> <exec executable="bash" failonerror="true"> + <env key="NDK_ABI_TO_BUILD" value="${mwm.ndk.abi}"/> <arg value="${mwm.tools.dir}/autobuild/android.sh"/> <arg value="production"/> </exec> @@ -85,7 +110,7 @@ <record-build-info /> </target> - <target name="-ndk-release"> + <target name="-ndk-release" depends="-setup-architectures"> <exec executable="bash" failonerror="true"> <arg value="${mwm.tools.dir}/autobuild/android.sh"/> <arg value="release"/> @@ -102,17 +127,17 @@ <target name="release" depends="-ndk-release, android_rules.release"> </target> - <target name="-ndk-debug"> + <target name="-ndk-debug" depends="-setup-architectures"> <exec executable="bash" failonerror="true"> - <arg value="${mwm.tools.dir}/autobuild/android.sh"/> - <arg value="debug"/> + <arg value="${mwm.tools.dir}/autobuild/android.sh"/> + <arg value="debug"/> </exec> <exec executable="touch"> <arg value="${jni.absolute.dir}/com/mapswithme/core/jni_helper.cpp"/> </exec> <exec executable="${ndk.dir}/ndk-build" failonerror="true"> - <arg value="NDK_DEBUG=1"/> - <arg value="V=1"/> + <arg value="NDK_DEBUG=1"/> + <arg value="V=1"/> </exec> </target> diff --git a/android/jni/Application.mk b/android/jni/Application.mk index bdaf09065b..53cf81800b 100644 --- a/android/jni/Application.mk +++ b/android/jni/Application.mk @@ -1,5 +1,11 @@ APP_PLATFORM := android-5 -APP_ABI := armeabi armeabi-v7a mips x86 + +ifeq (x$(NDK_ABI_TO_BUILD), x) + APP_ABI := armeabi armeabi-v7a mips x86 +else + APP_ABI := $(NDK_ABI_TO_BUILD) +endif + APP_STL := gnustl_static LOCAL_PATH := $(call my-dir) APP_CFLAGS += -I$(LOCAL_PATH)/../../3party/boost diff --git a/tools/autobuild/android.sh b/tools/autobuild/android.sh index 5bb8587abb..a05e7af647 100644 --- a/tools/autobuild/android.sh +++ b/tools/autobuild/android.sh @@ -22,9 +22,14 @@ SHADOW_DIR_BASE="$LOCAL_DIRNAME/../../../omim-android" export NDK_ROOT=$(GetNdkRoot) || ( echo "Can't read NDK root path from android/local.properties"; exit 1 ) export NDK_HOST=$(GetNdkHost) || ( echo "Can't get your OS type, please check tools/autobuild/ndk_helper.sh script"; exit 1 ) -NDK_ABI_TO_BUILD=(armeabi armeabi-v7a mips x86) +NDK_ABI_LIST=(armeabi armeabi-v7a mips x86) -for abi in "${NDK_ABI_TO_BUILD[@]}"; do +if test "${NDK_ABI_TO_BUILD+set}" == set +then + NDK_ABI_LIST=($NDK_ABI_TO_BUILD); +fi + +for abi in "${NDK_ABI_LIST[@]}"; do SHADOW_DIR="${SHADOW_DIR_BASE}-${CONFIGURATION}-${abi}" if [[ $# > 1 && "$2" == "clean" ]] ; then echo "Cleaning $CONFIGURATION-$abi configuration..." |