forked from TrPlugins/TrMenu
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathbuild.gradle.kts
98 lines (85 loc) · 2.49 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
import io.izzel.taboolib.gradle.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
java
idea
kotlin("jvm") version "2.1.0"
id("io.izzel.taboolib") version "2.0.22"
}
// 这段。一言难尽,但我不想动 (依托)
tasks.build {
doLast {
val plugin = project(":plugin")
val file =
file("${plugin.layout.buildDirectory.get()}/libs").listFiles()?.find { it.endsWith("plugin-$version.jar") }
file?.copyTo(file("${project.layout.buildDirectory.get()}/libs/${project.name}-$version.jar"), true)
}
dependsOn(project(":plugin").tasks.build)
}
subprojects {
apply<JavaPlugin>()
apply(plugin = "idea")
apply(plugin = "io.izzel.taboolib")
apply(plugin = "org.jetbrains.kotlin.jvm")
idea {
module {
isDownloadJavadoc = true
isDownloadSources = true
}
}
taboolib {
env {
install(
Basic,
Bukkit,
BukkitHook,
BukkitNMS,
BukkitNMSUtil,
BukkitUI,
BukkitUtil,
CommandHelper,
Database,
AlkaidRedis,
BukkitFakeOp,
DatabasePlayer,
I18n,
JavaScript,
Jexl,
Kether,
Metrics,
MinecraftChat,
XSeries
)
}
version {
// taboolib = "6.2.0-beta18"
taboolib = "6.2.2"
coroutines = null
}
}
repositories {
mavenCentral()
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
maven("http://sacredcraft.cn:8081/repository/releases") { isAllowInsecureProtocol = true }
maven("https://repo.codemc.io/repository/nms/")
maven("https://hub.spigotmc.org/nexus/content/groups/public/")
maven("https://repo.opencollab.dev/main/")
}
dependencies {
compileOnly(kotlin("stdlib"))
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<KotlinCompile>().configureEach {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs += listOf("-Xskip-prerelease-check","-Xallow-unstable-dependencies")
}
}
// Java 版本设置
configure<JavaPluginExtension> {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}
}