build: Add Android to travis config

This commit is contained in:
Cody Northrop
2017-04-24 09:28:10 -06:00
committed by baldurk
parent 5863607ba2
commit 937f37e387
3 changed files with 53 additions and 8 deletions
+15 -8
View File
@@ -17,29 +17,36 @@ matrix:
- os: linux
dist: trusty
sudo: false
env: CODE_BUILD=0 LINUX_BUILD=0 APPLE_BUILD=0 DOCS_BUILD=1
env: CODE_BUILD=0 LINUX_BUILD=0 APPLE_BUILD=0 DOCS_BUILD=1 ANDROID_BUILD=0
- os: linux
dist: trusty
sudo: required
env: CODE_BUILD=1 LINUX_BUILD=1 APPLE_BUILD=0 DOCS_BUILD=0
env: CODE_BUILD=1 LINUX_BUILD=1 APPLE_BUILD=0 DOCS_BUILD=0 ANDROID_BUILD=0
compiler: gcc
- os: linux
dist: trusty
sudo: required
env: CODE_BUILD=1 LINUX_BUILD=1 APPLE_BUILD=0 DOCS_BUILD=0
env: CODE_BUILD=1 LINUX_BUILD=1 APPLE_BUILD=0 DOCS_BUILD=0 ANDROID_BUILD=0
compiler: clang
- os: linux
dist: trusty
sudo: required
env: CODE_BUILD=1 LINUX_BUILD=0 APPLE_BUILD=0 DOCS_BUILD=0 ANDROID_BUILD=1
compiler: clang
- os: osx
osx_image: xcode8.2
env: CODE_BUILD=1 LINUX_BUILD=0 APPLE_BUILD=1 DOCS_BUILD=0
env: CODE_BUILD=1 LINUX_BUILD=0 APPLE_BUILD=1 DOCS_BUILD=0 ANDROID_BUILD=0
compiler: clang
# install dependencies
install:
- if [[ "$DOCS_BUILD" == "1" ]]; then . ./scripts/travis/docs_setup.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CODE_BUILD" == "1" ]]; then . ./scripts/travis/linux_setup.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CODE_BUILD" == "1" ]]; then . ./scripts/travis/osx_setup.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CODE_BUILD" == "1" ]] && [[ "$LINUX_BUILD" == 1 ]]; then . ./scripts/travis/linux_setup.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CODE_BUILD" == "1" ]] && [[ "$ANDROID_BUILD" == 1 ]]; then . ./scripts/travis/android_setup.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CODE_BUILD" == "1" ]] && [[ "$APPLE_BUILD" == 1 ]]; then . ./scripts/travis/osx_setup.sh ; fi
script:
- if [[ "$DOCS_BUILD" == "1" ]]; then . ./scripts/travis/docs_compile.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CODE_BUILD" == "1" ]]; then . ./scripts/travis/linux_compile.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CODE_BUILD" == "1" ]]; then . ./scripts/travis/osx_compile.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CODE_BUILD" == "1" ]] && [[ "$LINUX_BUILD" == 1 ]]; then . ./scripts/travis/linux_compile.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "linux" ]] && [[ "$CODE_BUILD" == "1" ]] && [[ "$ANDROID_BUILD" == 1 ]]; then . ./scripts/travis/android_compile.sh ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]] && [[ "$CODE_BUILD" == "1" ]] && [[ "$APPLE_BUILD" == 1 ]]; then . ./scripts/travis/osx_compile.sh ; fi
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
CORES=$(nproc) || echo 4
mkdir -p build-android && cd build-android
cmake -DBUILD_ANDROID=On -DANDROID_ABI=armeabi-v7a -DANDROID_NATIVE_API_LEVEL=23 ..
make -j $CORES
+32
View File
@@ -0,0 +1,32 @@
#!/bin/sh
set -ev
sudo apt-get -qq update
sudo apt-get install -y cmake
export ARCH=`uname -m`
# Pull known working tools toward the end of 2016
wget http://dl.google.com/android/repository/android-ndk-r13b-linux-${ARCH}.zip
wget https://dl.google.com/android/repository/tools_r25.2.5-linux.zip
wget https://dl.google.com/android/repository/platform-tools_r25.0.3-linux.zip
wget https://dl.google.com/android/repository/build-tools_r25.0.2-linux.zip
unzip -u -q android-ndk-r13b-linux-${ARCH}.zip
unzip -u -q tools_r25.2.5-linux.zip
unzip -u -q platform-tools_r25.0.3-linux.zip
unzip -u -q build-tools_r25.0.2-linux.zip
# Munge the build-tools layout
mkdir -p build-tools/25.0.2
mv android-7.1.1/* build-tools/25.0.2/
export ANDROID_HOME=`pwd`/tools
export JAVA_HOME="/usr/lib/jvm/java-8-oracle"
export ANDROID_NDK=`pwd`/android-ndk-r13b
export PATH=`pwd`/android-ndk-r13b:$PATH
export PATH=`pwd`/tools:$PATH
export PATH=`pwd`/platform-tools:$PATH
export PATH=`pwd`/build-tools/25.0.2:$PATH
# Answer "yes" to any license acceptance requests
(while sleep 3; do echo "y"; done) | android update sdk --no-ui -s -t android-23