-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
81 lines (63 loc) · 2.22 KB
/
build.gradle.kts
File metadata and controls
81 lines (63 loc) · 2.22 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
81
@file:Suppress("SpellCheckingInspection")
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
kotlin("jvm") version "2.1.10"
kotlin("plugin.serialization") version "2.1.10"
id("net.minecrell.plugin-yml.bukkit") version "0.6.0"
id("io.github.goooler.shadow") version "8.1.7"
}
repositories {
mavenCentral()
maven("https://repo.purpurmc.org/snapshots")
maven { url = uri("https://oss.sonatype.org/content/repositories/snapshots/") }
// bStats
maven { url = uri("https://repo.codemc.org/repository/maven-public") }
// CommandAPI
maven { url = uri("https://repo.codemc.org/repository/maven-public/") }
mavenLocal()
}
dependencies {
compileOnly(kotlin("stdlib"))
implementation("com.charleskorn.kaml:kaml:0.72.0")
// Paper
compileOnly("org.purpurmc.purpur", "purpur-api", "1.21.5-R0.1-SNAPSHOT")
// CommandAPI
compileOnly("dev.jorel:commandapi-bukkit-core:10.0.1")
compileOnly("dev.jorel:commandapi-bukkit-kotlin:10.0.1")
// bStats
implementation("org.bstats", "bstats-bukkit", "1.8")
}
bukkit {
main = "me.weiwen.storagerobot.StorageRobot"
name = "StorageRobot"
version = project.version.toString()
description = "Automatically sort inventory items into matching containers."
apiVersion = "1.21.4"
author = "Goh Wei Wen <goweiwen@gmail.com>"
website = "weiwen.me"
}
tasks.withType<KotlinCompile> {
kotlinOptions.freeCompilerArgs = listOf("-opt-in=kotlinx.serialization.ExperimentalSerializationApi")
sourceSets.main {
java.srcDirs("src/main/kotlin")
}
}
tasks.withType<ShadowJar> {
fun reloc(pkg: String) = relocate(pkg, "$group.dependency.$pkg")
reloc("org.bstats")
}
val pluginPath = project.findProperty("plugin_path")
if(pluginPath != null) {
tasks {
named<DefaultTask>("build") {
dependsOn("shadowJar")
doLast {
copy {
from(findByName("reobfJar") ?: findByName("shadowJar") ?: findByName("jar"))
into(pluginPath)
}
}
}
}
}