diff --git a/.travis.yml b/.travis.yml index ac815a939..701b28c4c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -57,11 +57,7 @@ matrix: os: linux compiler: gcc - env: BUILD_TARGET="android-build" VERBOSE=1 - language: android - android: - components: - - tools - - platform-tools + os: linux - env: BUILD_TARGET="posix-distcheck" CC=clang-5.0 CXX=clang++-5.0 VERBOSE=1 VIRTUAL_TIME=1 os: linux addons: diff --git a/.travis/before_install.sh b/.travis/before_install.sh index ce38d4d35..cdf3b8ce0 100755 --- a/.travis/before_install.sh +++ b/.travis/before_install.sh @@ -50,7 +50,12 @@ cd /tmp || die [ $BUILD_TARGET != android-build ] || { sudo apt-get install -y bison gcc-multilib g++-multilib - echo y | sdkmanager "ndk-bundle" + ( + cd $HOME + wget https://dl.google.com/android/repository/android-ndk-r17c-linux-x86_64.zip + unzip android-ndk-r17c-linux-x86_64.zip > /dev/null + mv android-ndk-r17c ndk-bundle + ) || die } [ $BUILD_TARGET != pretty-check ] || { diff --git a/.travis/check-android-build b/.travis/check-android-build new file mode 100755 index 000000000..85f0ab6fc --- /dev/null +++ b/.travis/check-android-build @@ -0,0 +1,107 @@ +#!/bin/sh +# +# Copyright (c) 2018, The OpenThread Authors. +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the copyright holder nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +# LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +# +# Run this command on parent directory of openthread +# + +set -e +set -x + +####################################### +# Prepare android build system +# Globals: +# None +# Arguments: +# None +# Returns: +# None +####################################### +android_prepare_build_system() +{ + # Android build system + (mkdir build && cd build && git init && git pull --depth 1 https://android.googlesource.com/platform/build 2db32730e79cafcf13e1f898a7bee7f82b0449d6) + ln -s build/core/main.mk Makefile + + # Workarounds for java checking + export ANDROID_JAVA_HOME=/usr/lib/jvm/java-8-oracle + mkdir bin + cat > bin/java < bin/javac < buildspec.mk < bin/java < bin/javac < buildspec.mk <