-
Notifications
You must be signed in to change notification settings - Fork 7
/
main.gradle
175 lines (149 loc) · 5.31 KB
/
main.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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
allprojects {
apply plugin: 'java'
apply plugin: 'jacoco'
apply plugin: 'org.sonarqube'
apply plugin: 'org.owasp.dependencycheck'
sourceCompatibility = JavaVersion.VERSION_17
repositories {
mavenCentral()
}
group 'com.github.bancolombia'
sonarqube {
properties {
property "sonar.sourceEncoding", "UTF-8"
property "sonar.projectKey", "bancolombia_data-mask"
property "sonar.organization", "grupo-bancolombia"
property "sonar.host.url", "https://sonarcloud.io/"
property "sonar.sources", "src/main"
property "sonar.test", "src/test"
property "sonar.java.binaries", "build/classes"
property "sonar.junit.reportPaths", "build/test-results/test"
property "sonar.java-coveragePlugin", "jacoco"
property "sonar.coverage.jacoco.xmlReportPaths", "${rootDir}/build/reports/jacoco/generateMergedReport/generateMergedReport.xml"
property "sonar.exclusions", ".github/**"
property 'sonar.coverage.exclusions', 'sample/**/*'
}
}
}
nexusPublishing {
repositories {
sonatype()
}
}
subprojects {
apply plugin: "java-library"
apply plugin: "io.spring.dependency-management"
apply plugin: 'org.owasp.dependencycheck'
ext {
groupId = 'com.github.bancolombia'
}
dependencies {
compileOnly 'org.projectlombok:lombok:1.18.34'
annotationProcessor 'org.projectlombok:lombok:1.18.34'
testAnnotationProcessor 'org.projectlombok:lombok:1.18.34'
testCompileOnly 'org.projectlombok:lombok:1.18.34'
testImplementation 'io.projectreactor:reactor-test:3.6.10'
testImplementation 'org.junit.jupiter:junit-jupiter:5.11.2'
testImplementation 'org.mockito:mockito-inline:5.2.0'
testImplementation 'org.mockito:mockito-junit-jupiter:5.14.1'
}
test {
useJUnitPlatform()
testLogging {
events "passed", "skipped", "failed"
}
}
test.finalizedBy(project.tasks.jacocoTestReport)
jacocoTestReport {
dependsOn test
reports {
xml.setRequired true
xml.setOutputLocation layout.buildDirectory.file("reports/jacoco.xml")
csv.setRequired false
html.setOutputLocation layout.buildDirectory.dir("reports/jacocoHtml")
}
}
compileJava {
options.compilerArgs = [
'-Amapstruct.suppressGeneratorTimestamp=true',
'-Amapstruct.suppressGeneratorVersionInfoComment=true'
]
}
// check.dependsOn dependencyCheckAggregate
dependencyCheck {
format = 'JSON'
formats = ['JSON']
}
if (toPublish.split(',').contains(it.name)) {
apply plugin: "maven-publish"
apply plugin: "signing"
java {
withJavadocJar()
withSourcesJar()
}
javadoc {
if (JavaVersion.current().isJava9Compatible()) {
options.addBooleanOption('html5', true)
}
}
javadoc.failOnError = false
tasks.withType(GenerateModuleMetadata).configureEach {
enabled = false
}
publishing {
publications {
mavenJava(MavenPublication) {
pom {
name = 'data-mask'
description = 'Data Masking library for jackson-databind.'
url = 'https://github.com/bancolombia/data-mask'
licenses {
license {
name = "MIT License"
url = "https://opensource.org/licenses/mit-license.php"
distribution = "repo"
}
}
developers {
developer {
id = "gabheadz"
name = "Gabriel Martinez"
email = "[email protected]"
}
}
scm {
url ="[email protected]:bancolombia/data-mask.git"
}
}
from components.java
groupId = groupId
artifactId = artifactId
version = project.property('version')
}
}
}
if (project.hasProperty('signing.keyId')) {
signing {
sign publishing.publications.mavenJava
}
}
}
}
tasks.register('generateMergedReport', JacocoReport) {
dependsOn test
dependsOn subprojects.test
dependsOn subprojects.javadoc
dependsOn subprojects.jacocoTestReport
additionalSourceDirs.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.setFrom files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.setFrom files(subprojects.sourceSets.main.output)
executionData.setFrom project.fileTree(dir: '.', include: '**/build/jacoco/test.exec')
reports {
xml.setRequired true
csv.setRequired false
html.setRequired true
}
}
tasks.named('wrapper') {
gradleVersion = '8.5'
}