summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorKonstantin Käfer <mail@kkaefer.com>2015-04-16 16:46:12 +0200
committerKonstantin Käfer <mail@kkaefer.com>2015-04-28 10:43:13 +0200
commit2b633cc51cd44be3f0224f0b105b18f0a3d7d657 (patch)
tree35b31e4b19cd43a56409843cc6c73eb979c06731 /scripts
parent67fdfbadb3382e895d2d0bb622520fc481ae2ee8 (diff)
downloadqtlocation-mapboxgl-2b633cc51cd44be3f0224f0b105b18f0a3d7d657.tar.gz
build on Travis' sudo: false infrastructure
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/android/install.sh15
-rwxr-xr-xscripts/android/run.sh61
-rwxr-xr-xscripts/android/toolchain.sh26
-rwxr-xr-xscripts/android_env.sh25
-rwxr-xr-xscripts/flags.sh32
-rwxr-xr-xscripts/install_node.sh4
-rwxr-xr-xscripts/ios/add-key.sh (renamed from scripts/ios_travis/add-key.sh)8
-rwxr-xr-xscripts/ios/after_failure.sh (renamed from scripts/ios_travis/upload_screenshots.sh)0
-rw-r--r--scripts/ios/apple.crt (renamed from scripts/ios_travis/apple.crt)bin1063 -> 1063 bytes
-rwxr-xr-xscripts/ios/install.sh15
-rw-r--r--scripts/ios/ios-dist.cer.enc (renamed from scripts/ios_travis/ios-dist.cer.enc)0
-rw-r--r--scripts/ios/ios-dist.p12.enc (renamed from scripts/ios_travis/ios-dist.p12.enc)0
-rw-r--r--scripts/ios/ios-in-house.mobileprovision.enc (renamed from scripts/ios_travis/ios-in-house.mobileprovision.enc)0
-rwxr-xr-xscripts/ios/package.sh (renamed from scripts/package_ios.sh)0
-rwxr-xr-xscripts/ios/publish.sh (renamed from scripts/publish_ios.sh)0
-rwxr-xr-xscripts/ios/remove-key.sh (renamed from scripts/ios_travis/remove-key.sh)0
-rwxr-xr-xscripts/ios/run.sh35
-rwxr-xr-xscripts/linux/install.sh13
-rwxr-xr-xscripts/linux/run.sh75
-rwxr-xr-xscripts/local_mason.sh5
-rwxr-xr-xscripts/npm_install.sh8
-rwxr-xr-xscripts/osx/install.sh13
-rwxr-xr-xscripts/osx/run.sh27
-rwxr-xr-xscripts/travis_before_install.sh53
-rwxr-xr-xscripts/travis_helper.sh28
-rwxr-xr-xscripts/travis_script.sh71
-rwxr-xr-xscripts/xcpretty.sh3
27 files changed, 305 insertions, 212 deletions
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
index 0de099b869..0de099b869 100644
--- a/scripts/ios_travis/apple.crt
+++ b/scripts/ios/apple.crt
Binary files differ
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}"