1#!/bin/bash
2
3# see https://coderwall.com/p/9b_lfq
4
5set -e -u
6
7function mvn_deploy() {
8  mvn clean source:jar javadoc:jar deploy \
9    --settings="$(dirname $0)/settings.xml" -DskipTests=true "$@"
10}
11
12if [ "$TRAVIS_REPO_SLUG" == "google/guava" ] && \
13   [ "$TRAVIS_JDK_VERSION" == "openjdk8" ] && \
14   [ "$TRAVIS_PULL_REQUEST" == "false" ] && \
15   [ "$TRAVIS_BRANCH" == "master" ]; then
16  echo "Publishing Maven snapshot..."
17
18  mvn_deploy
19  mvn_deploy -f android/pom.xml
20
21  echo "Maven snapshot published."
22fi
23