-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.gradle
251 lines (227 loc) · 8.92 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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
plugins {
id "org.jetbrains.kotlin.jvm" version "1.9.10" apply false
id 'jacoco'
id('io.github.gradle-nexus.publish-plugin') version '1.3.0'
}
if (hasProperty('buildScan')) {
buildScan {
termsOfServiceUrl = 'https://gradle.com/terms-of-service'
termsOfServiceAgree = 'yes'
}
}
nexusPublishing {
packageGroup = "ru.tinkoff"
repositories {
sonatype {
stagingProfileId = '1a63f6e54ff32d'
username = System.getenv().getOrDefault("REPO_USER", "")
password = System.getenv().getOrDefault("REPO_PASSWORD", "")
}
}
transitionCheckOptions {
maxRetries = 400
delayBetween = Duration.ofSeconds(5)
}
}
allprojects {
group = "ru.tinkoff.kora"
version = System.getenv().getOrDefault("KORA_VERSION", "1.1.0-SNAPSHOT")
repositories {
mavenCentral()
}
}
// config libraries
subprojects {
if (!project.childProjects.isEmpty() || project.name == 'maven-parent') {
return
}
apply plugin: 'java-library'
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(17))
}
}
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
tasks.withType(JavaCompile) {
options.encoding("UTF-8")
options.debug = true
options.compilerArgs << '-parameters' << '-Xlint:all' << '-Xlint:-serial,-processing' << '-XprintRounds'
}
}
// config test libraries
subprojects {
if (project.parent.name != "internal") {
return
}
dependencies {
api libs.junit.platform.launcher
api libs.junit.jupiter
}
}
// config experimental libraries
subprojects {
if (project.parent.name != "experimental") {
return
}
group = "ru.tinkoff.kora.experimental"
dependencies {
implementation libs.jetbrains.annotations
}
}
def isPublishedLibrary = { Project p ->
if (!p.childProjects.isEmpty()) {
return false
}
if (p.parent.name == "internal") {
return false
}
if (p.name == "maven-parent") {
return false
}
return true
}
subprojects {
def versions = libs.versions
configurations {
configureEach {
resolutionStrategy.force "com.fasterxml.jackson.core:jackson-annotations:${versions.jackson.get()}"
resolutionStrategy.force "com.fasterxml.jackson.core:jackson-core:${versions.jackson.get()}"
resolutionStrategy.force "com.fasterxml.jackson.core:jackson-databind:${versions.jackson.get()}"
resolutionStrategy.force "io.netty:netty-buffer:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-codec:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-codec-dns:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-codec-http2:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-codec-http:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-codec-socks:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-codec-common:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-handler:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-handler-proxy:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-resolver:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-resolver-dns:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-resolver-dns-classes-macos:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-transport:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-transport-clasess-epoll:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-transport-clasess-kqueue:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-transport-native-epoll:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-transport-native-kqueue:${versions.netty.get()}"
resolutionStrategy.force "io.netty:netty-transport-unix-common:${versions.netty.get()}"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib:${versions.kotlin.get().get()}"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk7:${versions.kotlin.get().get()}"
resolutionStrategy.force "org.jetbrains.kotlin:kotlin-stdlib-jdk8:${versions.kotlin.get().get()}"
}
}
}
// config published libraries
subprojects {
if (!isPublishedLibrary(it)) {
return
}
apply plugin: 'maven-publish'
apply plugin: 'jacoco'
apply plugin: 'signing'
test {
jacoco {
enabled = false
}
}
javadoc {
options.encoding = "UTF-8"
options.addBooleanOption("html5", true)
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
maven(MavenPublication) {
from components.java
pom {
afterEvaluate {
name = project.name
description = "Kora $project.name module"
}
licenses {
license {
name = 'The Apache Software License, Version 2.0'
url = 'https://github.com/kora-projects/kora/blob/master/LICENSE'
}
}
scm {
url = 'https://github.com/kora-projects/kora'
connection = 'scm:git:[email protected]/kora-projects/kora.git'
developerConnection = 'scm:git:[email protected]/kora-projects/kora.git'
}
url = 'https://github.com/kora-projects/kora'
developers {
developer {
id = 'a.otts'
name = 'Aleksei Otts'
email = '[email protected]'
}
developer {
id = 'a.duyun'
name = 'Anton Duyun'
email = '[email protected]'
}
developer {
id = 'a.kurako'
name = 'Anton Kurako'
email = '[email protected]'
}
developer {
id = 'a.yakovlev'
name = 'Artem Yakovlev'
email = '[email protected]'
}
}
withXml { pom ->
def xpf = javax.xml.xpath.XPathFactory.newInstance()
def xp = xpf.newXPath()
def xpath = xp.compile("//dependency[optional[contains(text(), 'true')]]")
def nl = (org.w3c.dom.NodeList) xpath.evaluate(pom.asElement(), javax.xml.xpath.XPathConstants.NODESET);
for (int i = nl.getLength() - 1; i >= 0; i--) {
nl.item(i).getParentNode().removeChild(nl.item(i))
}
}
}
}
}
}
signing {
required = false
sign publishing.publications.maven
}
test {
jvmArgs([
'-XX:FlightRecorderOptions=stackdepth=1024',
'--enable-preview',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.code=ALL-UNNAMED',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.main=ALL-UNNAMED',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.jvm=ALL-UNNAMED',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.processing=ALL-UNNAMED',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.comp=ALL-UNNAMED',
'--add-opens', 'jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED',
])
useJUnitPlatform()
testLogging {
showStandardStreams(false)
events("passed", "skipped", "failed")
exceptionFormat("full")
}
finalizedBy jacocoTestReport // report is always generated after tests run
}
dependencies {
api libs.jakarta.annotations
testImplementation project(":internal:test-logging")
testImplementation libs.junit.jupiter
testImplementation libs.mockito.core
testImplementation libs.assertj
}
task allDeps(type: DependencyReportTask) {}
}
apply from: "${project.rootDir}/gradle/ci-tests.gradle"