Skip to content

Commit

Permalink
Merge branch 'fix_master'
Browse files Browse the repository at this point in the history
  • Loading branch information
Dana Maxfield committed May 15, 2021
2 parents a8d7197 + 5a43cbc commit 169c525
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/main/groovy/com/synopsys/integration/Common.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -310,21 +310,27 @@ abstract class Common implements Plugin<Project> {
void configureForJacoco(Project project) {
project.plugins.apply('jacoco')

Task jacocoTestReport = project.tasks.findByName('jacocoTestReport')
jacocoTestReport.reports {
xml.enabled true
xml.destination project.file("${project.buildDir}/reports/jacoco/report.xml")
html.enabled true
html.destination project.file("${project.buildDir}/reports/jacoco/html")
csv.enabled false
}
def options = ['name': 'codeCoverageReport', 'type': JacocoReport.class, 'dependsOn': project.test, 'group': 'Verification', 'description': 'Generate code coverage report for tests executed in project.']
Task codeCoverageReport = project.tasks.create(options, {
executionData project.fileTree(project.rootDir.absolutePath).include("**/build/jacoco/*.exec")

sourceSets project.sourceSets.main

reports {
xml.enabled true
xml.destination project.file("${project.buildDir}/reports/jacoco/report.xml")
html.enabled true
html.destination project.file("${project.buildDir}/reports/jacoco/html")
csv.enabled false
}
})
}

void configureForSonarQube(Project project) {
def rootProject = project.rootProject
if (project == rootProject) {
project.plugins.apply(SonarQubePlugin.class)
project.tasks.getByName('sonarqube').dependsOn(project.tasks.getByName('jacocoTestReport'))
project.tasks.getByName('sonarqube').dependsOn(project.tasks.getByName('codeCoverageReport'))

def sonarExcludes = project.ext[PROPERTY_EXCLUDES_FROM_TEST_COVERAGE]

Expand Down

0 comments on commit 169c525

Please sign in to comment.