diff options
author | Evgeny Mandrikov <mandrikov@gmail.com> | 2019-05-31 15:55:56 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-06-04 20:21:14 +0200 |
commit | e5f2fdce2f293261a0caf0c3f7cdad593174ee8f (patch) | |
tree | a61105c5e3f7a97ee944d4d3f0cd3cc6c42e44f9 | |
parent | 1002e68f1230b1f024cd2916afd7cf6efcac05ce (diff) | |
download | sonarqube-e5f2fdce2f293261a0caf0c3f7cdad593174ee8f.tar.gz sonarqube-e5f2fdce2f293261a0caf0c3f7cdad593174ee8f.zip |
Do not disable recording of code coverage in builds outside of CI
While this adds little overhead, benefit is that
remote Gradle cache entry can be used locally.
-rw-r--r-- | build.gradle | 5 | ||||
-rwxr-xr-x | travis.sh | 4 |
2 files changed, 3 insertions, 6 deletions
diff --git a/build.gradle b/build.gradle index 5b706509e54..681be67e780 100644 --- a/build.gradle +++ b/build.gradle @@ -308,12 +308,9 @@ subprojects { exceptionFormat 'full' // log the full stack trace (default is the 1st line of the stack trace) } jacoco { - enabled = project.hasProperty('jacocoEnabled') + enabled = true // do not disable recording of code coverage, so that remote Gradle cache entry can be used locally includes = ['com.sonar.*', 'com.sonarsource.*', 'org.sonar.*', 'org.sonarqube.*', 'org.sonarsource.*', 'io.sonarcloud.*'] } - if (project.hasProperty('jacocoEnabled')) { - finalizedBy 'jacocoTestReport' - } if (project.hasProperty('maxParallelTests')) { maxParallelForks = project.maxParallelTests as int } diff --git a/travis.sh b/travis.sh index a6562ef8912..7c858ca5433 100755 --- a/travis.sh +++ b/travis.sh @@ -36,12 +36,12 @@ case "$TARGET" in BUILD) git fetch --unshallow - ./gradlew build --no-daemon --console plain -PjacocoEnabled=true + ./gradlew build --no-daemon --console plain # the '-' at the end is needed when using set -u (the 'nounset' flag) # see https://stackoverflow.com/a/9824943/641955 if [[ -n "${SONAR_TOKEN-}" ]]; then - ./gradlew sonarqube --no-daemon --console plain \ + ./gradlew jacocoTestReport sonarqube --no-daemon --console plain \ -Dsonar.projectKey=org.sonarsource.sonarqube:sonarqube \ -Dsonar.organization=sonarsource \ -Dsonar.host.url=https://sonarcloud.io \ |