diff --git a/.travis.yml b/.travis.yml index 96a2865..bfbebbd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,15 @@ language: java - jdk: - - oraclejdk7 +- oraclejdk7 +sudo: false +script: gradle/buildViaTravis.sh +cache: + directories: + - "$HOME/.m2" + - "$HOME/.gradle" +env: + global: + - secure: i92CdoDDqeIiCGbhVc4AM4nQ4RORRZy1s9dEKMl6yQtXeD6Y5kZXg+SzRJSlAM9TNM7O24VmFHJn0o34jD8AJx4irk6JuFJQ23yGipGIsVUUetqpckF9hcsJl5/9D+0B6DpxQR4wiy2W4mSZeYSryXKWLbx4YC84ICEmiMIF0tc= + - secure: Q4TcIw8otYdvhPUgVcKMsoUm4ab277+bA9CMvcQSopSl9PRZgQBXG8GTI41LrPnlWHoocAqA8lhj4dS1ACHb7ulPBNVGOTbJwgSAP62WZ7Ka7T07idef2i8/s/HOKAYGJO2tC7OCX5Ynfd9seVm4zXbyLJkR5FqGhFDPhF5zDxc= + - secure: fx61a7A8lZNqGAArBcigjPtsxfj7wJOT2Tq+vbfdZouiPBZ68yUHKMmebssWDun62hrwJoFO3rSM6Qeg/t592AsRn/y+MF1l/IWG5VXkggaC0mYAYVH3cBjbVnWeAmPILva9YHeCsLHPyq8v8Z7bIhRz2f2tWwAPbUeezQUtxk4= + - secure: bIv6R9czUONhAOIpw/ustrmea5AMnLaUqLN93ASXzX1jqH8enx0uNj7HI5rRnmRSliKlh3klWofiMnuQnQQeREGlOYHJnkXx2Dy5RAQ2ps7gZDB/LCeBoyi6LajS5gEvNOvK7p2FuPtXZSGGDE9iEyLP/zswWeNJkjDY/Gi3WNo= diff --git a/build.gradle b/build.gradle index 72c35e6..b1028b5 100644 --- a/build.gradle +++ b/build.gradle @@ -12,4 +12,12 @@ dependencies { testCompile 'org.mockito:mockito-core:1.8.5' } +// support for snapshot/final releases with the various branches RxJava uses +nebulaRelease { + addReleaseBranchPattern(/\d+\.\d+\.\d+/) + addReleaseBranchPattern('HEAD') +} +if (project.hasProperty('release.useLastTag')) { + tasks.prepare.enabled = false +} diff --git a/gradle/buildViaTravis.sh b/gradle/buildViaTravis.sh new file mode 100755 index 0000000..d98e5eb --- /dev/null +++ b/gradle/buildViaTravis.sh @@ -0,0 +1,16 @@ +#!/bin/bash +# This script will build the project. + +if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then + echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]" + ./gradlew -Prelease.useLastTag=true build +elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" == "" ]; then + echo -e 'Build Branch with Snapshot => Branch ['$TRAVIS_BRANCH']' + ./gradlew -Prelease.travisci=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" build snapshot --stacktrace +elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then + echo -e 'Build Branch for Release => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG']' + ./gradlew -Prelease.travisci=true -Prelease.useLastTag=true -PbintrayUser="${bintrayUser}" -PbintrayKey="${bintrayKey}" -PsonatypeUsername="${sonatypeUsername}" -PsonatypePassword="${sonatypePassword}" final --stacktrace +else + echo -e 'WARN: Should not be here => Branch ['$TRAVIS_BRANCH'] Tag ['$TRAVIS_TAG'] Pull Request ['$TRAVIS_PULL_REQUEST']' + ./gradlew -Prelease.useLastTag=true build +fi