-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
80 lines (70 loc) · 2.26 KB
/
build.gradle.kts
File metadata and controls
80 lines (70 loc) · 2.26 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
plugins {
kotlin("jvm") version "1.8.21"
id("com.github.johnrengelman.shadow") version "7.1.2"
}
group = "com.github.postyizhan"
version = "1.4"
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/") {
name = "spigotmc-repo"
}
maven("https://oss.sonatype.org/content/groups/public/") {
name = "sonatype"
}
maven("https://repo.dmulloy2.net/repository/public/") {
name = "dmulloy2-repo"
}
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/") {
name = "placeholderapi-repo"
}
maven("https://repo.codemc.io/repository/maven-releases/") {
name = "codemc-releases"
}
maven("https://repo.codemc.io/repository/maven-snapshots/") {
name = "codemc-snapshots"
}
maven("https://jitpack.io") {
name = "jitpack"
}
}
dependencies {
compileOnly("org.spigotmc:spigot-api:1.13-R0.1-SNAPSHOT")
compileOnly("com.comphenix.protocol:ProtocolLib:4.7.0")
compileOnly("me.clip:placeholderapi:2.11.6")
compileOnly("com.github.retrooper:packetevents:v2.8.0") {
exclude(group = "com.github.retrooper.packetevents", module = "packetevents-fabric")
}
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
// Adventure API 依赖
implementation("net.kyori:adventure-api:4.20.0")
implementation("net.kyori:adventure-platform-bukkit:4.3.4")
implementation("net.kyori:adventure-text-minimessage:4.20.0")
// bstats 依赖
implementation("org.bstats:bstats-bukkit:3.0.2")
}
val targetJavaVersion = 8
kotlin {
jvmToolchain(targetJavaVersion)
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
if (targetJavaVersion >= 10 || JavaVersion.current().isJava10Compatible) {
options.release.set(targetJavaVersion)
}
}
tasks.build {
dependsOn("shadowJar")
}
tasks.withType<com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar> {
// 重定位bStats到插件自己的包下,避免冲突
relocate("org.bstats", "com.github.postyizhan.libs.bstats")
}
tasks.processResources {
val props = mapOf("version" to version)
inputs.properties(props)
filteringCharset = "UTF-8"
filesMatching("plugin.yml") {
expand(props)
}
}