1# Copyright The Amber Authors. 2# 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14 15set -e # Fail on error 16set -x # Display commands as run 17 18BUILD_ROOT=$PWD 19SRC=$PWD/github/amber 20BUILD_TYPE=Release 21 22export ANDROID_NDK=/opt/android-ndk-r15c 23ANDROID_STL=c++_static 24ANDROID_PLATFORM="android-14" 25ANDROID_ABI="armeabi-v7a with NEON" 26 27TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake 28 29# removing the old version 30echo y | sudo apt-get purge --auto-remove cmake 31 32# Installing the 3.10.2 version 33wget http://www.cmake.org/files/v3.10/cmake-3.10.2.tar.gz 34tar -xvzf cmake-3.10.2.tar.gz 35cd cmake-3.10.2/ 36./configure 37make 38sudo make install 39echo $(date): $(cmake --version) 40 41# Get NINJA. 42wget -q https://github.com/ninja-build/ninja/releases/download/v1.8.2/ninja-linux.zip 43unzip -q ninja-linux.zip 44export PATH="$PWD:$PATH" 45 46cd $SRC 47./tools/git-sync-deps 48 49mkdir build && cd $SRC/build 50 51# Invoke the build. 52BUILD_SHA=${KOKORO_GITHUB_COMMIT:-$KOKORO_GITHUB_PULL_REQUEST_COMMIT} 53echo $(date): Starting build... 54cmake -GNinja \ 55 -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ 56 -DANDROID_ABI=$ANDROID_ABI \ 57 -DANDROID_PLATFORM=$ANDROID_PLATFORM \ 58 -DANDROID_NDK=$ANDROID_NDK \ 59 -DANDROID_STL=$ANDROID_STL \ 60 -DCMAKE_TOOLCHAIN_FILE=$TOOLCHAIN_PATH \ 61 .. 62 63echo $(date): Build everything... 64ninja 65echo $(date): Build completed. 66