generated from CDCgov/template
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle
127 lines (108 loc) · 3.61 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
* This file was generated by the Gradle 'init' task.
*
* This generated file contains a sample Java application project to get you started.
* For more details take a look at the 'Building Java & JVM projects' chapter in the Gradle
* User Manual available at https://docs.gradle.org/7.5.1/userguide/building_java_projects.html
*/
plugins {
id 'groovy'
id 'java'
id 'jacoco'
id 'jacoco-report-aggregation'
id 'com.diffplug.spotless' version '6.25.0'
id 'com.github.johnrengelman.shadow' version '8.1.1'
id 'org.cyclonedx.bom' version '1.10.0'
id 'org.sonarqube' version '5.1.0.4882'
}
dependencies {
jacocoAggregation project(':app')
jacocoAggregation project(':shared')
jacocoAggregation project(':etor')
}
allprojects {
repositories {
mavenCentral()
}
}
subprojects {
apply plugin: 'org.sonarqube'
apply plugin: 'jacoco'
apply plugin: 'com.diffplug.spotless'
apply plugin: 'org.cyclonedx.bom'
cyclonedxBom {
// Specified the type of project being built. Defaults to 'library'
projectType = "application"
// Boms destination directory (defaults to build/reports)
// The file name for the generated BOMs (before the file format suffix). Defaults to 'bom'
outputName = "bom"
// The file format generated, can be xml, json or all for generating both
outputFormat = "all"
// Exclude BOM Serial Number
includeBomSerialNumber = false
}
jacoco {
toolVersion = '0.8.12'
}
spotless {
java {
custom 'Remove commented-out import statements', {
it.replaceAll(/\n\/\/ import .*?;.*/, '')
}
custom 'Refuse wildcard imports', {
String errorMessage = "Do not use wildcard imports. 'spotlessApply' cannot resolve this issue."
if (it =~ /\nimport .*\*;/) {
println(errorMessage) // Log the error message
throw new RuntimeException(errorMessage) // Throw a RuntimeException
}
return it
}
googleJavaFormat().aosp()
formatAnnotations()
}
groovy {
greclipse().configFile('../greclipse.properties')
excludeJava()
}
groovyGradle {
greclipse().configFile('../greclipse.properties')
}
}
}
ext.jacoco_excludes = [
'**/e2e/**',
'**/rs-e2e/**',
'**/javalin/App*',
'**/jackson/Jackson*',
'**/slf4j/LocalLogger*',
'**/slf4j/DeployedLogger*',
'**/slf4j/LoggerHelper*',
'**/jjwt/JjwtEngine*',
'**/apache/ApacheClient*',
'**/azure/AzureSecrets*',
'**/database/EtorSqlDriverManager*',
'**/azure/AzureClient*',
'**/azure/AzureDatabaseCredentialsProvider*',
'**/localfile/EnvironmentDatabaseCredentialsProvider*',
]
tasks.register('allUnitTests') {
dependsOn 'app:test'
dependsOn 'shared:test'
dependsOn 'etor:test'
dependsOn 'rs-e2e:test'
}
tasks.register('allBuilds') {
dependsOn 'app:build'
dependsOn 'shared:build'
dependsOn 'etor:build'
}
sonar {
properties {
property "sonar.projectName", "Trusted Intermediary"
property "sonar.projectKey", "trusted-intermediary"
property "sonar.organization", "cdcgov"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "$projectDir.path/build/reports/jacoco/testCodeCoverageReport/testCodeCoverageReport.xml"
property "sonar.coverage.exclusions", jacoco_excludes
}
}