1#!/bin/bash
2
3# This file is used for Linux builds.
4# To run locally:
5#  ./buildscripts/kokoro/linux.sh
6
7# This script assumes `set -e`. Removing it may lead to undefined behavior.
8set -exu -o pipefail
9
10# It would be nicer to use 'readlink -f' here but osx does not support it.
11readonly OPENCENSUS_JAVA_DIR="$(cd "$(dirname "$0")"/../.. && pwd)"
12
13# cd to the root dir of opencensus-java
14cd $(dirname $0)/../..
15
16# Run tests
17./gradlew clean build
18
19OS=`uname`
20# Check the example only on Linux.
21if [ "$OS" = "Linux" ] ; then
22    pushd examples; ./gradlew clean assemble check --stacktrace; popd
23fi
24