-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
145 lines (117 loc) · 3.99 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
plugins {
id("java")
id("maven-publish")
// use for Java 21 (see: https://github.com/johnrengelman/shadow/pull/876)
// id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.github.goooler.shadow") version "8.1.8"
id("io.papermc.paperweight.userdev") version "1.7.1" // Check for new versions at https://plugins.gradle.org/plugin/io.papermc.paperweight.userdev
id("xyz.jpenilla.run-paper") version "2.3.0" // Adds runServer and runMojangMappedServer tasks for testing
}
group = "net.synchthia"
version = "1.21-SNAPSHOT"
description = "Systera"
java {
toolchain.languageVersion.set(JavaLanguageVersion.of(21))
}
repositories {
mavenLocal()
mavenCentral()
maven {
name = "spigotmc-repo"
url = uri("https://hub.spigotmc.org/nexus/content/groups/public/")
}
maven {
name = "sonatype-oss-repo"
url = uri("https://oss.sonatype.org/content/groups/public/")
}
maven {
name = "papermc"
url = uri("https://repo.papermc.io/repository/maven-public/")
}
maven {
name = "codemc"
url = uri("https://repo.codemc.org/repository/maven-public/")
}
maven {
name = "dmulloy2"
url = uri("https://repo.dmulloy2.net/repository/public/")
}
maven {
name = "startail-public"
url = uri("https://maven.pkg.github.com/synchthia/pkg-startail-public")
}
}
dependencies {
implementation("net.synchthia:systera-api:1.1-SNAPSHOT")
// Paper
paperweight.paperDevBundle("1.21-R0.1-SNAPSHOT")
// Adventure
implementation("net.kyori:adventure-api:4.17.0")
// Cloud
implementation("org.incendo:cloud-core:2.0.0-rc.2")
implementation("org.incendo:cloud-annotations:2.0.0-rc.2")
implementation("org.incendo:cloud-paper:2.0.0-beta.8")
implementation("org.incendo:cloud-minecraft-extras:2.0.0-beta.8")
// Protocol Buffers
implementation("com.google.protobuf:protobuf-java:3.21.9")
implementation("com.google.protobuf:protobuf-java-util:3.21.9")
// ProtocolLib
compileOnly("com.comphenix.protocol:ProtocolLib:5.0.0")
// gRPC
implementation("io.grpc:grpc-netty:1.64.0")
implementation("io.grpc:grpc-protobuf:1.64.0")
implementation("io.grpc:grpc-stub:1.64.0")
implementation("javax.annotation:javax.annotation-api:1.3.2")
// Redis
implementation("redis.clients:jedis:5.1.3")
// Utils
implementation("joda-time:joda-time:2.9.7")
implementation("commons-configuration:commons-configuration:1.10")
// gson
compileOnly("com.google.code.gson:gson:2.11.0")
// lombok
compileOnly("org.projectlombok:lombok:1.18.32")
annotationProcessor("org.projectlombok:lombok:1.18.32")
}
tasks {
compileJava {
// Set the release flag. This configures what version bytecode the compiler will emit, as well as what JDK APIs are usable.
// See https://openjdk.java.net/jeps/247 for more information.
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
shadowJar {
mergeServiceFiles()
fun reloc(pkg: String) = relocate(pkg, "net.synchthia.systera.libs.$pkg")
reloc("redis.clients")
reloc("org.apache.commons")
reloc("com.google.protobuf")
reloc("org.apache.commons.pool2")
}
reobfJar {
outputJar.set(layout.buildDirectory.file("libs/${project.name}.jar"))
}
assemble {
dependsOn(reobfJar)
}
processResources {
expand(
mapOf(
"pluginName" to "Systera",
"pluginVersion" to project.version,
"description" to project.description,
"authors" to "SYNCHTHIA",
"website" to "https://synchthia.net",
"bukkitApiVersion" to "1.20",
"bukkitPluginMain" to "net.synchthia.systera.SysteraPlugin"
)
)
}
}
publishing {
publications {
create<MavenPublication>("maven") {
artifact(tasks.reobfJar)
}
}
}