-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
88 lines (75 loc) · 1.81 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
import org.jetbrains.dokka.gradle.DokkaTask
plugins {
with(libs.plugins) {
alias(kotlin)
alias(dokka)
alias(spotless)
}
`maven-publish`
}
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://repo.md5lukas.de/public/")
}
dependencies {
implementation(libs.paper)
implementation(libs.stdlib)
}
kotlin {
jvmToolchain(libs.versions.jvmToolchain.get().toInt())
}
tasks {
compileKotlin {
compilerOptions.freeCompilerArgs.addAll(
"-Xjvm-default=all",
)
}
}
spotless { kotlin { ktfmt() } }
val sourcesJar by tasks.creating(Jar::class) {
archiveClassifier.set("sources")
from(sourceSets.main.get().allSource)
}
val dokkaHtml by tasks.getting(DokkaTask::class) {
dokkaSourceSets {
configureEach {
includes.from("README.md")
val version = libs.versions.paper.get().substringBefore("-")
externalDocumentationLink(
"https://jd.papermc.io/paper/$version/",
"https://jd.papermc.io/paper/$version/element-list")
externalDocumentationLink(
"https://jd.advntr.dev/api/4.17.0/",
"https://jd.advntr.dev/api/4.17.0/element-list")
}
}
}
val javadocJar by tasks.creating(Jar::class) {
dependsOn(tasks.dokkaHtml)
archiveClassifier.set("javadoc")
from(tasks.dokkaHtml)
}
publishing {
repositories {
maven {
name = "md5lukasReposilite"
url = uri("https://repo.md5lukas.de/${if (version.toString().endsWith("-SNAPSHOT")) {
"snapshots"
} else {
"releases"
}}")
credentials(PasswordCredentials::class)
authentication {
create<BasicAuthentication>("basic")
}
}
}
publications {
create<MavenPublication>("maven") {
from(components["kotlin"])
artifact(sourcesJar)
artifact(javadocJar)
}
}
}