Skip to content

1.x: no need to run gradle assembe by travis #4183

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ jdk:
sudo: false
# as per http://blog.travis-ci.com/2014-12-17-faster-builds-with-container-based-infrastructure/

git:
depth: 10

# prevent travis running gradle assemble; let the build script do it anyway
install: true

# script for build and release via Travis to Bintray
script: gradle/buildViaTravis.sh

Expand Down
70 changes: 35 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ buildscript {
description = 'RxJava: Reactive Extensions for the JVM – a library for composing asynchronous and event-based programs using observable sequences for the Java VM.'

apply plugin: 'java'
apply plugin: 'pmd'
//apply plugin: 'pmd'
apply plugin: 'findbugs'
apply plugin: 'jacoco'
apply plugin: 'ru.vyarus.animalsniffer'
Expand Down Expand Up @@ -61,7 +61,7 @@ if (project.hasProperty('release.useLastTag')) {
}

test{
maxHeapSize = "1500m"
maxHeapSize = "1200m"
}

license {
Expand All @@ -81,40 +81,40 @@ jacocoTestReport {

build.dependsOn jacocoTestReport

pmd {
toolVersion = '5.4.2'
ignoreFailures = true
sourceSets = [sourceSets.main]
ruleSets = []
ruleSetFiles = files('pmd.xml')

}

pmdMain {
reports {
html.enabled = true
xml.enabled = true
}
}

task pmdPrint(dependsOn: 'pmdMain') << {
File file = new File('build/reports/pmd/main.xml')
if (file.exists()) {

println("Listing first 100 PMD violations")

file.eachLine { line, count ->
if (count <= 100) {
println(line)
}
}

} else {
println("PMD file not found.")
}
}

build.dependsOn pmdPrint
//pmd {
// toolVersion = '5.4.2'
// ignoreFailures = true
// sourceSets = [sourceSets.main]
// ruleSets = []
// ruleSetFiles = files('pmd.xml')
//}

//pmdMain {
// reports {
// html.enabled = true
// xml.enabled = true
// }
//}

//task pmdPrint(dependsOn: 'pmdMain') << {
// File file = new File('build/reports/pmd/main.xml')
// if (file.exists()) {
//
// println("Listing first 100 PMD violations")
//
// file.eachLine { line, count ->
// if (count <= 100) {
// println(line)
// }
// }
//
// } else {
// println("PMD file not found.")
// }
//}

//build.dependsOn pmdPrint

animalsniffer {
annotation = 'rx.internal.util.SuppressAnimalSniffer'
Expand Down
6 changes: 4 additions & 2 deletions gradle/buildViaTravis.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
#!/bin/bash
# This script will build the project.

git fsck --full

if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then
echo -e "Build Pull Request #$TRAVIS_PULL_REQUEST => Branch [$TRAVIS_BRANCH]"
./gradlew -Prelease.useLastTag=true build
./gradlew -Prelease.useLastTag=true build --stacktrace
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
Expand All @@ -12,5 +14,5 @@ elif [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_TAG" != "" ]; then
./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
./gradlew -Prelease.useLastTag=true build --stacktrace
fi