-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathbuild.gradle.kts
66 lines (56 loc) · 1.53 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
plugins {
java
kotlin("jvm") version "1.6.10"
`maven-publish`
id("org.jetbrains.dokka") version "1.6.10"
}
group = "io.github.cosinekitty"
version = "2.1.19"
repositories {
mavenCentral()
}
dependencies {
dokkaHtmlPlugin("org.jetbrains.dokka:kotlin-as-java-plugin:1.6.10")
val junit5Version = "5.8.2"
testImplementation("org.junit.jupiter:junit-jupiter-api:$junit5Version")
testImplementation("org.junit.jupiter:junit-jupiter-params:$junit5Version")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junit5Version")
testImplementation(kotlin("test"))
}
tasks.test {
useJUnitPlatform()
}
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_11
}
val sourceJar by tasks.creating(Jar::class) {
dependsOn(tasks["classes"])
archiveClassifier.set("sources")
from(sourceSets["main"].allSource)
}
task("fatJar", type = Jar::class) {
from(configurations.runtimeClasspath.get().map(::zipTree))
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
with(tasks.jar.get())
}
publishing {
publications {
register("mavenJava", MavenPublication::class) {
from(components["kotlin"])
artifact(sourceJar)
}
}
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
kotlinOptions {
allWarningsAsErrors = true
}
}
tasks.dokkaGfm.configure {
dokkaSourceSets {
named("main") {
includeNonPublic.set(false)
reportUndocumented.set(true)
}
}
}