-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
126 lines (100 loc) · 3.27 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
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "1.9.0"
kotlin("plugin.serialization") version "1.9.0"
id("org.jetbrains.dokka") version "1.8.10"
`maven-publish`
}
repositories {
mavenLocal()
mavenCentral()
gradlePluginPortal()
maven("https://maven.pkg.jetbrains.space/public/p/compose/dev")
maven("https://maven.pkg.jetbrains.space/public/p/ktor/eap")
maven("https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev")
}
dependencies {
val ktorVersion = "2.3.3"
implementation("ch.qos.logback:logback-classic:1.4.8")
implementation("io.github.microutils:kotlin-logging:3.0.5")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:1.5.1")
implementation("io.ktor:ktor-client-core:$ktorVersion")
implementation("io.ktor:ktor-client-cio:$ktorVersion")
implementation("io.ktor:ktor-client-logging:$ktorVersion")
testImplementation(kotlin("test"))
}
val dokkaOutputDir = "${rootProject.projectDir}/dokka"
tasks {
test {
useJUnitPlatform()
}
withType<KotlinCompile> {
kotlinOptions.jvmTarget = "17"
}
clean {
delete(dokkaOutputDir)
}
val deleteDokkaOutputDir by register<Delete>("deleteDokkaOutputDirectory") {
group = "documentation"
delete(dokkaOutputDir)
}
dokkaHtml.configure {
dependsOn(deleteDokkaOutputDir)
outputDirectory.set(file(dokkaOutputDir))
}
}
val sourcesJar by tasks.registering(Jar::class) {
group = "build"
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val javadocJar = tasks.register<Jar>("javadocJar") {
group = "documentation"
dependsOn(tasks.dokkaHtml)
archiveClassifier.set("javadoc")
from(dokkaOutputDir)
}
publishing {
val projectName = project.name
publications {
val projectPath = "Quentixx/$projectName"
val projectGitUrl = "https://github.com/$projectPath"
create<MavenPublication>(projectName) {
from(components["kotlin"])
artifact(sourcesJar.get())
artifact(javadocJar.get())
pom {
name.set(projectName)
description.set(project.description)
url.set(projectGitUrl)
issueManagement {
system.set("GitHub")
url.set("$projectGitUrl/issues")
}
ciManagement {
system.set("GitHub Actions")
}
licenses {
license {
name.set("MIT")
url.set("https://mit-license.org")
}
}
developers {
developer {
name.set("Quentixx")
url.set("https://github.com/Quentixx")
}
}
scm {
connection.set("scm:git:$projectGitUrl.git")
developerConnection.set("scm:git:[email protected]:$projectPath.git")
url.set(projectGitUrl)
}
distributionManagement {
downloadUrl.set("$projectGitUrl/releases")
}
}
}
}
}