-
Notifications
You must be signed in to change notification settings - Fork 4
/
build.gradle.kts
executable file
·124 lines (104 loc) · 3.5 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
import com.vanniktech.maven.publish.JavadocJar
import com.vanniktech.maven.publish.KotlinJvm
import com.vanniktech.maven.publish.SonatypeHost
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.0.21"
kotlin("plugin.serialization") version "2.0.21"
id("org.jlleitschuh.gradle.ktlint") version "11.0.0"
id("org.jetbrains.dokka") version "1.9.20"
id("com.vanniktech.maven.publish") version "0.28.0"
}
group = "ee.bjarn"
version = "0.1.4"
repositories {
mavenCentral()
}
dependencies {
implementation(platform("io.ktor:ktor-bom:3.0.0"))
implementation("io.ktor", "ktor-client-okhttp")
implementation("io.ktor", "ktor-serialization-kotlinx-json")
implementation("io.ktor", "ktor-client-content-negotiation")
implementation("org.jetbrains.kotlinx", "kotlinx-serialization-json", "1.7.3")
implementation("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.9.0")
implementation("io.github.microutils", "kotlin-logging-jvm", "3.0.5")
implementation("org.slf4j", "slf4j-simple", "2.0.13")
}
tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_11)
freeCompilerArgs.add("-opt-in=kotlin.RequiresOptIn")
}
}
dokkaHtml {
moduleName.set("ktify")
dokkaSourceSets {
configureEach {
jdkVersion.set(11)
platform.set(org.jetbrains.dokka.Platform.jvm)
perPackageOption {
matchingRegex.set(".*.model.*")
suppress.set(true)
}
sourceLink {
localDirectory.set(file("src/main/kotlin"))
skipEmptyPackages.set(true)
remoteUrl.set(uri("https://github.com/warriorzz/ktify/tree/main/src/main/kotlin").toURL())
remoteLineSuffix.set("#L")
}
}
}
}
}
mavenPublishing {
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
signAllPublications()
coordinates(project.group.toString(), project.name, project.version.toString())
configure(KotlinJvm(
javadocJar = JavadocJar.Dokka("dokkaHtml"),
sourcesJar = true
))
pom {
name.set(project.name)
description.set("A coroutine based wrapper around the Spotify Web API, written in Kotlin.")
url.set("https://github.com/warriorzz/ktify")
inceptionYear.set("2021")
licenses {
license {
name.set("MIT License")
url.set("https://github.com/warriorzz/ktify/blob/main/LICENSE")
}
}
issueManagement {
system.set("GitHub")
url.set("https://github.com/warriorzz/ktify/issues")
}
scm {
connection.set("https://github.com/warriorzz/ktify.git")
url.set("https://github.com/warriorzz/ktify")
}
developers {
developer {
name.set("Bjarne Eberhardt")
email.set("[email protected]")
url.set("https://bjarn.ee")
timezone.set("Europe/Berlin")
}
}
}
}
ktlint {
verbose.set(true)
filter {
disabledRules.add("no-wildcard-imports")
disabledRules.add("no-multi-spaces")
disabledRules.add("indent")
exclude("**/build/**")
}
}
java {
// This avoids a Gradle warning
sourceCompatibility = JavaVersion.VERSION_11
}