forked from http4k/http4k
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle
261 lines (226 loc) · 8.39 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
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
}
}
plugins {
id "com.jfrog.bintray" version "1.8.4"
id 'net.saliman.cobertura' version '2.5.4'
id 'nebula.provided-base' version '3.0.3'
id 'com.github.kt3k.coveralls' version '2.8.2'
id 'jmfayard.github.io.gradle-kotlin-dsl-libs' version "0.2.6"
}
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 = ['hml', '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', '[email protected]')
.parent().parent()
.appendNode('developer').appendNode('name', 'David Denton').parent().appendNode('email', '[email protected]')
asNode().appendNode('scm').
appendNode('url', '[email protected]:http4k/' + archivesBaseName + '.git').parent().
appendNode('connection', 'scm:git:[email protected]:http4k/' + archivesBaseName + '.git').parent().
appendNode('developerConnection', 'scm:git:[email protected]: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-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 = []
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
})
}