-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
74 lines (63 loc) · 1.9 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
import java.io.ByteArrayOutputStream
plugins {
id("java")
id("io.github.goooler.shadow") version "8.1.7"
}
group = "org.sgrewritten"
version = "0.1.1-ALPHA"
repositories {
mavenCentral()
mavenLocal()
maven("https://jitpack.io")
maven("https://repo.codemc.io/repository/maven-snapshots/")
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
testImplementation("com.github.seeseemelk:MockBukkit-v1.20:3.86.0")
testImplementation("org.junit.jupiter:junit-jupiter:5.10.2")
testImplementation("net.joshka:junit-json-params:5.10.2-r0")
testImplementation("org.eclipse.parsson:parsson:1.1.6")
implementation("io.papermc.paper:paper-api:1.20.4-R0.1-SNAPSHOT")
implementation("org.jetbrains:annotations:24.1.0")
implementation("org.sgrewritten:stargate:1.0.0.16-NIGHTLY")
implementation("net.wesjd:anvilgui:1.9.4-SNAPSHOT")
}
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
processResources {
filesMatching("**/plugin.yml") {
expand(project.properties)
}
}
jar {
manifest {
attributes["paperweight-mappings-namespace"] = "spigot"
}
}
shadowJar {
dependencies {
include(dependency("net.wesjd:anvilgui"))
}
relocate("net.wesjd.anvilgui", project.group.toString() + "." + project.name + ".anvilgui")
archiveClassifier.set("")
archiveBaseName = "StargateMechanics"
archiveClassifier = runCommand("git", "rev-parse", "HEAD").subSequence(0,7).toString()
}
test {
useJUnitPlatform()
}
register("install") {
dependsOn("shadowJar")
}
}
fun runCommand(vararg cmd: String): String {
val stdout = ByteArrayOutputStream()
exec {
commandLine(*cmd)
standardOutput = stdout
}
return stdout.toString().trim()
}