Split up Android builds by architecture
authorTrevor Bramwell <tbramwell@linuxfoundation.org>
Wed, 19 Aug 2015 15:30:03 +0000 (08:30 -0700)
committerJon A. Cruz <jonc@osg.samsung.com>
Sat, 22 Aug 2015 04:04:02 +0000 (04:04 +0000)
With the additional option of building Android for the x86_64
architecture builds can reach upwards of 3 hours. This change sets the
groundwork for adding the x86_64 arch as a build target by splitting up
the android build by architecture.

Change-Id: I8d6837c3187e871543c0841638d1cc50600f75a9
Signed-off-by: Trevor Bramwell <tbramwell@linuxfoundation.org>
Reviewed-on: https://gerrit.iotivity.org/gerrit/2245
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Jon A. Cruz <jonc@osg.samsung.com>
auto_build.sh

index 806bf6a..99f2c3e 100755 (executable)
@@ -63,22 +63,27 @@ function build_android()
        # Note: for android, as oic-resource uses C++11 feature stoi and to_string,
        # it requires gcc-4.9, currently only android-ndk-r10(for linux)
        # and windows android-ndk-r10(64bit target version) support these features.
-       echo "*********** Build Boost for android ***********"
-       # disable parallel build for android as gradle depends on scons to finish first
-       export SCONSFLAGS="-Q"
 
+    # Parallel builds for android are disabled as gradle depends on
+    # scons to finish first
+    SCONSFLAGS="-Q" build_android_x86 $1 $2
+    SCONSFLAGS="-Q" build_android_armeabi $1 $2
+}
+
+function build_android_x86()
+{
        echo "*********** Build for android x86 *************"
        scons TARGET_OS=android TARGET_ARCH=x86 RELEASE=$1 TARGET_TRANSPORT=IP $2
        scons TARGET_OS=android TARGET_ARCH=x86 RELEASE=$1 TARGET_TRANSPORT=BT $2
        scons TARGET_OS=android TARGET_ARCH=x86 RELEASE=$1 TARGET_TRANSPORT=BLE $2
+}
 
+function build_android_armeabi()
+{
        echo "*********** Build for android armeabi *************"
        scons TARGET_OS=android TARGET_ARCH=armeabi RELEASE=$1 TARGET_TRANSPORT=IP $2
        scons TARGET_OS=android TARGET_ARCH=armeabi RELEASE=$1 TARGET_TRANSPORT=BT $2
        scons TARGET_OS=android TARGET_ARCH=armeabi RELEASE=$1 TARGET_TRANSPORT=BLE $2
-
-       # enable parallel build
-       export SCONSFLAGS="-Q -j 4"
 }
 
 function build_arduino()
@@ -186,6 +191,14 @@ then
        then
                build_android true
                build_android false
+       elif [ $1 = 'android_x86' ]
+       then
+        build_android_x86 true
+        build_android_x86 false
+       elif [ $1 = 'android_armeabi' ]
+       then
+        build_android_armeabi true
+        build_android_armeabi false
        elif [ $1 = 'arduino' ]
        then
                build_arduino true