-
Notifications
You must be signed in to change notification settings - Fork 14
/
build.gradle.kts
104 lines (96 loc) · 2.73 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
import io.izzel.taboolib.gradle.*
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
`maven-publish`
java
id("io.izzel.taboolib") version "2.0.22"
id("org.jetbrains.kotlin.jvm") version "1.8.22"
}
subprojects {
apply<JavaPlugin>()
apply(plugin = "io.izzel.taboolib")
apply(plugin = "maven-publish")
apply(plugin = "org.jetbrains.kotlin.jvm")
// TabooLib 配置
taboolib {
env {
install(
Bukkit,
BukkitHook,
BukkitNMSItemTag,
BukkitUI,
BukkitUtil,
I18n,
JavaScript,
Kether,
MinecraftChat,
MinecraftEffect,
Metrics
)
forceDownloadInDev = false
}
version {
coroutines = null
taboolib = "6.2.1-f095116"
}
}
// 全局仓库
repositories {
mavenLocal()
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
// 全局依赖
dependencies {
compileOnly(kotlin("stdlib"))
compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT")
}
// 编译配置
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<KotlinCompile> {
kotlinOptions {
jvmTarget = "1.8"
freeCompilerArgs = listOf("-Xjvm-default=all", "-Xextended-compiler-checks")
}
}
}
gradle.buildFinished {
buildDir.deleteRecursively()
}
subprojects
.filter { it.name != "project" && it.name != "plugin" }
.forEach { proj ->
proj.publishing { applyToSub(proj) }
}
fun PublishingExtension.applyToSub(subProject: Project) {
repositories {
maven("http://sacredcraft.cn:8081/repository/releases") {
isAllowInsecureProtocol = true
credentials {
username = project.findProperty("taboolibUsername").toString()
password = project.findProperty("taboolibPassword").toString()
}
authentication {
create<BasicAuthentication>("basic")
}
}
mavenLocal()
}
publications {
create<MavenPublication>("maven") {
artifactId = subProject.name
groupId = "com.mcstarrysky.aiyatsbus"
version = project.version.toString()
artifact(subProject.tasks["kotlinSourcesJar"])
artifact(subProject.tasks["jar"])
println("> Apply \"$groupId:$artifactId:$version\"")
}
}
}