-
Notifications
You must be signed in to change notification settings - Fork 29
/
build.gradle.kts
215 lines (177 loc) · 6.5 KB
/
build.gradle.kts
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
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
import net.researchgate.release.ReleaseExtension
import java.nio.charset.StandardCharsets.UTF_8
val linkHomepage by extra("https://qameta.io/allure")
val linkCi by extra("https://ci.qameta.io/job/allure-teamcity")
val linkScmUrl by extra("https://github.com/allure-framework/allure-teamcity")
val linkScmConnection by extra("scm:git:git://github.com/allure-framework/allure-teamcity.git")
val linkScmDevConnection by extra("scm:git:ssh://[email protected]:allure-framework/allure-teamcity.git")
val root = rootProject.projectDir
val gradleScriptDir by extra("$root/gradle")
val qualityConfigsDir by extra("$gradleScriptDir/quality-configs")
val spotlessDtr by extra("$qualityConfigsDir/spotless")
val teamcityVersion by extra("2020.2")
val teamcityDir by extra("$root/.teamcity")
val serverOpts by extra("-DTC.res.disableAll=true " +
"-Dteamcity.development.mode=true " +
"-Dteamcity.development.shadowCopyClasses=true " +
"-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=50055")
tasks.wrapper {
gradleVersion = "7.5.1"
}
plugins {
java
signing
`java-library`
id("com.diffplug.spotless") version "6.13.0"
id("com.jfrog.bintray") version "1.8.5"
id("com.gorylenko.gradle-git-properties") version "2.4.1"
id("io.spring.dependency-management") version "1.1.0"
id("ru.vyarus.quality") version "4.7.0"
id("org.owasp.dependencycheck") version "7.4.4"
id("net.researchgate.release") version "3.0.2"
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
allprojects {
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}
}
description = "Allure Teamcity"
version = version
group = "io.qameta.allure"
configurations.all {
resolutionStrategy.eachDependency {
when (requested.module.toString()) {
"xml-apis:xml-apis" -> useVersion("1.4.01")
}
}
}
allprojects {
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}
}
apply(plugin = "net.researchgate.release")
configure<ReleaseExtension> {
tagTemplate.set("$version")
}
tasks.afterReleaseBuild {
dependsOn(":allure-teamcity-server:publishPlugin")
}
configure(subprojects) {
version = version
apply(plugin = "java")
apply(plugin = "maven-publish")
apply(plugin = "ru.vyarus.quality")
apply(plugin = "com.diffplug.spotless")
apply(plugin = "io.spring.dependency-management")
dependencyManagement {
imports {
mavenBom("com.fasterxml.jackson:jackson-bom:2.14.1")
mavenBom("org.junit:junit-bom:5.9.2")
}
dependencies {
dependency("com.intellij:openapi:7.0.3")
dependency("com.github.spotbugs:spotbugs-annotations:4.7.3")
dependency("commons-logging:commons-logging:1.2")
dependency("javax.servlet:jstl:1.1.2")
dependency("org.apache.commons:commons-compress:1.21")
dependency("org.apache.commons:commons-lang3:3.12.0")
dependency("commons-io:commons-io:2.11.0")
dependency("org.apache.httpcomponents.client5:httpclient5:5.2.1")
dependency("org.apache.maven:maven-artifact:3.6.3")
dependency("org.jetbrains.teamcity:agent-api:$teamcityVersion")
dependency("org.jetbrains.teamcity.internal:agent:$teamcityVersion")
dependency("org.jetbrains.teamcity.internal:server:$teamcityVersion")
dependency("org.projectlombok:lombok:1.18.24")
dependencySet("org.slf4j:2.0.3") {
entry("slf4j-api")
entry("slf4j-nop")
entry("slf4j-simple")
}
dependency("org.zeroturnaround:zt-zip:1.15")
}
}
tasks.compileTestJava {
options.compilerArgs.add("-parameters")
}
tasks.jar {
manifest {
attributes(mapOf(
"Implementation-Title" to project.name,
"Implementation-Version" to project.version
))
}
}
quality {
configDir = "$gradleScriptDir/quality-configs"
excludeSources = fileTree("build/generated-sources")
exclude("**/*.json")
checkstyleVersion = "8.36.1"
pmdVersion = "6.28.0"
spotbugsVersion = "4.1.2"
codenarcVersion = "1.6"
spotbugs = true
codenarc = true
pmd = true
checkstyle = true
htmlReports = false
afterEvaluate {
val spotbugs = configurations.findByName("spotbugs")
if (spotbugs != null) {
dependencies {
spotbugs("org.slf4j:slf4j-simple")
spotbugs("com.github.spotbugs:spotbugs:4.7.3")
}
}
tasks.withType(Checkstyle::class).configureEach {
configDirectory.set(file("$gradleScriptDir/quality-configs/checkstyle"))
}
}
}
spotless {
java {
target("src/**/*.java")
removeUnusedImports()
importOrder("", "jakarta", "javax", "java", "\\#")
licenseHeader(file("$spotlessDtr/allure.java.license").readText(UTF_8))
endWithNewline()
replaceRegex("one blank line after package line", "(package .+;)\n+import", "$1\n\nimport")
replaceRegex("one blank line after import lists", "(import .+;\n\n)\n+", "$1")
replaceRegex("no blank line between jakarta & javax", "(import jakarta.+;\n)\n+(import javax.+;\n)", "$1$2")
replaceRegex("no blank line between javax & java", "(import javax.+;\n)\n+(import java.+;\n)", "$1$2")
replaceRegex("no blank line between jakarta & java", "(import jakarta.+;\n)\n+(import java.+;\n)", "$1$2")
}
format("misc") {
target(
"*.gradle",
"*.gitignore",
"README.md",
"CONTRIBUTING.md",
"config/**/*.xml",
"src/**/*.xml"
)
trimTrailingWhitespace()
endWithNewline()
}
encoding("UTF-8")
}
java {
withJavadocJar()
withSourcesJar()
}
tasks.withType<Javadoc>().configureEach {
(options as StandardJavadocDocletOptions).addStringOption("Xdoclint:none", "-quiet")
}
tasks.withType<GenerateModuleMetadata>().configureEach {
enabled = false
}
repositories {
mavenLocal()
jcenter()
maven("https://download.jetbrains.com/teamcity-repository")
}
}