[build] Refactor and simplify build system

* Main gyp files are now standardized as platform/<platform>/platform.gyp.
* Each platform gyp file defines appropriate loop_lib and headless_lib variables.
* Each platform gyp file includes mbgl.gypi, which defines base targets which may be useful to all platforms.
* CI targets are consistent across platforms: `make $(PLATFORM) && make test-$(PLATFORM)`.
* Renamed the "linux" test app to "glfw". It's now built in OS X CI.
* Android build flakiness is fixed.
* iOS CI builds the bench and iosapp targets.
* Mesa version is now in one place.
* CI scripts use bash "strict mode" and correct error handling.
* All build output goes to the build directory.
* Removed vestigial iOS/OS X/Android Travis scripts.
This commit is contained in:
John Firebaugh
2016-04-03 15:16:49 -07:00
parent f5d66f3622
commit f964e40e7e
94 changed files with 1689 additions and 3099 deletions

View File

@@ -3,13 +3,9 @@
set -e
set -o pipefail
JOB=$1
if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
# Install and add awscli to PATH for uploading the results
pip install --user awscli
export PATH="`python -m site --user-base`/bin:${PATH}"
REPO_NAME=$(basename $TRAVIS_REPO_SLUG)
aws s3 cp --recursive --acl public-read --exclude "*" --include "*/actual.png" test/fixtures \
s3://mapbox/$REPO_NAME/render-tests/$TRAVIS_JOB_NUMBER
s3://mapbox/mapbox-gl-native/render-tests/$JOB
fi

View File

@@ -3,11 +3,22 @@
set -e
set -o pipefail
source ./platform/linux/scripts/setup.sh
mapbox_time "install_lcov" \
mason install lcov 1.12
################################################################################
# Coveralls
################################################################################
# Collect coverage data and save it into coverage.info
mapbox_time "lcov_capture" \
`mason prefix lcov 1.12`/usr/bin/lcov \
--quiet \
--capture \
--no-external \
--gcov-tool "gcov-4.9" \
--directory "src/mbgl" \
--directory "platform" \
--directory "include/mbgl" \
--directory "build/linux-x86_64/${BUILDTYPE}" \
--base-directory "build/linux-x86_64/${BUILDTYPE}" \
--output-file "build/linux-x86_64/${BUILDTYPE}/coverage.info"
mapbox_time "make_coveralls" \
make coveralls -j${JOBS}
mapbox_time "coveralls_upload" \
coveralls-lcov "build/linux-x86_64/${BUILDTYPE}/coverage.info"

View File

@@ -1,5 +0,0 @@
HEADLESS ?= glx
PLATFORM ?= linux
ASSET ?= fs
HTTP ?= curl
LOOP ?= uv

View File

@@ -1,11 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
mapbox_time "checkout_mason" \
git submodule update --init .mason
PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" \
mapbox_time "install_mesa" \
mason install mesa 10.4.3

View File

@@ -1,31 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
source ./platform/linux/scripts/setup.sh
BUILDTYPE=${BUILDTYPE:-Release}
################################################################################
# Build
################################################################################
mapbox_time "compile_program" \
make linux -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_render_binary" \
make render -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_offline_binary" \
make offline -j${JOBS} BUILDTYPE=${BUILDTYPE}
mapbox_time "compile_tests" \
make test -j${JOBS} BUILDTYPE=${BUILDTYPE}
################################################################################
# Test
################################################################################
mapbox_time "run_tests" \
make test-* BUILDTYPE=${BUILDTYPE}

View File

@@ -1,28 +0,0 @@
#!/usr/bin/env bash
# This script is sourced; do not set -e or -o pipefail here.
# Ensure mason is on the PATH
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
# Set the core file limit to unlimited so a core file is generated upon crash
ulimit -c unlimited -S
################################################################################
# X Server setup
################################################################################
# Start the mock X server
if [ -f /etc/init.d/xvfb ] ; then
mapbox_time "start_xvfb" \
sh -e /etc/init.d/xvfb start
sleep 2 # sometimes, xvfb takes some time to start up
fi
# Make sure we're connecting to xvfb
export DISPLAY=:99.0
# Make sure we're loading the 10.4.3 libs we installed manually
export LD_LIBRARY_PATH="`mason prefix mesa 10.4.3`/lib:${LD_LIBRARY_PATH:-}"
mapbox_time "glxinfo" \
glxinfo

View File

@@ -1,17 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
# Ensure mason is on the PATH
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
BUILDTYPE=${BUILDTYPE:-Release}
export CLANG_TIDY=clang-tidy-3.8
mapbox_time "config" \
make config
mapbox_time "tidy" \
make tidy