-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
50 lines (40 loc) · 1.1 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
plugins {
kotlin("jvm") version "1.8.20"
}
group = "io.github.itsk1mlot.rocketcool"
version = "1.2"
val testServerDir: String by project
repositories {
mavenCentral()
maven("https://repo.papermc.io/repository/maven-public/")
}
dependencies {
testImplementation(kotlin("test"))
compileOnly("io.papermc.paper:paper-api:1.19.4-R0.1-SNAPSHOT")
implementation(kotlin("stdlib-jdk8"))
}
tasks.test {
useJUnitPlatform()
}
kotlin {
jvmToolchain(17)
}
task("fatJar", type = Jar::class) {
dependsOn(tasks.jar)
archiveBaseName.set("FireworkCooldown")
from(configurations.runtimeClasspath.get().map { if (it.isDirectory) it else zipTree(it) })
with(tasks.jar.get() as CopySpec)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
}
task("testJar") {
val fatJar = tasks.getByName("fatJar") as Jar
dependsOn(fatJar)
if(!fatJar.archiveFile.get().asFile.exists()) return@task
val destFile = File("$testServerDir/plugins/")
doLast {
copy {
from(fatJar.archiveFile.get().asFile.absolutePath)
into(destFile.absolutePath)
}
}
}