[android] added the ability to build only single architecture from command line.

This commit is contained in:
rachytski 2012-10-27 18:26:40 +03:00 committed by Alex Zolotarev
parent 67801f0fb8
commit ee663d56da
4 changed files with 58 additions and 19 deletions

View file

@ -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">

View file

@ -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>

View file

@ -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

View file

@ -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..."