-
Notifications
You must be signed in to change notification settings - Fork 11
/
build.gradle
167 lines (142 loc) · 5.66 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
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
plugins {
id 'java'
id 'jacoco'
id "org.sonarqube" version "3.3"
}
ext {
globalVersion = '0.25.4-ALPHA'
}
repositories {
maven {
url "https://repo1.maven.org/maven2/"
}
}
subprojects {
group 'ru.tinkoff.qa.neptune'
version globalVersion
apply plugin: 'java'
apply plugin: 'maven-publish'
apply plugin: 'project-report'
apply plugin: 'java-library'
apply plugin: 'signing'
apply plugin: 'jacoco'
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
[compileJava, compileTestJava]*.options*.encoding = 'UTF-8'
repositories {
maven {
url "https://repo1.maven.org/maven2/"
}
}
ext {
testNGVersion = '7.6.1'
junit5Version = '5.8.2'
junit5PlatformVersion = '1.8.2'
hamcrestVersion = '2.2'
seleniumVersion = '4.11.0'
allureVersion = '2.21.0'
jacksonVersion = '2.13.3'
mockitoVersion = '4.8.1'
springVersion = '5.3.20'
springDataVersion = '2.7.0'
springBootVersion = '2.7.0'
bytebuddyVersion = '1.13.0'
queryDslVersion = '5.0.0'
globalVersion = version
}
dependencies {
implementation group: 'org.apache.commons', name: 'commons-lang3', version: '3.12.0'
implementation group: 'com.google.guava', name: 'guava', version: '31.1-jre'
testImplementation group: 'org.testng', name: 'testng', version: testNGVersion
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.1'
api group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: jacksonVersion
api group: 'com.fasterxml.jackson.module', name: 'jackson-module-jaxb-annotations', version: jacksonVersion
api group: 'com.fasterxml.jackson.dataformat', name: 'jackson-dataformat-xml', version: jacksonVersion
api group: 'com.fasterxml.jackson.datatype', name: 'jackson-datatype-jsr310', version: jacksonVersion
api group: 'commons-validator', name: 'commons-validator', version: '1.7'
api group: 'commons-io', name: 'commons-io', version: '2.11.0'
implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0'
implementation group: 'io.github.classgraph', name: 'classgraph', version: '4.8.154'
testImplementation group: 'org.hamcrest', name: 'hamcrest', version: hamcrestVersion
compileOnly group: 'org.hamcrest', name: 'hamcrest', version: hamcrestVersion
implementation group: 'org.apache.tika', name: 'tika-core', version: '2.4.0'
implementation group: 'org.objenesis', name: 'objenesis', version: '3.3'
}
test {
useTestNG()
testLogging {
events "PASSED", "STARTED", "FAILED", "SKIPPED"
exceptionFormat "full"
showStackTraces true
}
finalizedBy jacocoTestReport
jacoco {
excludes = [
'**/**$HamcrestCombinableInterceptor.class',
'**/**$HamcrestInterceptor.class'
]
}
}
jacocoTestReport {
dependsOn test
reports {
xml.enabled true
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
classDirectories.setFrom(classDirectories.files.collect {
fileTree(dir: it,
exclude: [
'**/**$HamcrestCombinableInterceptor.class',
'**/**$HamcrestInterceptor.class'
]
)
})
}
}
task jacocoOverallReport(type: JacocoReport, group: 'Coverage reports') {
description = 'Generates an aggregate report from all subprojects'
dependsOn(subprojects.test)
additionalSourceDirs.from = files(subprojects.sourceSets.main.allSource.srcDirs)
sourceDirectories.from = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories.from = files(subprojects.sourceSets.main.output).files.collect {
fileTree(dir: it,
exclude: [
'**/**$HamcrestCombinableInterceptor.class',
'**/**$HamcrestInterceptor.class',
]
)
}
executionData.from = files(subprojects.jacocoTestReport.executionData)
reports {
html.enabled true
xml.enabled true
html.outputLocation = layout.buildDirectory.dir('jacocoHtml')
}
}
sonarqube {
properties {
property "sonar.organization", "neptune"
property "sonar.projectKey", "neptune"
property "sonar.host.url", "https://sonarcloud.io"
property "sonar.coverage.jacoco.xmlReportPaths", "$buildDir/reports/jacoco/jacocoOverallReport/jacocoOverallReport.xml"
property "sonar.qualitygate.wait", "true"
}
}
check.dependsOn test, jacocoOverallReport
task aggregatedJavadocs(type: Javadoc, description: 'Generate javadocs from all child projects as if it was a single project', group: 'Documentation') {
title = "Neptune API Documentation. v$globalVersion"
options.author true
options.links 'https://docs.oracle.com/en/java/javase/11/docs/api/'
options.addStringOption 'Xdoclint:none', '-quiet'
destinationDir = file("${buildDir}/../neptune.documentation/")
options.memberLevel = JavadocMemberLevel.PROTECTED
options.bottom = "Copyright © 2023 <a href=\"https://www.tinkoff.ru/software/\">Tinkoff.ru Development</a>."
subprojects.each { proj ->
proj.tasks.withType(Javadoc).each { javadocTask ->
source += javadocTask.source
classpath += javadocTask.classpath
excludes += javadocTask.excludes
includes += javadocTask.includes
}
}
}