forked from http4k/http4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle
333 lines (295 loc) · 11.3 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath Libs.kotlin_gradle_plugin
classpath Libs.gradle_cobertura_plugin
classpath Libs.coveralls_gradle_plugin
classpath Libs.dokka_gradle_plugin
classpath Libs.com_jfrog_bintray_gradle_plugin
classpath Libs.nebula_provided_base_gradle_plugin
classpath Libs.openapi_generator_gradle_plugin
}
}
plugins {
id 'com.github.kt3k.coveralls' version "2.9.0"
id "com.jfrog.bintray" version "1.8.4"
id 'de.fayard.buildSrcVersions' version "0.7.0"
id 'nebula.provided-base' version "3.0.3"
id 'net.saliman.cobertura' version "3.0.0"
}
allprojects {
repositories {
mavenCentral()
jcenter()
}
apply plugin: 'kotlin'
apply plugin: 'jacoco'
apply plugin: 'cobertura'
apply plugin: 'com.github.kt3k.coveralls'
apply plugin: 'com.jfrog.bintray'
apply plugin: 'maven'
apply plugin: 'maven-publish'
apply plugin: 'nebula.provided-base'
apply plugin: 'org.jetbrains.dokka'
jacoco {
toolVersion = '0.8.3'
}
cobertura.coverageFormats = ['html', 'xml']
cobertura.coverageSourceDirs = ['src/main/kotlin']
compileKotlin.kotlinOptions.jvmTarget = "1.8"
compileTestKotlin.kotlinOptions.jvmTarget = "1.8"
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
version = project.hasProperty('releaseVersion') ? project.releaseVersion : 'LOCAL'
group = 'org.http4k'
test {
useJUnitPlatform()
}
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
// task dokkaJavadoc(type: org.jetbrains.dokka.gradle.DokkaTask, overwrite: true, dependsOn: javadoc) {
// outputDirectory = javadoc.destinationDir
// outputFormat = "javadoc"
// processConfigurations = []
// }
// task javadocJar(type: Jar, dependsOn: dokkaJavadoc) {
// classifier = 'javadoc'
// from dokkaJavadoc.outputDirectory
// }
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
task testJar(type: Jar) {
classifier "test"
from sourceSets.test.output
}
configurations {
testArtifacts.extendsFrom testRuntime
}
artifacts {
testArtifacts testJar
}
publishing {
publications {
mavenJava(MavenPublication) {
mavenJava(MavenPublication) {
artifactId = archivesBaseName
pom.withXml {
asNode().appendNode('name', archivesBaseName)
asNode().appendNode('description', description)
asNode().appendNode('url', 'https://http4k.org')
asNode().appendNode('developers')
.appendNode('developer').appendNode('name', 'Ivan Sanchez').parent().appendNode('email', 'ivan@http4k.org')
.parent().parent()
.appendNode('developer').appendNode('name', 'David Denton').parent().appendNode('email', 'david@http4k.org')
asNode().appendNode('scm').
appendNode('url', 'git@github.com:http4k/' + archivesBaseName + '.git').parent().
appendNode('connection', 'scm:git:git@github.com:http4k/' + archivesBaseName + '.git').parent().
appendNode('developerConnection', 'scm:git:git@github.com:http4k/' + archivesBaseName + '.git')
asNode().appendNode('licenses').appendNode('license').
appendNode('name', 'Apache License, Version 2.0').parent().
appendNode('url', 'http://www.apache.org/licenses/LICENSE-2.0.html')
}
from components.java
artifact sourcesJar
artifact javadocJar
}
}
}
}
bintray {
user = System.getenv('BINTRAY_USER')
key = System.getenv('BINTRAY_KEY')
publications = ['mavenJava']
dryRun = false
publish = true
pkg {
repo = 'maven'
userOrg = 'http4k'
name = project.name
desc = description
websiteUrl = 'https://github.com/http4k/http4k'
issueTrackerUrl = 'https://github.com/http4k/http4k/issues'
vcsUrl = 'https://github.com/http4k/http4k.git'
licenses = ['Apache-2.0']
labels = []
publicDownloadNumbers = true
version {
name = project.version
vcsTag = project.version
gpg {
sign = true
}
mavenCentralSync {
sync = false
user = System.getenv('SONATYPE_USER')
password = System.getenv('SONATYPE_KEY')
close = '1'
}
}
}
}
jacocoTestReport {
reports {
xml.enabled = true
}
}
}
coveralls {
sourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs).files.absolutePath
jacocoReportPath = file("${buildDir}/reports/jacoco/test/jacocoRootReport.xml")
}
task jacocoRootReport(type: org.gradle.testing.jacoco.tasks.JacocoReport) {
dependsOn = subprojects.test
sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs)
classDirectories = files(subprojects.sourceSets.main.output)
executionData = files(subprojects.jacocoTestReport.executionData)
reports {
html.enabled = true
xml.enabled = true
csv.enabled = false
xml.destination = file("${buildDir}/reports/jacoco/test/jacocoRootReport.xml")
}
}
dependencies {
provided Libs.kotlin_stdlib_jdk8
provided project(":http4k-core")
provided project(":http4k-aws")
provided project(":http4k-client-apache")
provided project(":http4k-client-apache-async")
provided project(":http4k-client-jetty")
provided project(":http4k-client-okhttp")
provided project(":http4k-client-websocket")
provided project(":http4k-cloudnative")
provided project(":http4k-contract")
provided project(":http4k-format-argo")
provided project(":http4k-format-gson")
provided project(":http4k-format-jackson")
provided project(":http4k-format-jackson-xml")
provided project(":http4k-format-moshi")
provided project(":http4k-format-xml")
provided project(":http4k-incubator")
provided project(":http4k-jsonrpc")
provided project(":http4k-metrics-micrometer")
provided project(":http4k-multipart")
provided project(":http4k-resilience4j")
provided project(":http4k-security-oauth")
provided project(":http4k-server-apache")
provided project(":http4k-server-jetty")
provided project(":http4k-server-ktorcio")
provided project(":http4k-server-netty")
provided project(":http4k-server-undertow")
provided project(":http4k-serverless-lambda")
provided project(":http4k-template-dust")
provided project(":http4k-template-freemarker")
provided project(":http4k-template-handlebars")
provided project(":http4k-template-pebble")
provided project(":http4k-template-thymeleaf")
provided project(":http4k-template-dust")
provided project(":http4k-template-jade4j")
provided project(":http4k-testing-approval")
provided project(":http4k-testing-chaos")
provided project(":http4k-testing-hamkrest")
provided project(":http4k-testing-webdriver")
testCompile Config.TestDependencies
}
sourceSets {
test {
kotlin {
srcDirs 'src/test/kotlin'
srcDirs 'src/docs'
}
resources {
srcDir 'src/docs'
}
}
}
task dokka(type: org.jetbrains.dokka.gradle.DokkaTask, overwrite: true) {
includes = ['src/packages.md']
moduleName = "$rootProject.name"
outputDirectory = "$buildDir/ddoc"
outputFormat = "gfm"
processConfigurations = []
jdkVersion = 9
externalDocumentationLink {
// No version, apache does not seem to keep old versions of javadoc around
url = new URL("https://hc.apache.org/httpcomponents-asyncclient-ga/httpasyncclient/apidocs/")
}
externalDocumentationLink {
// No version, apache does not seem to keep old versions of javadoc around
url = new URL("https://hc.apache.org/httpcomponents-client-ga/httpclient/apidocs/")
}
externalDocumentationLink {
// No version, apache does not seem to keep old versions of javadoc around
url = new URL("https://hc.apache.org/httpcomponents-core-ga/httpcore/apidocs/")
}
externalDocumentationLink {
def version = Config.okhttp_major
url = new URL("https://square.github.io/okhttp/${version}.x/okhttp/")
}
// externalDocumentationLink {
// // No version, argo does not seem to keep old versions of javadoc around
// url = new URL("http://argo.sourceforge.net/javadoc/")
// }
// externalDocumentationLink {
// def version = Config.jackson_major_minor
// url = new URL("https://fasterxml.github.io/jackson-dataformat-xml/javadoc/$version/")
// }
externalDocumentationLink {
def version = Config.jackson_major_minor
url = new URL("https://fasterxml.github.io/jackson-databind/javadoc/$version/")
}
externalDocumentationLink {
def version = Config.moshi_major
url = new URL("http://square.github.io/moshi/${version}.x/moshi/")
}
externalDocumentationLink {
def version = Config.io_undertow_major_minor
url = new URL("http://undertow.io/javadoc/${version}.x/")
}
externalDocumentationLink {
def version = Config.netty_codec_http2_major_minor
url = new URL("https://netty.io/$version/api/")
}
externalDocumentationLink {
// No version, this was the latest linkable javadoc I could find for javax servlet api
url = new URL("https://javaee.github.io/javaee-spec/javadocs/")
}
externalDocumentationLink {
def version = Versions.org_junit_jupiter
url = new URL("https://junit.org/junit5/docs/$version/api/")
}
externalDocumentationLink {
// No version, selenium does not seem to keep old versions of javadoc around
url = new URL("https://seleniumhq.github.io/selenium/docs/api/java/")
}
externalDocumentationLink {
// No version, jsoup does not seem to keep old versions of javadoc around
url = new URL("https://jsoup.org/apidocs/")
}
sourceDirs = files(subprojects.collect {
p ->
def path = new File(p.projectDir, "/src/main/kotlin")
def relativePath = rootDir.toPath().relativize(path.toPath()).toString()
linkMapping {
dir = path.toString().replace(File.separator, "/")
url = "https://github.com/http4k/http4k/blob/master/$relativePath"
suffix = "#L"
}
return path
})
}
buildSrcVersions {
indent = " "
}
// To update Gradle, run `$ ./gradlew :buildSrcVersions && ./gradlew wrapper`
wrapper {
gradleVersion = Versions.gradleLatestVersion
distributionType = Wrapper.DistributionType.ALL
}