-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
108 lines (92 loc) · 2.94 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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
/*
* This file was generated by the Gradle 'init' task.
*
* This is a general purpose Gradle build.
* Learn how to create Gradle builds at https://guides.gradle.org/creating-new-gradle-builds/
*/
group = "CHANGEME"
version = "0.0.1"
val applicationClassName = "CHANGEME"
val kotlinVersion = "1.9.24"
val ktorVersion = "1.6.8"
val junitVersion = "5.10.2"
plugins {
kotlin("jvm") version "1.7.22"
id("org.jetbrains.dokka") version "1.9.20"
java
application
id("com.github.johnrengelman.shadow") version "7.1.2"
`maven-publish`
}
repositories {
mavenLocal()
mavenCentral()
maven("https://kotlin.bintray.com/ktor")
}
dependencies {
implementation("com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.17.1")
implementation("io.github.microutils:kotlin-logging:3.0.5")
implementation("io.ktor:ktor-auth:$ktorVersion")
implementation("io.ktor:ktor-auth-jwt:$ktorVersion")
implementation("io.ktor:ktor-jackson:$ktorVersion")
implementation("io.ktor:ktor-metrics:$ktorVersion")
implementation("io.ktor:ktor-server-netty:$ktorVersion")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.8.1")
implementation("org.slf4j:slf4j-simple:2.0.13")
implementation(kotlin("reflect", kotlinVersion))
implementation(kotlin("stdlib-jdk8", kotlinVersion))
testImplementation("com.natpryce:hamkrest:1.8.0.1")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
testRuntimeOnly("org.junit.vintage:junit-vintage-engine:$junitVersion")
testImplementation(kotlin("test", kotlinVersion))
testImplementation(kotlin("test-junit", kotlinVersion))
}
application {
mainClassName = applicationClassName
}
val shadowJar by tasks.getting(ShadowJar::class) {
manifest.attributes["Main-Class"] = applicationClassName
}
val mainSrcSet = sourceSets["main"]
val sourceJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin sources"
archiveClassifier.set("sources")
from(mainSrcSet.allSource)
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.17"
}
}
val dokka by tasks.creating(org.jetbrains.dokka.gradle.DokkaTask::class)
val dokkaJar by tasks.creating(Jar::class) {
group = JavaBasePlugin.DOCUMENTATION_GROUP
description = "Assembles Kotlin docs with Dokka"
archiveClassifier.set("javadoc")
from(dokka)
}
tasks.withType<Test> {
useJUnitPlatform()
testLogging {
events("passed", "skipped", "failed")
}
}
publishing {
publications {
create("default", MavenPublication::class.java) {
from(components["java"])
artifact(dokkaJar)
artifact(sourceJar)
}
}
repositories {
maven {
url = uri("$buildDir/repository")
}
}
}