[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,50 +3,20 @@
set -e
set -o pipefail
# Inspect binary.
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
ldd ./lib/mapbox-gl-native.node
else
otool -L ./lib/mapbox-gl-native.node
JOB=$1
TAG=$2
if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
gzip --stdout node_modules/mapbox-gl-test-suite/render-tests/index.html | \
aws s3 cp --acl public-read --content-encoding gzip --content-type text/html \
- s3://mapbox/mapbox-gl-native/render-tests/$JOB/index.html
echo http://mapbox.s3.amazonaws.com/mapbox-gl-native/render-tests/$JOB/index.html
fi
PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)")
if [[ ${TRAVIS_TAG} == node-v${PACKAGE_JSON_VERSION} ]]; then
source ~/.nvm/nvm.sh
nvm use $NODE_VERSION
npm install aws-sdk
if [[ $TAG == node-v${PACKAGE_JSON_VERSION} ]]; then
./node_modules/.bin/node-pre-gyp package
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
./node_modules/.bin/node-pre-gyp testpackage
fi
./node_modules/.bin/node-pre-gyp publish info
if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then
source ./platform/linux/scripts/setup.sh
rm -rf build
rm -rf lib
npm install --fallback-to-build=false
npm test
fi
fi
if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then
if [[ ${TRAVIS_OS_NAME} == "linux" ]] ; then
pip install --user awscli
export PATH="`python -m site --user-base`/bin:${PATH}"
else
brew install awscli
fi
gzip --stdout node_modules/mapbox-gl-test-suite/render-tests/index.html | \
aws s3 cp --acl public-read --content-encoding gzip --content-type text/html \
- s3://mapbox/mapbox-gl-native/render-tests/$TRAVIS_JOB_NUMBER/index.html
echo http://mapbox.s3.amazonaws.com/mapbox-gl-native/render-tests/$TRAVIS_JOB_NUMBER/index.html
fi

View File

@@ -1,24 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
git submodule update --init .mason
export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason"
if [ ${TRAVIS_OS_NAME} == "linux" ]; then
mason install mesa 10.4.3
fi
if [ ! -d ~/.nvm ]; then
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.28.0/install.sh | bash
fi
source ~/.nvm/nvm.sh
nvm install $NODE_VERSION
nvm alias default $NODE_VERSION
node --version
npm --version

View File

@@ -1,15 +0,0 @@
#!/usr/bin/env bash
set -e
set -o pipefail
source ./platform/${TRAVIS_OS_NAME}/scripts/setup.sh
BUILDTYPE=${BUILDTYPE:-Release}
source ~/.nvm/nvm.sh
nvm use $NODE_VERSION
npm install --build-from-source
npm test
npm run test-suite