-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
109 lines (96 loc) · 2.48 KB
/
build.gradle.kts
File metadata and controls
109 lines (96 loc) · 2.48 KB
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
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.3.10"
id("xyz.jpenilla.run-paper") version "2.3.1"
id("com.gradleup.shadow") version "9.0.0-beta4"
id("com.google.protobuf") version "0.9.5"
}
group = "space.chunks"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
maven {
name = "papermc"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
}
dependencies {
testImplementation(kotlin("test"))
implementation(kotlin("stdlib"))
implementation("io.grpc:grpc-kotlin-stub:1.5.0")
implementation("io.grpc:grpc-protobuf:1.61.0")
implementation("io.grpc:grpc-netty:1.61.0")
implementation("aws.sdk.kotlin:s3:1.6.26")
api("com.google.protobuf:protobuf-kotlin:3.25.8")
compileOnly("io.papermc.paper:paper-api:1.21.11-R0.1-SNAPSHOT")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
}
tasks.test {
useJUnitPlatform()
}
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
kotlin {
jvmToolchain(21)
}
tasks.withType<KotlinCompile> {
compilerOptions.jvmTarget.set(JvmTarget.JVM_21)
}
tasks.named("shadowJar", ShadowJar::class) {
mergeServiceFiles()
// ai told me to do this, because of class loader problems with paper
relocate(
"com.google.protobuf",
"space.chunks.shadow.protobuf"
)
archiveFileName.set("${project.name}.jar")
}
tasks {
runServer {
downloadPlugins {
modrinth("ViaVersion", "5.7.0")
}
minecraftVersion("1.21.11")
}
}
sourceSets {
main {
kotlin {
srcDirs(
"build/generated/source/proto/main/kotlin",
)
}
java {
srcDirs(
"build/generated/source/proto/main/java",
)
}
}
}
protobuf {
protoc {
artifact = "com.google.protobuf:protoc:3.25.8"
}
plugins {
create("grpc") {
artifact = "io.grpc:protoc-gen-grpc-java:1.61.0"
}
create("grpckt") {
artifact = "io.grpc:protoc-gen-grpc-kotlin:1.5.0:jdk8@jar"
}
}
generateProtoTasks {
all().forEach {
it.plugins {
create("grpc")
create("grpckt")
}
it.builtins {
create("kotlin")
}
}
}
}