-
Notifications
You must be signed in to change notification settings - Fork 31
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
41 lines (36 loc) · 1.75 KB
/
build.gradle.kts
File metadata and controls
41 lines (36 loc) · 1.75 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
plugins {
// Apply the base plugin which mostly defines useful "build lifecycle" tasks like
// assemble, check and build. The root project doesn't contain any code,
// so we won't apply those plugins here. Only the assemble task is used in the root project.
// See https://docs.gradle.org/current/userguide/base_plugin.html.
base
}
// Set up basic Maven artifact metadata, including the project version
// and archive names.
group = "io.github.juuxel"
// Set the project version to be <mod version>+<Minecraft version> so the MC version is semver build metadata.
// The "mod-version" and "minecraft-version" properties are read from gradle.properties.
version = "${project.property("mod-version")}+${project.property("minecraft-version")}"
base.archivesName.set("Adorn")
tasks {
// Register a custom "collect jars" task that copies the Fabric and Forge mod jars
// into the root project's build/libs. This makes it easier for me to find them
// for testing and releasing.
val collectJars by registering(Copy::class) {
// Find the remapJar tasks of projects that aren't common (so :fabric and :forge) and depend on them.
val tasks = subprojects.filter { it.path != ":common" }
.map { it.tasks.named("remapJar") }
dependsOn(tasks)
// Copy the outputs of the tasks...
from(tasks)
// ...into build/libs.
into(layout.buildDirectory.dir("libs"))
}
// Set up assemble to depend on the collectJars task, so it gets run on gradlew build.
assemble {
dependsOn(collectJars)
}
// This is for IDEA. If "classes" doesn't exist, it runs "assemble" - which
// builds the final project jars and is slow - when you press the hammer icon.
register("classes")
}