-
Notifications
You must be signed in to change notification settings - Fork 419
/
build.gradle.kts
132 lines (112 loc) · 3.14 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
import com.github.jengelman.gradle.plugins.shadow.transformers.Log4j2PluginsCacheFileTransformer
import org.gradle.internal.impldep.org.junit.experimental.categories.Categories.CategoryFilter.exclude
@Suppress("DSL_SCOPE_VIOLATION") // https://youtrack.jetbrains.com/issue/IDEA-262280
plugins {
id("java-library")
id("maven-publish")
id("application")
alias(libs.plugins.shadow)
alias(libs.plugins.git)
}
group = "cn.nukkit"
version = "1.0-SNAPSHOT"
description = "Nuclear powered server software for Minecraft Bedrock Edition"
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.opencollab.dev/maven-releases")
maven("https://repo.opencollab.dev/maven-snapshots")
}
dependencies {
api(libs.network)
api(libs.epoll)
api(libs.fastutil)
api(libs.bundles.fastutilmaps)
api(libs.guava)
api(libs.gson)
api(libs.snakeyaml)
api(libs.leveldb)
api(libs.leveldbjni) {
exclude(group = "com.google.guava", module = "guava")
exclude(group = "io.netty", module = "netty-buffer")
exclude(group = "org.iq80.snappy", module = "snappy")
exclude(group = "org.iq80.leveldb", module = "leveldb")
}
api(libs.snappy)
api(libs.jwt)
api(libs.bundles.terminal)
api(libs.bundles.log4j)
api(libs.jopt.simple)
api(libs.blockstateupdater)
api(libs.lmbda) {
exclude(group = "org.checkerframework", module = "checker-qual")
}
api(libs.noise) {
exclude(group = "net.daporkchop.lib", module = "common")
exclude(group = "net.daporkchop.lib", module = "math")
}
compileOnly(libs.lombok)
annotationProcessor(libs.lombok)
testImplementation(libs.bundles.junit)
testCompileOnly(libs.lombok)
testAnnotationProcessor(libs.lombok)
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(8))
}
}
application {
mainClass.set("cn.nukkit.Nukkit")
}
gitProperties {
dateFormat = "dd.MM.yyyy '@' HH:mm:ss z"
failOnNoGitDirectory = false
}
publishing {
repositories {
maven {
name = "opencollab"
url = uri("https://repo.opencollab.dev/maven-snapshots")
credentials {
username = System.getenv("DEPLOY_USERNAME")
password = System.getenv("DEPLOY_PASSWORD")
}
}
}
publications {
create<MavenPublication>("nukkit") {
from(components["java"])
}
}
}
tasks {
compileJava {
options.encoding = "UTF-8"
}
test {
useJUnitPlatform()
}
jar {
archiveClassifier.set("dev")
}
shadowJar {
manifest.attributes["Multi-Release"] = "true"
transform(Log4j2PluginsCacheFileTransformer())
// Backwards compatible jar directory
destinationDirectory.set(file("$projectDir/target"))
archiveClassifier.set("")
exclude("javax/annotation/**")
}
runShadow {
val dir = File(projectDir, "run")
if (!dir.exists()) {
dir.mkdirs()
}
standardInput = System.`in`
workingDir = dir
}
javadoc {
options.encoding = "UTF-8"
}
}