From cfb925a08109ed5116204c3302fd06c178cb3313 Mon Sep 17 00:00:00 2001 From: Federico Iosue Date: Fri, 14 Aug 2020 23:43:26 +0200 Subject: [PATCH] Working code coverage and exclusions on Sonarcloud --- build.gradle | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 6c82ab96bb..4c6f5c5918 100644 --- a/build.gradle +++ b/build.gradle @@ -43,6 +43,23 @@ allprojects { } apply plugin: 'org.sonarqube' +def exclusionList = [ + //Res and Assets + "**/src/main/res/**/*.*", + "**/src/main/assets/**/*.*", + + //Auto-Generated + '**/**/R.class', + '**/**/R$*.class', + '**/**/BuildConfig.*', + '**/**/*Manifest.*', + '**/android/**/*.*', + '**/androidx/**/*.*', + + //Tests + '**/src/test/**', + '**/src/androidTest/**' +] sonarqube { properties { property "sonar.projectName", "Omni Notes" @@ -52,7 +69,7 @@ sonarqube { property "sonar.host.url", "https://sonarcloud.io" property 'sonar.sourceEncoding', 'UTF-8' property 'sonar.language', 'java' - property 'sonar.coverage.jacoco.xmlReportPaths', "omniNotes/build/jacoco/jacoco.xml" + property 'sonar.coverage.jacoco.xmlReportPaths', "**/jacoco/jacoco.xml" + property 'sonar.exclusions', exclusionList } } -