-
Notifications
You must be signed in to change notification settings - Fork 39
/
Copy pathbuild.gradle
48 lines (43 loc) · 2.06 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
buildscript {
ext {
besuIdentifier = "linea-besu-${besuVersion}"
besuFilename = "${besuIdentifier}.tar.gz"
besuUrl = "${distributionBaseUrl}${besuVersion}/${besuFilename}"
besuPluginsIdentifier = "${distributionIdentifier}-${version}"
besuPluginDir = File.createTempDir("plugins")
}
}
plugins {
id 'java-library'
id "org.sonarqube" version "4.3.1.3277"
}
sonar {
def tests = System.getProperty("tests")
def xmlTestReport = ""
// Conditional xmlReportPaths based on tests property
// Default is unit tests, we account only for the Unit tests jacoco coverage report
if(tests == null || tests=="Unit") {
print("Executing Sonarqube scanner Unit tests coverage report...\n")
xmlTestReport = "${project.projectDir}/arithmetization/build/reports/jacoco/test/jacocoTestReport.xml"
// If set to Reference, we account only for the Reference tests coverage report
} else if(tests == "Reference") {
print("Executing Sonarqube scanner for Reference tests coverage report...\n")
xmlTestReport = "${project.projectDir}/reference-tests/build/reports/jacoco/jacocoReferenceBlockchainTestsReport/jacocoReferenceBlockchainTestsReport.xml"
} else if(tests == "Both") {
print("Executing Sonarqube scanner for Unit and Reference tests coverage report...\n")
xmlTestReport = "${project.projectDir}/arithmetization/build/reports/jacocoConcatenate/test/jacocoTestReport.xml"
} else {
// Force build failure if unknown concatenate value.
println("*** unknown tests property. Try '-Dconcatenate=Unit' or '-Dconcatenate=Reference' or '-Dconcatenate=Both'\n\n")
assert false
}
properties {
property "sonar.projectKey", "linea-tracer"
property "sonar.host.url", "localhost:80"
property "sonar.login", "admin"
property "sonar.password", "Adminadmin123*"
property "sonar.coverage.exclusions", "reference-tests/**/*, testing/**/*, **/*/Trace.java"
property "sonar.coverage.jacoco.xmlReportPaths", "${xmlTestReport}"
}
}
version = project.hasProperty('releaseVersion') ? project.getProperty('releaseVersion') : 'snapshot'