Skip to content

Commit

Permalink
added buildViaTravis.sh, added coverals publishing to .travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
Чернышева Анна authored and Чернышева Анна committed Oct 2, 2017
1 parent 713eed4 commit adc0574
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@ cache:
directories:
- "$HOME/.gradle/caches/"
- "$HOME/.gradle/wrapper/"
after_success:
- "./gradlew jacocoTestReport coveralls"
31 changes: 31 additions & 0 deletions gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#!/usr/bin/env bash
# This script will build the project.

SWITCHES="--info --stacktrace"

GRADLE_VERSION=$(./gradlew -version | grep Gradle | cut -d ' ' -f 2)

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew build $SWITCHES
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then
echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']'
./gradlew build $SWITCHES
elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']'
case "$TRAVIS_TAG" in
*-rc\.*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true candidate $SWITCHES
;;
*)
./gradlew -Prelease.travisci=true -Prelease.useLastTag=true final bintrayUpload $SWITCHES
;;
esac
else
echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']'
./gradlew build $SWITCHES
fi

EXIT=$?

exit $EXIT

0 comments on commit adc0574

Please sign in to comment.