diff options
43 files changed, 415 insertions, 469 deletions
diff --git a/.mason b/.mason -Subproject 03869fd11e4bc619d3ba7e4f8a1f00d4612c90e +Subproject c43967404c84d020d63f6aba450d97770dfeaeb diff --git a/.travis.yml b/.travis.yml index 71936b8726..82190742ee 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,100 +1,106 @@ -language: cpp +language: android + +sudo: false + +addons: + apt: + sources: + - boost-latest + - ubuntu-toolchain-r-test + packages: + - gdb # for printing stack traces from core dumps + - gcc-4.8 + - g++-4.8 + - llvm-3.4 + - xutils-dev + - libxxf86vm-dev + - x11proto-xf86vidmode-dev + - mesa-utils # for glxinfo + - libboost-dev + - libboost-program-options-dev + - lib32stdc++6 # for Gradle's aapt + - lib32z1 # for Gradle's aapt matrix: exclude: - os: linux include: - os: linux - env: CONFIG=release MASON_PLATFORM=android MASON_ANDROID_ABI=arm-v7 TESTMUNK=yes - compiler: clang - - os: linux - env: CONFIG=debug MASON_PLATFORM=android MASON_ANDROID_ABI=arm-v7 TESTMUNK=no - compiler: clang + env: FLAVOR=linux CXX=g++-4.8 BUILDTYPE=Release - os: linux - env: CONFIG=release MASON_PLATFORM=android MASON_ANDROID_ABI=arm-v5 TESTMUNK=no - compiler: clang + env: FLAVOR=linux CXX=clang++ BUILDTYPE=Debug - os: linux - env: CONFIG=release MASON_PLATFORM=android MASON_ANDROID_ABI=arm-v8 TESTMUNK=no - compiler: clang - - os: linux - env: CONFIG=release MASON_PLATFORM=android MASON_ANDROID_ABI=x86 TESTMUNK=no - compiler: clang + env: FLAVOR=linux CXX=clang++ BUILDTYPE=Release + - os: osx + env: FLAVOR=osx BUILDTYPE=Debug + - os: osx + env: FLAVOR=ios BUILDTYPE=Release - os: linux - env: CONFIG=release MASON_PLATFORM=android MASON_ANDROID_ABI=mips TESTMUNK=no - compiler: clang + env: FLAVOR=android ANDROID_ABI=arm-v7 BUILDTYPE=Release + android: + components: + - build-tools-22.0.0 + - android-22 + - extra - os: linux - env: CONFIG=release MASON_PLATFORM=android MASON_ANDROID_ABI=mips-64 TESTMUNK=no - compiler: clang + env: FLAVOR=android ANDROID_ABI=arm-v7 BUILDTYPE=Debug + android: + components: + - build-tools-22.0.0 + - android-22 + - extra - os: linux - env: BUILDTYPE=Release JOBS=16 - compiler: clang + env: FLAVOR=android ANDROID_ABI=arm-v8 BUILDTYPE=Release + android: + components: + - build-tools-22.0.0 + - android-22 + - extra - os: linux - env: BUILDTYPE=Debug JOBS=16 - compiler: clang + env: FLAVOR=android ANDROID_ABI=x86 BUILDTYPE=Release + android: + components: + - build-tools-22.0.0 + - android-22 + - extra - os: linux - env: BUILDTYPE=Release JOBS=8 - compiler: gcc - - os: osx - env: BUILDTYPE=Debug JOBS=8 MASON_PLATFORM=osx - compiler: clang - - os: osx - env: BUILDTYPE=Release JOBS=8 MASON_PLATFORM=ios - compiler: clang + env: FLAVOR=android ANDROID_ABI=mips BUILDTYPE=Release + android: + components: + - build-tools-22.0.0 + - android-22 + - extra env: global: - - secure: "MZHblLZXG/jWf2w0ZFlxCLDwx2qtGgRDODQyg1BR7JIuMz6AtWv8XR/sUczWLbiABCL0a/NzJF1g4v2pI7X69IntcjOdIABBgTh7++6+1TJ0Kp8viEltb55nQG3lHy/R6fOaI7Pj9tuCX0PCRtGA5C/fGnodLGEjy3RVOJ09ln0=" - - secure: "KaSQbhgjtV7ZCkesHmvrNsbQVjk5SPfGKB1VkWenRGYhLF45HpSRNwSxMQddZ566Pg7qIFgF1iWl/B0QW3B6AWL5WmzQ5AOJgwS876pNIc/UT7ubMPtgAtjpvw1bQvQP3B8MrB+3OE5c6tD+a3LhR9krV//dOsfErR5Yy+3Mbkc=" - - ANDROID_BUILD_INSTANCE_PROFILE: arn:aws:iam::234858372212:instance-profile/android-gl-build/travis/instance-profile/travis-mapbox-gl-native-AndroidInstanceProfile-13EA815DD8IQ9 - - secure: "RiBIBfVhhaMjU5ksuwJO3shdvG9FpinBjdSv4co9jg9171SR8edNriedHjVKSIeBhSGNmZmX+twS3dJS/By6tl/LKh9sTynA+ZAYYljkE7jn881B/gMrlYvdAA6og5KvkhV1/0iJWlhuZrMTkhpDR200iLgg3EWBhWjltzmDW/I=" - - secure: "CHBiUM60TolDbQnn+4IRA/tvOKwKs3g9EDvv8YHSJMg3FuHmjKQkprBasvxf3hnTXg4WLZEubmeDcyJ6RRzPP5mMSr/hksYl0pSjj/6TUecE5fHPVVeN7txVqkpOBf9i45Y+iBUQMjBb1NnDK3pHXxpnAs1Q/pe7vReErj4GF1U=" - - LD_LIBRARY_PATH: '/usr/local/lib' - - TERM: dumb - # begin iOS code signing - - secure: "I6Iu75X1E+js5tzijtKi1EGtIuBcA4/25nDYe0svV4HAtujY71ZJZ4eB6355CKhFXpLXrF3i7eKVX3v+zWS0QROPEWacgsqsvNg+Ba9cnznW/faUSOYekCfhzWd/6reYDM7KzKAQwSUHLk9JIWK/kkmi4r+vVJK7h+tjPllK5YA=" - - IOS_APP_NAME="Mapbox GL" - - 'IOS_DEVELOPER_NAME="iPhone Distribution: Mapbox, Inc."' - - IOS_PROFILE_NAME="ios-in-house" - - secure: "nQqSM8rd7OHtV4MqmNqVnkrVHqxKqQsaWRYk4/nPdhbeVWtTtkk0df711LrF1TUtbEPEewHxYUvTZ/UXmwJNeoKdzTHavI8hnatRkgjyxGERPn1il1Otelht9I+LQQHf+plrpRjVWBrNIW0Zox1B3cqn6d3NglpbXrEQ2EjYGNA=" - # end iOS code signing - - KIF_SCREENSHOTS="${TRAVIS_BUILD_DIR}/screenshots" - -before_install: -- if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then sudo service mysql stop; fi -- if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then sudo service postgresql stop; fi -- source ./scripts/local_mason.sh -- source ./scripts/travis_helper.sh -- source ./scripts/install_node.sh -- source ./scripts/flags.sh -- ./scripts/travis_before_install.sh -- if [[ ${TRAVIS_OS_NAME} == "linux" && ${MASON_PLATFORM} != "android" ]]; then export LD_LIBRARY_PATH=`mason prefix mesa 10.4.3`/lib; fi -- if [[ ${TRAVIS_OS_NAME} == "linux" && ${MASON_PLATFORM} != "android" ]]; then glxinfo; fi -- if [[ ${TRAVIS_OS_NAME} == "osx" && ${TEST_OS} == "ios" ]]; then mkdir -p ${KIF_SCREENSHOTS}; fi + - TERM: dumb + # AWS + - secure: "MZHblLZXG/jWf2w0ZFlxCLDwx2qtGgRDODQyg1BR7JIuMz6AtWv8XR/sUczWLbiABCL0a/NzJF1g4v2pI7X69IntcjOdIABBgTh7++6+1TJ0Kp8viEltb55nQG3lHy/R6fOaI7Pj9tuCX0PCRtGA5C/fGnodLGEjy3RVOJ09ln0=" + - secure: "KaSQbhgjtV7ZCkesHmvrNsbQVjk5SPfGKB1VkWenRGYhLF45HpSRNwSxMQddZ566Pg7qIFgF1iWl/B0QW3B6AWL5WmzQ5AOJgwS876pNIc/UT7ubMPtgAtjpvw1bQvQP3B8MrB+3OE5c6tD+a3LhR9krV//dOsfErR5Yy+3Mbkc=" + # Access Token + - secure: "RiBIBfVhhaMjU5ksuwJO3shdvG9FpinBjdSv4co9jg9171SR8edNriedHjVKSIeBhSGNmZmX+twS3dJS/By6tl/LKh9sTynA+ZAYYljkE7jn881B/gMrlYvdAA6og5KvkhV1/0iJWlhuZrMTkhpDR200iLgg3EWBhWjltzmDW/I=" + # Testmunk + - secure: "CHBiUM60TolDbQnn+4IRA/tvOKwKs3g9EDvv8YHSJMg3FuHmjKQkprBasvxf3hnTXg4WLZEubmeDcyJ6RRzPP5mMSr/hksYl0pSjj/6TUecE5fHPVVeN7txVqkpOBf9i45Y+iBUQMjBb1NnDK3pHXxpnAs1Q/pe7vReErj4GF1U=" + # iOS code signing + - secure: "I6Iu75X1E+js5tzijtKi1EGtIuBcA4/25nDYe0svV4HAtujY71ZJZ4eB6355CKhFXpLXrF3i7eKVX3v+zWS0QROPEWacgsqsvNg+Ba9cnznW/faUSOYekCfhzWd/6reYDM7KzKAQwSUHLk9JIWK/kkmi4r+vVJK7h+tjPllK5YA=" + - IOS_APP_NAME="Mapbox GL" + - 'IOS_DEVELOPER_NAME="iPhone Distribution: Mapbox, Inc."' + - IOS_PROFILE_NAME="ios-in-house" + - secure: "nQqSM8rd7OHtV4MqmNqVnkrVHqxKqQsaWRYk4/nPdhbeVWtTtkk0df711LrF1TUtbEPEewHxYUvTZ/UXmwJNeoKdzTHavI8hnatRkgjyxGERPn1il1Otelht9I+LQQHf+plrpRjVWBrNIW0Zox1B3cqn6d3NglpbXrEQ2EjYGNA=" + - KIF_SCREENSHOTS="${TRAVIS_BUILD_DIR}/screenshots" install: -- ulimit -c - -before_script: - # Set the core file limit to unlimited so a core file is generated upon crash - - ulimit -c unlimited -S - # begin iOS code signing - - openssl aes-256-cbc -k "$IOS_ENCRYPTION_SECRET" -in scripts/ios_travis/ios-in-house.mobileprovision.enc -d -a -out scripts/ios_travis/ios-in-house.mobileprovision - - openssl aes-256-cbc -k "$IOS_ENCRYPTION_SECRET" -in scripts/ios_travis/ios-dist.cer.enc -d -a -out scripts/ios_travis/ios-dist.cer - - openssl aes-256-cbc -k "$IOS_ENCRYPTION_SECRET" -in scripts/ios_travis/ios-dist.p12.enc -d -a -out scripts/ios_travis/ios-dist.p12 - - ./scripts/ios_travis/add-key.sh - # end iOS code signing +- ./scripts/${FLAVOR}/install.sh script: -- ./scripts/travis_script.sh - -after_script: -- ./scripts/ios_travis/remove-key.sh +- ./scripts/${FLAVOR}/run.sh after_failure: -- if [[ ${TRAVIS_OS_NAME} == "osx" && ${TEST_OS} == "ios" ]]; then ./scripts/ios_travis/upload_screenshots.sh; fi +- if [ -f scripts/${FLAVOR}/run.sh ]; then /scripts/${FLAVOR}/after_failure.sh; fi notifications: slack: secure: HHQYr7sF8M1SzoWSqgKVYtwAgGdLLCyTMsQjFhEEQNYO92ZwURE5s03qWTGH5k8+4Yqn26yrXt3NztLC4JIOpcGervN2mSZyq4dZgFTcWEd61igw0qwSenlwvFfbE1ASK/KYCzfyn9MIfHN+ovwLoRxXZkPwinKDvl3DXjBaFNg= + git: submodules: false @@ -31,8 +31,12 @@ config/%.gypi: configure styles/styles: git submodule update --init styles +ifeq ($(shell uname -s), Darwin) SMCalloutView: git submodule update --init platform/ios/vendor/SMCalloutView +else +SMCalloutView: +endif KIF: git submodule update --init test/ios/KIF @@ -71,8 +75,9 @@ test-%: test ./scripts/run_tests.sh "build/$(HOST)/$(BUILDTYPE)/test" --gtest_filter=$* .PHONY: xtest +xtest: XCPRETTY := $(shell ./scripts/xcpretty.sh) xtest: Xcode/project - xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target test -jobs $(JOBS) + xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target test -jobs $(JOBS) $(XCPRETTY) xtest-%: xtest ./scripts/run_tests.sh "build/osx/Build/Products/$(BUILDTYPE)/test" --gtest_filter=$* @@ -91,8 +96,9 @@ run-osx: osx xosx-proj: Xcode/project open ./build/osx/gyp/project.xcodeproj +xosx: XCPRETTY := $(shell ./scripts/xcpretty.sh) xosx: Xcode/project - xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target osxapp -jobs $(JOBS) + xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target osxapp -jobs $(JOBS) $(XCPRETTY) run-xosx: xosx "gyp/build/$(BUILDTYPE)/Mapbox GL.app/Contents/MacOS/Mapbox GL" @@ -112,14 +118,16 @@ Xcode/ios: ios/app/mapboxgl-app.gyp config/ios.gypi styles/styles SMCalloutView ios-proj: Xcode/ios open ./build/ios/ios/app/mapboxgl-app.xcodeproj +ios: XCPRETTY := $(shell ./scripts/xcpretty.sh) ios: Xcode/ios - xcodebuild -sdk iphoneos ARCHS="arm64 armv7 armv7s" PROVISIONING_PROFILE="2b532944-bf3d-4bf4-aa6c-a81676984ae8" -project ./build/ios/ios/app/mapboxgl-app.xcodeproj -configuration Release -target iosapp -jobs $(JOBS) + xcodebuild -sdk iphoneos ARCHS="arm64 armv7 armv7s" PROVISIONING_PROFILE="2b532944-bf3d-4bf4-aa6c-a81676984ae8" -project ./build/ios/ios/app/mapboxgl-app.xcodeproj -configuration Release -target iosapp -jobs $(JOBS) $(XCPRETTY) +isim: XCPRETTY := $(shell ./scripts/xcpretty.sh) isim: Xcode/ios - xcodebuild -sdk iphonesimulator ARCHS="x86_64 i386" -project ./build/ios/ios/app/mapboxgl-app.xcodeproj -configuration Debug -target iosapp -jobs $(JOBS) + xcodebuild -sdk iphonesimulator ARCHS="x86_64 i386" -project ./build/ios/ios/app/mapboxgl-app.xcodeproj -configuration Debug -target iosapp -jobs $(JOBS) $(XCPRETTY) ipackage: clean Xcode/ios - ./scripts/package_ios.sh + ./scripts/ios/package.sh itest: ipackage KIF ./scripts/test_ios.sh @@ -138,8 +146,9 @@ run-linux: linux (cd build/$(HOST)/$(BUILDTYPE) && ./mapbox-gl) .PHONY: xlinux run-xlinux +xlinux: XCPRETTY := $(shell ./scripts/xcpretty.sh) xlinux: Xcode/project - xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target linuxapp -jobs $(JOBS) + xcodebuild -project ./build/osx/gyp/project.xcodeproj -configuration $(BUILDTYPE) -target linuxapp -jobs $(JOBS) $(XCPRETTY) run-xlinux: xlinux "gyp/build/$(BUILDTYPE)/mapbox-gl" @@ -49,7 +49,7 @@ Target OS X: 10.9+ If you merely want to install the library for iOS and try it out as an Objective-C consumer: 0. Use [Homebrew](http://brew.sh/) to install Boost headers: `brew install boost`. -1. Run `./scripts/package_ios.sh`. The packaging script will produce the statically-linked `libMapboxGL.a`, `MapboxGL.bundle` for resources, and a `Headers` folder. +1. Run `./scripts/ios/package.sh`. The packaging script will produce the statically-linked `libMapboxGL.a`, `MapboxGL.bundle` for resources, and a `Headers` folder. 2. Copy the contents of `build/ios/pkg/static` into your project. It should happen automatically, but ensure that: - `Headers` is in your *Header Search Paths* (`HEADER_SEARCH_PATHS`) build setting. - `MapboxGL.bundle` is in your target's *Copy Bundle Resources* build phase. diff --git a/android/scripts/build-debug.sh b/android/scripts/build-debug.sh deleted file mode 100755 index 450820a118..0000000000 --- a/android/scripts/build-debug.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -export BUILDTYPE=Debug - -./android/scripts/common.sh $1 diff --git a/android/scripts/build-release.sh b/android/scripts/build-release.sh deleted file mode 100755 index 73c7fab81a..0000000000 --- a/android/scripts/build-release.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -export BUILDTYPE=Release - -./android/scripts/common.sh $1 diff --git a/android/scripts/common.sh b/android/scripts/common.sh deleted file mode 100755 index 0d610909bc..0000000000 --- a/android/scripts/common.sh +++ /dev/null @@ -1,40 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -NAME=$1 - -case `uname -s` in - 'Darwin') export JOBS=`sysctl -n hw.ncpu` ;; - 'Linux') export JOBS=`nproc` ;; - *) export JOBS=1 ;; -esac - - -export CC=clang CXX=clang++ -export MASON_PLATFORM=android - -mkdir -p ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw/ -echo "${MAPBOX_ACCESS_TOKEN}" >> ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw/token.txt - -make android -j$JOBS BUILDTYPE=$BUILDTYPE JOBS=$JOBS - -S3_PREFIX=s3://mapbox/mapbox-gl-native/android/build/${NAME} -APK_OUTPUTS=./android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk - -# Upload the shared object. -aws s3 cp \ - ./build/android-${ANDROID_ABI}/${BUILDTYPE}/lib.target/libmapbox-gl.so \ - ${S3_PREFIX}/libmapbox-gl.so - -# Upload either the debug or the release build -if [ ${BUILDTYPE} == "Debug" ] ; then - aws s3 cp \ - ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-debug.apk \ - ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-debug.apk -elif [ ${BUILDTYPE} == "Release" ] ; then - aws s3 cp \ - ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-release-unsigned.apk \ - ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-release-unsigned.apk -fi diff --git a/android/scripts/run-build.sh b/android/scripts/run-build.sh deleted file mode 100755 index 9fa15a02bf..0000000000 --- a/android/scripts/run-build.sh +++ /dev/null @@ -1,85 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -cwd=$(pwd) - -region="us-east-1" -region_ami="ami-022e0c6a" -sleep=10 -instance_name="android-gl-build-$TRAVIS_REPO_SLUG-$TRAVIS_JOB_NUMBER" -echo $ami_name - -NAME=$TRAVIS_JOB_ID - -user_data="#!/bin/bash - cd /android - git clone git://github.com/mapbox/mapbox-gl-native.git - - pushd mapbox-gl-native - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then - git checkout $TRAVIS_COMMIT - else - git fetch origin +refs/pull/$TRAVIS_PULL_REQUEST/merge: - git checkout FETCH_HEAD - fi - git submodule update --init --recursive - - export ANDROID_NDK_PATH=/android/android-ndk-r10d - export JAVA_HOME=/android/jdk1.7.0_71 - export ANDROID_HOME=/android/android-sdk-linux - export PATH=\$PATH:/android/jdk1.7.0_71/bin - export MAPBOX_ACCESS_TOKEN=$MAPBOX_ACCESS_TOKEN - export TESTMUNK_KEY=$TESTMUNK_KEY - export TESTMUNK=$TESTMUNK - export MASON_ANDROID_ABI=$MASON_ANDROID_ABI - export ANDROID_ABI=$MASON_ANDROID_ABI - - if ./android/scripts/build-$CONFIG.sh $NAME &>../build.log; then - echo 'ANDROID BUILD PASSED' - else - echo 'ANDROID BUILD FAILED' - fi - popd - - aws s3 cp --region us-east-1 build.log s3://mapbox/mapbox-gl-native/android/build/${NAME}/build-log.txt - shutdown -P now" - -id=$(aws ec2 run-instances \ - --region $region \ - --image-id $region_ami \ - --count 1 \ - --instance-type m3.large \ - --iam-instance-profile Arn="$ANDROID_BUILD_INSTANCE_PROFILE" \ - --instance-initiated-shutdown-behavior terminate \ - --user-data "$user_data" | jq -r '.Instances[0].InstanceId') - -echo "Instance: $region $id" - -sleep 10 - -result=$(aws ec2 create-tags --region $region --resources $id --tags "Key=Name,Value=$instance_name") - -instance_status_terminated=$(aws ec2 describe-instances --region $region --instance-id $id | jq -r '.Reservations[0].Instances[0].State.Name') - -until [ "$instance_status_terminated" = "terminated" ]; do - instance_status_terminated=$(aws ec2 describe-instances --region $region --instance-id $id | jq -r '.Reservations[0].Instances[0].State.Name') - echo "Instance terminating status $region $id: $instance_status_terminated" - sleep $sleep -done - -echo "Build finished" - -output=$(aws ec2 get-console-output --region $region --instance-id $id | jq -r '.Output') - -aws s3 cp --region $region s3://mapbox/mapbox-gl-native/android/build/${NAME}/build-log.txt build.log -cat build.log - -if [[ $output == *"ANDROID BUILD PASSED"* ]]; then - echo "ANDROID BUILD PASSED" - exit 0 -else - echo "ANDROID BUILD FAILED" - exit 1 -fi diff --git a/config/defaults.mk b/config/defaults.mk index 2aa11ccbe9..1449bf8e1b 100644 --- a/config/defaults.mk +++ b/config/defaults.mk @@ -31,32 +31,32 @@ LIBS_linux += -Dcache_lib=$(word 1,$(CACHE) sqlite) LIBS_linux += --depth=. -Goutput_dir=. ANDROID_ABIS += android-lib-arm-v8 -ENV_android-arm-v8 = $(shell MASON_ANDROID_ABI=arm-v8 ./scripts/android_env.sh) +ENV_android-arm-v8 = $(shell MASON_ANDROID_ABI=arm-v8 ./scripts/android/toolchain.sh) CONFIG_android-arm-v8 = -Dhost=android -Iconfig/android-arm-v8.gypi ANDROID_ABIS += android-lib-arm-v7 -ENV_android-arm-v7 = $(shell MASON_ANDROID_ABI=arm-v7 ./scripts/android_env.sh) +ENV_android-arm-v7 = $(shell MASON_ANDROID_ABI=arm-v7 ./scripts/android/toolchain.sh) CONFIG_android-arm-v7 = -Dhost=android -Iconfig/android-arm-v7.gypi ANDROID_ABIS += android-lib-arm-v5 -ENV_android-arm-v5 = $(shell MASON_ANDROID_ABI=arm-v5 ./scripts/android_env.sh) +ENV_android-arm-v5 = $(shell MASON_ANDROID_ABI=arm-v5 ./scripts/android/toolchain.sh) CONFIG_android-arm-v5 = -Dhost=android -Iconfig/android-arm-v5.gypi ANDROID_ABIS += android-lib-x86 -ENV_android-x86 = $(shell MASON_ANDROID_ABI=x86 ./scripts/android_env.sh) +ENV_android-x86 = $(shell MASON_ANDROID_ABI=x86 ./scripts/android/toolchain.sh) CONFIG_android-x86 = -Dhost=android -Iconfig/android-x86.gypi # OpenSSL build is incomplete. # ANDROID_ABIS += android-lib-x86-64 -# ENV_android-x86-64 = $(shell MASON_ANDROID_ABI=x86-64 ./scripts/android_env.sh) +# ENV_android-x86-64 = $(shell MASON_ANDROID_ABI=x86-64 ./scripts/android/toolchain.sh) # CONFIG_android-x86-64 = -Dhost=android -Iconfig/android-x86-64.gypi ANDROID_ABIS += android-lib-mips -ENV_android-mips = $(shell MASON_ANDROID_ABI=mips ./scripts/android_env.sh) +ENV_android-mips = $(shell MASON_ANDROID_ABI=mips ./scripts/android/toolchain.sh) CONFIG_android-mips = -Dhost=android -Iconfig/android-mips.gypi ANDROID_ABIS += android-lib-mips-64 -ENV_android-mips-64 = $(shell MASON_ANDROID_ABI=mips-64 ./scripts/android_env.sh) +ENV_android-mips-64 = $(shell MASON_ANDROID_ABI=mips-64 ./scripts/android/toolchain.sh) CONFIG_android-mips-64 = -Dhost=android -Iconfig/android-mips-64.gypi LIBS_android = -Dheadless_lib=none @@ -15,7 +15,8 @@ function finish { trap finish EXIT # Install mason -. ./scripts/local_mason.sh +git submodule update --init .mason +export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" case ${MASON_PLATFORM} in 'ios') diff --git a/docker/linux/test.sh b/docker/linux/test.sh deleted file mode 100755 index 9ef9bf51f5..0000000000 --- a/docker/linux/test.sh +++ /dev/null @@ -1,26 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -export TRAVIS_OS_NAME=linux - -cd build - -source ./scripts/local_mason.sh -mason install mesa 10.4.3 -export LD_LIBRARY_PATH=`mason prefix mesa 10.4.3`/lib - -export DISPLAY=:99.0 -Xvfb :99 -ac -screen 0 1024x768x24 & - -if [[ ${CXX} == "g++" ]]; then - export CXX="g++-4.8" - export CC="gcc-4.8" -fi - -source ./scripts/install_node.sh - -make linux -j`nproc` -make test-* -j`nproc` -./scripts/compare_images.sh diff --git a/platform/default/asset_request_fs.cpp b/platform/default/asset_request_fs.cpp index a7d813b720..08b336ad38 100644 --- a/platform/default/asset_request_fs.cpp +++ b/platform/default/asset_request_fs.cpp @@ -7,9 +7,9 @@ #include <uv.h> #pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #ifndef __clang__ #pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#pragma GCC diagnostic ignored "-Wshadow" #endif #include <boost/algorithm/string.hpp> #pragma GCC diagnostic pop diff --git a/platform/default/asset_request_zip.cpp b/platform/default/asset_request_zip.cpp index 22d426c762..f66ca619ba 100644 --- a/platform/default/asset_request_zip.cpp +++ b/platform/default/asset_request_zip.cpp @@ -8,9 +8,9 @@ #include "uv_zip.h" #pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #ifndef __clang__ #pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#pragma GCC diagnostic ignored "-Wshadow" #endif #include <boost/algorithm/string.hpp> #pragma GCC diagnostic pop diff --git a/scripts/android/install.sh b/scripts/android/install.sh new file mode 100755 index 0000000000..656465cf2f --- /dev/null +++ b/scripts/android/install.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +source ./scripts/travis_helper.sh + +mapbox_time "checkout_mason" \ +git submodule update --init .mason + +export MASON_PLATFORM=android +export MASON_ANDROID_ABI=${ANDROID_ABI} + +mapbox_time "android_toolchain" \ +./scripts/android/toolchain.sh diff --git a/scripts/android/run.sh b/scripts/android/run.sh new file mode 100755 index 0000000000..7a909ffe3c --- /dev/null +++ b/scripts/android/run.sh @@ -0,0 +1,61 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +BUILDTYPE=${BUILDTYPE:-Release} +TESTMUNK=${TESTMUNK:-no} +export HOST=android +export MASON_PLATFORM=android +export MASON_ANDROID_ABI=${ANDROID_ABI:-arm-v7} + +source ./scripts/travis_helper.sh + +# Add Mason to PATH +export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" + +################################################################################ +# Build +################################################################################ + +mapbox_time "checkout_styles" \ +git submodule update --init styles + +mkdir -p ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw +echo "${MAPBOX_ACCESS_TOKEN}" > ./android/java/MapboxGLAndroidSDKTestApp/src/main/res/raw/token.txt + +mapbox_time "compile_library" \ +make android-lib -j${JOBS} BUILDTYPE=${BUILDTYPE} + +mapbox_time "build_apk" \ +make android -j${JOBS} BUILDTYPE=${BUILDTYPE} + +################################################################################ +# Deploy +################################################################################ + +if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then + # Install and add awscli to PATH for uploading the results + mapbox_time "install_awscli" \ + pip install --user awscli + export PATH="`python -m site --user-base`/bin:${PATH}" + + mapbox_time_start "deploy_results" + echo "Deploying results..." + + S3_PREFIX=s3://mapbox/mapbox-gl-native/android/build/${TRAVIS_JOB_NUMBER} + APK_OUTPUTS=./android/java/MapboxGLAndroidSDKTestApp/build/outputs/apk + + # Upload either the debug or the release build + if [ ${BUILDTYPE} == "Debug" ] ; then + aws s3 cp \ + ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-debug.apk \ + ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-debug.apk + elif [ ${BUILDTYPE} == "Release" ] ; then + aws s3 cp \ + ${APK_OUTPUTS}/MapboxGLAndroidSDKTestApp-release-unsigned.apk \ + ${S3_PREFIX}/MapboxGLAndroidSDKTestApp-release-unsigned.apk + fi + + mapbox_time_finish +fi diff --git a/scripts/android/toolchain.sh b/scripts/android/toolchain.sh new file mode 100755 index 0000000000..67cd0aa476 --- /dev/null +++ b/scripts/android/toolchain.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +export MASON_PLATFORM=android +export MASON_ANDROID_ABI=${MASON_ANDROID_ABI:-arm-v7} +export PATH="`pwd`/.mason:${PATH}" +export MASON_DIR="`pwd`/.mason" + +export PATH=`mason env PATH` + +echo MASON_PLATFORM=\"${MASON_PLATFORM}\" +echo MASON_ANDROID_ABI=\"${MASON_ANDROID_ABI}\" +echo CXX=\"`which $(mason env CXX)`\" +echo CC=\"`which $(mason env CC)`\" +echo LD=\"`which $(mason env LD)`\" +echo LINK=\"`which $(mason env CXX)`\" +echo AR=\"`which $(mason env AR)`\" +echo RANLIB=\"`which $(mason env RANLIB)`\" +echo STRIP=\"`which $(mason env STRIP)`\" +echo LDFLAGS=\"`mason env LDFLAGS` \${LDFLAGS:-}\" +echo CFLAGS=\"`mason env CFLAGS` \${CFLAGS:-}\" +echo CXXFLAGS=\"`mason env CXXFLAGS` \${CXXFLAGS:-}\" +echo CPPFLAGS=\"`mason env CPPFLAGS` \${CPPFLAGS:-}\" +echo JNIDIR=\"`mason env JNIDIR`\" diff --git a/scripts/android_env.sh b/scripts/android_env.sh deleted file mode 100755 index 93b1452a5a..0000000000 --- a/scripts/android_env.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -./scripts/local_mason.sh - -export MASON_PLATFORM=android - -export PATH=`.mason/mason env PATH` - -echo MASON_PLATFORM=\"android\" -echo MASON_ANDROID_ABI=\"${MASON_ANDROID_ABI}\" - -echo CXX=\"`which $(.mason/mason env CXX)`\" -echo CC=\"`which $(.mason/mason env CC)`\" -echo LD=\"`which $(.mason/mason env LD)`\" -echo LINK=\"`which $(.mason/mason env CXX)`\" -echo AR=\"`which $(.mason/mason env AR)`\" -echo RANLIB=\"`which $(.mason/mason env RANLIB)`\" -echo STRIP=\"`which $(.mason/mason env STRIP)`\" -echo LDFLAGS=\"`.mason/mason env LDFLAGS` ${LDFLAGS}\" -echo CFLAGS=\"`.mason/mason env CFLAGS` ${CFLAGS}\" -echo CPPFLAGS=\"`.mason/mason env CPPFLAGS` ${CPPFLAGS}\" -echo JNIDIR=\"`.mason/mason env JNIDIR`\" diff --git a/scripts/flags.sh b/scripts/flags.sh deleted file mode 100755 index 10cc88e5c6..0000000000 --- a/scripts/flags.sh +++ /dev/null @@ -1,32 +0,0 @@ -#!/usr/bin/env bash - -if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then - export DISPLAY=:99.0 - - if [[ ${MASON_PLATFORM} != "android" ]]; then - sh -e /etc/init.d/xvfb start - fi - - # use g++ that supports c++11 - if [[ ${CXX} == "g++" ]]; then - export CXX="g++-4.8" - export CC="gcc-4.8" - fi - - # If building in debug then turn on sanitizers. - # They should both work with latest g++/clang++ - # but it's not worth a standalone matrix so here - # we just test address->gcc and thread->clang for - # some limited coverage - # if [[ ${BUILDTYPE} == "Debug" ]]; then - # if [[ ${CXX} == "g++" ]]; then - # export CXXFLAGS="-fsanitize=address -g ${CXXFLAGS}" - # export CFLAGS="-fsanitize=address -g ${CFLAGS}" - # export LDFLAGS="-fsanitize=address ${LDFLAGS}" - # elif [[ ${CXX} == "clang++" ]]; then - # export CXXFLAGS="-fsanitize=thread -g -fPIC ${CXXFLAGS}" - # export CFLAGS="-fsanitize=thread -g ${CFLAGS}" - # export LDFLAGS="-fsanitize=thread -pie ${LDFLAGS}" - # fi - # fi -fi diff --git a/scripts/install_node.sh b/scripts/install_node.sh deleted file mode 100755 index ecb5b88350..0000000000 --- a/scripts/install_node.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -mason install node 0.10.35 -export PATH="`mason prefix node 0.10.35`/bin":"$PATH" diff --git a/scripts/ios_travis/add-key.sh b/scripts/ios/add-key.sh index b581445303..fe963d38eb 100755 --- a/scripts/ios_travis/add-key.sh +++ b/scripts/ios/add-key.sh @@ -16,10 +16,10 @@ security unlock-keychain -p travis ios-build.keychain security set-keychain-settings -t 3600 -l ~/Library/Keychains/ios-build.keychain # Add certificates to keychain and allow codesign to access them -security import ./scripts/ios_travis/apple.crt -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign -security import ./scripts/ios_travis/ios-dist.cer -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign -security import ./scripts/ios_travis/ios-dist.p12 -k ~/Library/Keychains/ios-build.keychain -P $IOS_KEY_PASSWORD -T /usr/bin/codesign +security import ./scripts/ios/apple.crt -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign +security import ./scripts/ios/ios-dist.cer -k ~/Library/Keychains/ios-build.keychain -T /usr/bin/codesign +security import ./scripts/ios/ios-dist.p12 -k ~/Library/Keychains/ios-build.keychain -P $IOS_KEY_PASSWORD -T /usr/bin/codesign # Put the provisioning profile in place mkdir -p ~/Library/MobileDevice/Provisioning\ Profiles -cp "./scripts/ios_travis/$IOS_PROFILE_NAME.mobileprovision" ~/Library/MobileDevice/Provisioning\ Profiles/ +cp "./scripts/ios/$IOS_PROFILE_NAME.mobileprovision" ~/Library/MobileDevice/Provisioning\ Profiles/ diff --git a/scripts/ios_travis/upload_screenshots.sh b/scripts/ios/after_failure.sh index 88a6427f75..88a6427f75 100755 --- a/scripts/ios_travis/upload_screenshots.sh +++ b/scripts/ios/after_failure.sh diff --git a/scripts/ios_travis/apple.crt b/scripts/ios/apple.crt Binary files differindex 0de099b869..0de099b869 100644 --- a/scripts/ios_travis/apple.crt +++ b/scripts/ios/apple.crt diff --git a/scripts/ios/install.sh b/scripts/ios/install.sh new file mode 100755 index 0000000000..9e649e450e --- /dev/null +++ b/scripts/ios/install.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +source ./scripts/travis_helper.sh + +mapbox_time "checkout_mason" \ +git submodule update --init .mason +export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" + +mapbox_time "install_xcpretty" \ +gem install xcpretty --no-rdoc --no-ri --no-document --quiet + +mkdir -p ${KIF_SCREENSHOTS} diff --git a/scripts/ios_travis/ios-dist.cer.enc b/scripts/ios/ios-dist.cer.enc index dfdd0ca997..dfdd0ca997 100644 --- a/scripts/ios_travis/ios-dist.cer.enc +++ b/scripts/ios/ios-dist.cer.enc diff --git a/scripts/ios_travis/ios-dist.p12.enc b/scripts/ios/ios-dist.p12.enc index ad6507ef9f..ad6507ef9f 100644 --- a/scripts/ios_travis/ios-dist.p12.enc +++ b/scripts/ios/ios-dist.p12.enc diff --git a/scripts/ios_travis/ios-in-house.mobileprovision.enc b/scripts/ios/ios-in-house.mobileprovision.enc index 51036a7415..51036a7415 100644 --- a/scripts/ios_travis/ios-in-house.mobileprovision.enc +++ b/scripts/ios/ios-in-house.mobileprovision.enc diff --git a/scripts/package_ios.sh b/scripts/ios/package.sh index 07e568faa1..07e568faa1 100755 --- a/scripts/package_ios.sh +++ b/scripts/ios/package.sh diff --git a/scripts/publish_ios.sh b/scripts/ios/publish.sh index f65f3e5609..f65f3e5609 100755 --- a/scripts/publish_ios.sh +++ b/scripts/ios/publish.sh diff --git a/scripts/ios_travis/remove-key.sh b/scripts/ios/remove-key.sh index 56b769ac21..56b769ac21 100755 --- a/scripts/ios_travis/remove-key.sh +++ b/scripts/ios/remove-key.sh diff --git a/scripts/ios/run.sh b/scripts/ios/run.sh new file mode 100755 index 0000000000..abb4c2cb0c --- /dev/null +++ b/scripts/ios/run.sh @@ -0,0 +1,35 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail +set -u + +BUILDTYPE=${BUILDTYPE:-Release} + +source ./scripts/travis_helper.sh + +# Add Mason to PATH +export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" + +PUBLISH_TAG=($(git show -s --format=%B | sed -n 's/.*\[publish \([a-z]\{1,\}\)-v\([0-9.]\{1,\}\)\].*/\1 \2/p')) +PUBLISH_PLATFORM=${PUBLISH_TAG[0],-} +PUBLISH_VERSION=${PUBLISH_TAG[1],-} + + +################################################################################ +# Build +################################################################################ + +if [[ ${PUBLISH_PLATFORM} = 'ios' ]]; then + # build & package iOS + mapbox_time "package_ios" \ + make ipackage + + # publish iOS build + mapbox_time "deploy_ios" \ + ./scripts/publish_ios.sh "${PUBLISH_VERSION}" +else + # build & test iOS + mapbox_time "run_ios_tests" \ + make itest +fi diff --git a/scripts/linux/install.sh b/scripts/linux/install.sh new file mode 100755 index 0000000000..a6ffacf5fe --- /dev/null +++ b/scripts/linux/install.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +source ./scripts/travis_helper.sh + +mapbox_time "checkout_mason" \ +git submodule update --init .mason +export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" + +mapbox_time "install_mesa" \ +mason install mesa 10.4.3 diff --git a/scripts/linux/run.sh b/scripts/linux/run.sh new file mode 100755 index 0000000000..c4731b97ec --- /dev/null +++ b/scripts/linux/run.sh @@ -0,0 +1,75 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +BUILDTYPE=${BUILDTYPE:-Release} + +source ./scripts/travis_helper.sh + +# Add Mason to 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 + +################################################################################ +# Build +################################################################################ + +mapbox_time "checkout_styles" \ +git submodule update --init styles + +mapbox_time "compile_program" \ +make linux -j${JOBS} BUILDTYPE=${BUILDTYPE} + +mapbox_time "compile_tests" \ +make test -j${JOBS} BUILDTYPE=${BUILDTYPE} + +################################################################################ +# Test +################################################################################ + +mapbox_time "checkout_test_suite" \ +git submodule update --init test/suite + +mapbox_time "run_tests" \ +make test-* BUILDTYPE=${BUILDTYPE} + +mapbox_time "compare_results" \ +./scripts/compare_images.sh + +################################################################################ +# Deploy +################################################################################ + +if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then + # Install and add awscli to PATH for uploading the results + mapbox_time "install_awscli" \ + pip install --user awscli + export PATH="`python -m site --user-base`/bin:${PATH}" + + mapbox_time_start "deploy_results" + (cd ./test/suite/ && ./bin/deploy_results.sh) + mapbox_time_finish +fi diff --git a/scripts/local_mason.sh b/scripts/local_mason.sh deleted file mode 100755 index 2d8687a280..0000000000 --- a/scripts/local_mason.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env bash - -git submodule update --init .mason -PATH=`pwd`/.mason:$PATH -export MASON_DIR=`pwd`/.mason diff --git a/scripts/npm_install.sh b/scripts/npm_install.sh deleted file mode 100755 index 7437af9619..0000000000 --- a/scripts/npm_install.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -cd bin -$1 install --clang=1 -cd ../ diff --git a/scripts/osx/install.sh b/scripts/osx/install.sh new file mode 100755 index 0000000000..1994d371d0 --- /dev/null +++ b/scripts/osx/install.sh @@ -0,0 +1,13 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +source ./scripts/travis_helper.sh + +mapbox_time "checkout_mason" \ +git submodule update --init .mason +export PATH="`pwd`/.mason:${PATH}" MASON_DIR="`pwd`/.mason" + +mapbox_time "install_xcpretty" \ +gem install xcpretty --no-rdoc --no-ri --no-document --quiet diff --git a/scripts/osx/run.sh b/scripts/osx/run.sh new file mode 100755 index 0000000000..b84ed04c21 --- /dev/null +++ b/scripts/osx/run.sh @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +set -e +set -o pipefail + +BUILDTYPE=${BUILDTYPE:-Release} + +source ./scripts/travis_helper.sh + +# Add Mason to 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 + +################################################################################ +# Build +################################################################################ + +mapbox_time "checkout_styles" \ +git submodule update --init styles + +mapbox_time "compile_program" \ +make xosx -j${JOBS} BUILDTYPE=${BUILDTYPE} + +mapbox_time "compile_tests" \ +make xtest -j${JOBS} BUILDTYPE=${BUILDTYPE} diff --git a/scripts/travis_before_install.sh b/scripts/travis_before_install.sh deleted file mode 100755 index f837e74161..0000000000 --- a/scripts/travis_before_install.sh +++ /dev/null @@ -1,53 +0,0 @@ -#!/usr/bin/env bash - -set -e -set -o pipefail - -if [[ ${TRAVIS_OS_NAME} == "linux" ]]; then - # - # install Linux dependencies - # - if [[ `lsb_release -r` =~ "12.04" ]]; then - sudo add-apt-repository --yes ppa:ubuntu-toolchain-r/test - fi - sudo add-apt-repository --yes ppa:boost-latest/ppa - - mapbox_time "apt_update" \ - sudo apt-get update -y - - mapbox_time "install_gcc" \ - sudo apt-get -y install gcc-4.8 g++-4.8 - - mapbox_time "install_build_tools" \ - sudo apt-get -y install git build-essential zlib1g-dev automake gdb \ - libtool xutils-dev make cmake pkg-config python-pip \ - libboost1.55-dev libcurl4-openssl-dev \ - libpng-dev libsqlite3-dev - - if [[ ${MASON_PLATFORM} != "android" ]]; then - mapbox_time "install_opengl" \ - sudo apt-get -y install mesa-utils libxi-dev x11proto-randr-dev \ - x11proto-xext-dev libxrandr-dev \ - x11proto-xf86vidmode-dev libxxf86vm-dev \ - libxcursor-dev libxinerama-dev \ - llvm-3.4 # required for mesa - - mapbox_time "install_mesa" \ - mason install mesa 10.4.3 - fi - - mapbox_time "install_awscli" \ - sudo pip install awscli -elif [[ ${TRAVIS_OS_NAME} == "osx" ]]; then - # - # install OS X dependencies - # - mapbox_time "install_build_tools" \ - brew install git - - mapbox_time "install_awscli" \ - sudo pip install awscli - - mapbox_time "install_xcpretty" \ - gem install xcpretty --no-rdoc --no-ri --no-document --quiet -fi diff --git a/scripts/travis_helper.sh b/scripts/travis_helper.sh index c42ce215e3..5e7dd46f4f 100755 --- a/scripts/travis_helper.sh +++ b/scripts/travis_helper.sh @@ -1,13 +1,21 @@ #!/usr/bin/env bash +case `uname -s` in + 'Darwin') JOBS=$((`sysctl -n hw.ncpu` + 2)) ;; + 'Linux') JOBS=$((`nproc` + 2)) ;; + *) JOBS=2 ;; +esac + +ANSI_CLEAR="\e[0m" + function mapbox_time_start { local name=$1 mapbox_timer_name=$name - travis_fold start $name + mapbox_fold start $name mapbox_timer_id=$(printf %08x $(( RANDOM * RANDOM ))) - eval "mapbox_start_time_$mapbox_timer_id=$(travis_nanoseconds)" + eval "mapbox_start_time_$mapbox_timer_id=$(mapbox_nanoseconds)" echo -en "travis_time:start:$mapbox_timer_id\n" } @@ -16,11 +24,11 @@ function mapbox_time_finish { local timer_id=${2:-$mapbox_timer_id} local timer_start="mapbox_start_time_$timer_id" eval local start_time=\${$timer_start} - local end_time=$(travis_nanoseconds) + local end_time=$(mapbox_nanoseconds) local duration=$(($end_time-$start_time)) echo -en "travis_time:end:$timer_id:start=$start_time,finish=$end_time,duration=$duration\n" - travis_fold end $name + mapbox_fold end $name } function mapbox_time { @@ -32,13 +40,13 @@ function mapbox_time { mapbox_time_finish $name $timer_id } -if [[ "${TRAVIS_COMMIT:-false}" == false ]]; then -function travis_fold { +function mapbox_fold { local action=$1 local name=$2 echo -en "travis_fold:${action}:${name}\r${ANSI_CLEAR}" } -function travis_nanoseconds { + +function mapbox_nanoseconds { local cmd="date" local format="+%s%N" local os=$(uname) @@ -51,11 +59,11 @@ function travis_nanoseconds { $cmd -u $format } -fi +export JOBS export ANSI_CLEAR -export -f travis_fold -export -f travis_nanoseconds +export -f mapbox_fold +export -f mapbox_nanoseconds export -f mapbox_time export -f mapbox_time_start export -f mapbox_time_finish diff --git a/scripts/travis_script.sh b/scripts/travis_script.sh deleted file mode 100755 index 093b31273d..0000000000 --- a/scripts/travis_script.sh +++ /dev/null @@ -1,71 +0,0 @@ -#!/usr/bin/env bash - -COMMIT_MESSAGE=$(git show -s --format=%B $1 | tr -d '\n') -PUBLISH_TAG=$(echo "$COMMIT_MESSAGE" | grep -oE '\[publish [a-z0-9\.\-]+\]' | grep -oE '[a-z0-9\.\-]+' | tail -n1) -PUBLISH_PLATFORM=$(echo "$PUBLISH_TAG" | awk -F '-v' '{ print $1 }') -PUBLISH_VERSION=$(echo "$PUBLISH_TAG" | awk -F '-v' '{ print $2 }') - -set -e -set -o pipefail - -mapbox_time "checkout_styles" \ -git submodule update --init styles - -if [[ $MASON_PLATFORM == "android" ]]; then - ./android/scripts/run-build.sh - -elif [[ ${TRAVIS_OS_NAME} == "linux" ]]; then - # - # build & test Linux - # - mapbox_time "compile_program" \ - make linux -j$JOBS BUILDTYPE=${BUILDTYPE} - - mapbox_time "compile_tests" \ - make test -j$JOBS BUILDTYPE=${BUILDTYPE} - - mapbox_time "checkout_test_suite" \ - git submodule update --init test/suite - - mapbox_time "run_tests" \ - make test-* BUILDTYPE=${BUILDTYPE} - - mapbox_time "compare_results" \ - ./scripts/compare_images.sh - - if [ ! -z "${AWS_ACCESS_KEY_ID}" ] && [ ! -z "${AWS_SECRET_ACCESS_KEY}" ] ; then - mapbox_time_start "deploy_results" - (cd ./test/suite/ && ./bin/deploy_results.sh) - mapbox_time_finish - fi - -elif [[ ${TRAVIS_OS_NAME} == "osx" && ${MASON_PLATFORM} == "osx" ]]; then - # - # build OS X - # - mapbox_time "build_osx" \ - make xosx -j$JOBS - -elif [[ ${TRAVIS_OS_NAME} == "osx" && ${MASON_PLATFORM} == "ios" ]]; then - # - # conditionally publish or test - # - if [[ -n "$PUBLISH_TAG" ]]; then - # - # build & package iOS - # - mapbox_time "package_ios" - make ipackage - # - # publish iOS build - # - mapbox_time "deploy_ios" - ./scripts/publish_ios.sh "$PUBLISH_VERSION" - else - # - # build & test iOS - # - mapbox_time "run_ios_tests" - make itest - fi -fi diff --git a/scripts/xcpretty.sh b/scripts/xcpretty.sh new file mode 100755 index 0000000000..c39f588220 --- /dev/null +++ b/scripts/xcpretty.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +FN=$(which xcpretty) ; [ ! -z ${FN} ] && echo "| ${FN}" diff --git a/src/mbgl/storage/default_file_source.cpp b/src/mbgl/storage/default_file_source.cpp index 4055001fc4..4cbc98fa52 100644 --- a/src/mbgl/storage/default_file_source.cpp +++ b/src/mbgl/storage/default_file_source.cpp @@ -13,9 +13,9 @@ #include <mbgl/map/environment.hpp> #pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #ifndef __clang__ #pragma GCC diagnostic ignored "-Wunused-local-typedefs" -#pragma GCC diagnostic ignored "-Wshadow" #endif #include <boost/algorithm/string.hpp> #pragma GCC diagnostic pop diff --git a/src/mbgl/style/style_parser.cpp b/src/mbgl/style/style_parser.cpp index dc91c250c1..da6630ef03 100644 --- a/src/mbgl/style/style_parser.cpp +++ b/src/mbgl/style/style_parser.cpp @@ -10,6 +10,7 @@ #include <csscolorparser/csscolorparser.hpp> #pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wshadow" #ifndef __clang__ #pragma GCC diagnostic ignored "-Wunused-local-typedefs" #endif diff --git a/test/test.gypi b/test/test.gypi index 40cd3d506d..5c975d547b 100644 --- a/test/test.gypi +++ b/test/test.gypi @@ -72,15 +72,18 @@ ], 'libraries': [ '<@(uv_static_libs)', + '<@(sqlite3_static_libs)', ], 'variables': { 'cflags_cc': [ '<@(uv_cflags)', '<@(opengl_cflags)', '<@(boost_cflags)', + '<@(sqlite3_cflags)', ], 'ldflags': [ '<@(uv_ldflags)', + '<@(sqlite3_ldflags)', ], }, 'conditions': [ |