-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.gradle.kts
97 lines (77 loc) · 2.67 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
plugins {
java
id("fabric-loom") version "1.7-SNAPSHOT"
}
class ModInfo {
val id = property("mod.id").toString()
val group = property("mod.group").toString()
val version = property("mod.version").toString()
}
class Dependencies {
val minecraft = property("deps.minecraft").toString()
val loader = property("deps.loader").toString()
val yarn = property("deps.yarn").toString()
val fabricApi = property("deps.fabricapi").toString()
val mavApi = property("deps.mavapi").toString()
val midnightLib = property("deps.midnightlib").toString()
val badgesLib = property("deps.badgeslib").toString()
}
val mod = ModInfo()
val deps = Dependencies()
version = mod.version
group = mod.group
base.archivesName = "${mod.id}-${mod.version}"
loom {
splitEnvironmentSourceSets()
mods.create(mod.id) {
sourceSet(sourceSets.getByName("main"))
sourceSet(sourceSets.getByName("client"))
}
}
repositories {
mavenCentral()
maven("https://maven.terraformersmc.com/")
maven("https://api.modrinth.com/maven")
maven("https://maven.bawnorton.com/releases")
}
fabricApi {
configureDataGeneration()
}
dependencies {
minecraft("com.mojang:minecraft:${deps.minecraft}")
mappings("net.fabricmc:yarn:${deps.yarn}:v2")
modImplementation("net.fabricmc:fabric-loader:${deps.loader}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${deps.fabricApi}")
modImplementation("maven.modrinth:mavapi:${deps.mavApi}")
modImplementation("maven.modrinth:midnightlib:${deps.midnightLib}")
annotationProcessor("com.github.bawnorton.mixinsquared:mixinsquared-fabric:0.2.0")
include("com.github.bawnorton.mixinsquared:mixinsquared-fabric:0.2.0")
implementation("com.github.bawnorton.mixinsquared:mixinsquared-fabric:0.2.0")
include("maven.modrinth:modmenu-badges-lib:${deps.badgesLib}")
modImplementation("maven.modrinth:modmenu-badges-lib:${deps.badgesLib}")
}
tasks.processResources {
inputs.property("id", mod.id)
inputs.property("version", mod.version)
inputs.property("loader_version", deps.loader)
inputs.property("minecraft_version", deps.minecraft)
val map = mapOf(
"id" to mod.id,
"version" to mod.version,
"loader_version" to deps.loader,
"minecraft_version" to deps.minecraft
)
filesMatching("fabric.mod.json") { expand(map) }
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release = 21
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType<Jar> {
from("LICENSE") { rename { "${it}_${project.base.archivesName.get()}" } }
}