-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
105 lines (85 loc) · 2.41 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
import java.net.URI
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
id("java")
id("io.github.goooler.shadow") version "8.1.8"
id("maven-publish")
id("xyz.jpenilla.run-paper") version "2.3.1"
}
group = "de.varilx"
version = project.property("project_version") as String
repositories {
mavenCentral()
// mavenLocal()
maven("https://repo.papermc.io/repository/maven-public/")
maven("https://reposilite.varilx.de/Varilx")
}
dependencies {
// PaperMC API
compileOnly("io.papermc.paper:paper-api:${project.property("paper_version")}")
// Lombok
implementation("org.projectlombok:lombok:1.18.36")
annotationProcessor("org.projectlombok:lombok:1.18.36")
compileOnly("org.projectlombok:lombok:1.18.36")
// JetBrains Annotations
implementation("org.jetbrains:annotations:26.0.1")
// Base API
implementation("de.varilx:base-api:1.1.0")
// JDA
implementation("net.dv8tion:JDA:5.2.2")
// LuckPerms
compileOnly("net.luckperms:api:5.4")
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
tasks.named<ShadowJar>("shadowJar") {
archiveClassifier.set("")
}
tasks.register<Jar>("sourcesJar") {
archiveClassifier.set("sources")
from(sourceSets.main.get().allJava)
}
publishing {
repositories {
maven {
name = "Reposilite"
url = URI("https://reposilite.varilx.de/Varilx")
credentials {
username = "Dario"
password = System.getenv("REPOSILITE_TOKEN")
}
}
}
publications {
register<MavenPublication>("gpr") {
groupId = "$group"
version = version
artifact(tasks.named<ShadowJar>("shadowJar").get())
artifact(tasks.named<Jar>("sourcesJar").get())
}
}
}
tasks.named("publishGprPublicationToReposiliteRepository") {
dependsOn(tasks.named("jar"))
}
tasks {
runServer {
minecraftVersion("1.21.4")
downloadPlugins {
url("https://download.luckperms.net/1568/bukkit/loader/LuckPerms-Bukkit-5.4.151.jar")
}
}
}