forked from Crazy-Crew/CrazyCrates
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.gradle.kts
40 lines (32 loc) · 1.16 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
import org.gradle.kotlin.dsl.support.uppercaseFirstChar
plugins {
id("root-plugin")
}
tasks {
assemble {
val jarsDir = File("$rootDir/jars")
doFirst {
delete(jarsDir)
jarsDir.mkdirs()
}
subprojects.filter { it.name == "paper" || it.name == "fabric" }.forEach { project ->
dependsOn(":${project.name}:build")
doLast {
runCatching {
val file = File("$jarsDir/${project.name.uppercaseFirstChar().lowercase()}")
file.mkdirs()
copy {
from(project.layout.buildDirectory.file("libs/${rootProject.name}-${project.version}.jar"))
into(file)
}
}.onSuccess {
// Delete to save space on jenkins.
delete(project.layout.buildDirectory.get())
delete(rootProject.layout.buildDirectory.get())
}.onFailure {
println("Failed to copy file out of build folder into jars directory: Likely does not exist.")
}
}
}
}
}