-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
92 lines (82 loc) · 2.69 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
`java-library`
kotlin("jvm") version "1.6.0"
kotlin("plugin.serialization") version "1.6.0"
`maven-publish`
signing
}
group = "io.github.reugn"
repositories {
mavenCentral()
}
java {
withJavadocJar()
withSourcesJar()
}
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-runtime:1.0-M1-1.4.0-rc")
testImplementation("org.junit.jupiter:junit-jupiter:5.8.2")
}
tasks.withType<KotlinCompile> {
kotlinOptions.jvmTarget = "1.8"
}
tasks.test {
useJUnitPlatform()
}
publishing {
publications {
create<MavenPublication>("mavenCentral") {
groupId = project.group.toString()
artifactId = project.name
version = project.version.toString()
from(components["java"])
pom {
name.set(project.name)
description.set("An exponential backoff library for Kotlin.")
url.set("https://github.com/reugn/kotlin-backoff")
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("reugn")
name.set("reugn")
email.set("[email protected]")
url.set("https://github.com/reugn")
}
}
scm {
connection.set("scm:git:git://github.com/reugn/kotlin-backoff.git")
developerConnection.set("scm:git:ssh://github.com/reugn/kotlin-backoff.git")
url.set("https://github.com/reugn/kotlin-backoff")
}
}
}
}
repositories {
maven {
name = "mavenCentral"
credentials(PasswordCredentials::class)
val nexus = "https://s01.oss.sonatype.org/"
val releasesRepoUrl = uri(nexus + "service/local/staging/deploy/maven2")
val snapshotsRepoUrl = uri(nexus + "content/repositories/snapshots")
url = if (version.toString().endsWith("SNAPSHOT")) snapshotsRepoUrl else releasesRepoUrl
}
}
}
signing {
sign(publishing.publications["mavenCentral"])
useGpgCmd()
sign(configurations.archives.get())
}
tasks.javadoc {
if (JavaVersion.current().isJava9Compatible) {
(options as StandardJavadocDocletOptions).addBooleanOption("html5", true)
}
}