-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
56 lines (49 loc) · 1.73 KB
/
build.gradle.kts
File metadata and controls
56 lines (49 loc) · 1.73 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
plugins {
id("cc.irori.refixes.build.java") apply false
}
/* Project Properties */
val modGroup = project.property("mod_group") as String
val modVersion = project.property("mod_version") as String
allprojects {
group = modGroup
version = modVersion
}
tasks {
register<Delete>("cleanBundle") {
delete(layout.buildDirectory.dir("bundle"))
}
register<Copy>("copyBundleManifest") {
dependsOn("cleanBundle")
from("bundle") {
include(
"manifest.json",
"LICENSE",
"README.md"
)
}
into(layout.buildDirectory.dir("bundle"))
expand(
"version" to modVersion,
"hytaleVersion" to libs.versions.hytale.get()
)
duplicatesStrategy = DuplicatesStrategy.INCLUDE
}
register<Copy>("collectEarlyJar") {
val shadowJarTask = project(":early").tasks.named<Jar>("shadowJar")
dependsOn("copyBundleManifest", shadowJarTask, project(":early").tasks.named("jar"))
from(shadowJarTask.flatMap { it.archiveFile })
into(layout.buildDirectory.dir("bundle/earlyplugins"))
}
register<Copy>("collectMainJar") {
val shadowJarTask = project(":plugin").tasks.named<Jar>("shadowJar")
dependsOn("copyBundleManifest", shadowJarTask, project(":plugin").tasks.named("jar"))
from(shadowJarTask.flatMap { it.archiveFile })
into(layout.buildDirectory.dir("bundle/mods"))
}
register<Zip>("bundle") {
dependsOn("collectEarlyJar", "collectMainJar")
archiveFileName.set("${project.name}-bundle-${version}.zip")
destinationDirectory.set(file("bundle"))
from(layout.buildDirectory.dir("bundle"))
}
}