forked from Minestom/Minestom
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
88 lines (75 loc) · 2.11 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
plugins {
`java-library`
`maven-publish`
}
repositories {
mavenCentral()
}
group = "net.minestom"
version = rootProject.version
description = "Minestom Felix edition"
configurations.all {
// We only use Jetbrains Annotations
exclude("org.checkerframework", "checker-qual")
}
java {
withSourcesJar()
withJavadocJar()
toolchain.languageVersion = JavaLanguageVersion.of(21)
}
sourceSets.main.get().java.srcDir(file("src/main/java"))
dependencies {
// Core dependencies
api(libs.bundles.logging)
api(libs.jetbrainsAnnotations)
api(libs.bundles.adventure)
implementation(libs.minestomData)
// Performance/data structures
implementation(libs.caffeine)
api(libs.fastutil)
implementation(libs.bundles.flare)
api(libs.gson)
implementation(libs.jcTools)
// Testing
testImplementation(libs.bundles.junit)
api(libs.junit.api)
api(libs.junit.params)
api(libs.junit.suite.api)
runtimeOnly(libs.junit.engine)
runtimeOnly(libs.junit.suite.engine)
}
tasks {
jar {
manifest {
attributes("Automatic-Module-Name" to "net.minestom.server")
}
}
withType<Javadoc> {
(options as? StandardJavadocDocletOptions)?.apply {
encoding = "UTF-8"
// Custom options
addBooleanOption("html5", true)
addStringOption("-release", "21")
// Links to external javadocs
links("https://docs.oracle.com/en/java/javase/21/docs/api/")
links("https://jd.advntr.dev/api/${libs.versions.adventure.get()}/")
}
}
withType<JavaCompile> {
options.encoding = "UTF-8"
}
withType<Test> {
useJUnitPlatform()
// Viewable packets make tracking harder. Could be re-enabled later.
jvmArgs("-Dminestom.viewable-packet=false")
jvmArgs("-Dminestom.inside-test=true")
minHeapSize = "512m"
maxHeapSize = "2048m"
}
withType<Zip> {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
}
publishing.publications.create<MavenPublication>("maven") {
from(project.components["java"])
}