-
Notifications
You must be signed in to change notification settings - Fork 7
/
build.gradle.kts
151 lines (136 loc) · 4.77 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
import com.jfrog.bintray.gradle.BintrayExtension
import nu.studer.gradle.credentials.domain.CredentialsContainer
plugins {
id("org.jetbrains.kotlin.jvm") version "1.6.0"
id("maven-publish")
id("io.gitlab.arturbosch.detekt") version "1.17.1"
jacoco
`java-library`
signing
`maven-publish`
id("nu.studer.credentials") version "1.0.7"
id("com.jfrog.bintray") version "1.8.5"
id("com.github.ben-manes.versions") version "0.38.0"
}
group = "com.marcinziolo"
version = "2.1.1"
java.sourceCompatibility = JavaVersion.VERSION_1_8
repositories {
mavenCentral()
}
detekt {
config = files("$rootDir/detekt.yml")
reports {
html.enabled = true
}
}
dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
api("org.wiremock:wiremock-standalone:3.2.0")
testImplementation("io.rest-assured:rest-assured:5.1.1")
testImplementation("io.rest-assured:json-path:5.1.1")
testImplementation("io.rest-assured:kotlin-extensions:5.1.1")
testImplementation("org.junit.jupiter:junit-jupiter:5.6.2")
testImplementation("io.mockk:mockk:1.12.4")
}
tasks.test {
useJUnitPlatform()
maxParallelForks = (Runtime.getRuntime().availableProcessors() / 2).takeIf { it > 0 } ?: 1
finalizedBy(tasks.jacocoTestReport)
}
tasks.jacocoTestReport {
dependsOn(tasks.test) // tests are required to run before generating the report
reports {
html.isEnabled = true
xml.isEnabled = true
csv.isEnabled = false
}
}
java {
withJavadocJar()
withSourcesJar()
}
jacoco {
toolVersion = "0.8.7"
}
val credentials: CredentialsContainer by project.extra
val ossrhUser = (System.getProperty("ossrhUser") ?: credentials.getProperty("ossrhUser") ?: "-") as String
val ossrhPassword = (System.getProperty("ossrhPassword") ?: credentials.getProperty("ossrhPassword") ?: "-") as String
val bintrayKey = (System.getProperty("bintrayKey") ?: credentials.getProperty("bintrayKey") ?: "-") as String
publishing {
publications {
create<MavenPublication>("mavenJava") {
artifactId = "kotlin-wiremock"
from(components["java"])
versionMapping {
usage("java-api") {
fromResolutionOf("runtimeClasspath")
}
usage("java-runtime") {
fromResolutionResult()
}
}
pom {
name.set("Kotlin WireMock")
description.set("Handy Kotlin DSL for WireMock stubbing")
url.set("https://github.com/marcinziolo/kotlin-wiremock")
licenses {
license {
name.set("The Apache License, Version 2.0")
url.set("http://www.apache.org/licenses/LICENSE-2.0.txt")
}
}
developers {
developer {
id.set("marcinziolo")
name.set("Marcin Zioło")
email.set("[email protected]")
}
}
scm {
connection.set("scm:git:git://github.com:marcinziolo/kotlin-wiremock.git")
developerConnection.set("scm:git:ssh://github.com:marcinziolo/kotlin-wiremock.git")
url.set("https://github.com/marcinziolo/kotlin-wiremock")
}
}
}
}
repositories {
maven {
// change URLs to point to your repos, e.g. http://my.org/repo
val releasesRepoUrl = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2")
val snapshotsRepoUrl = uri("https://oss.sonatype.org/content/repositories/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
credentials {
username = ossrhUser
password = ossrhPassword
}
}
}
}
bintray {
user = ossrhUser
key = bintrayKey
publish = true
setPublications("mavenJava")
pkg(delegateClosureOf<BintrayExtension.PackageConfig> {
repo = "maven"
name = "kotlin-wiremock"
websiteUrl = "https://github.com/marcinziolo/kotlin-wiremock"
githubRepo = "marcinziolo/kotlin-wiremock"
vcsUrl = "https://github.com/marcinziolo/kotlin-wiremock"
description = "Handy Kotlin DSL for WireMock stubbing"
setLabels("kotlin")
setLicenses("Apache-2.0")
desc = description
})
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}
signing {
sign(publishing.publications["mavenJava"])
}