-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.gradle.kts
102 lines (80 loc) · 2.44 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
98
99
100
101
102
plugins {
java
alias(libs.plugins.fabric.loom)
alias(libs.plugins.minotaur)
}
class ModInfo {
val id = property("mod.id").toString()
val group = property("mod.group").toString()
val version = property("mod.version").toString()
}
val mod = ModInfo()
version = mod.version
group = mod.group
base.archivesName = "${mod.id}-${mod.version}"
fabricApi {
configureDataGeneration {
client = true
}
}
loom {
splitEnvironmentSourceSets()
accessWidenerPath = file("src/main/resources/hollow.accesswidener")
mods.create(mod.id) {
sourceSet(sourceSets.getByName("main"))
sourceSet(sourceSets.getByName("client"))
}
}
repositories {
mavenCentral()
maven("https://maven.spiritstudios.dev/releases/")
maven("https://maven.terraformersmc.com/releases/")
maven("https://maven.gegy.dev/")
exclusiveContent {
forRepository { maven("https://api.modrinth.com/maven/") }
filter { includeGroup("maven.modrinth") }
}
}
dependencies {
minecraft(libs.minecraft)
mappings(variantOf(libs.yarn) { classifier("v2") })
modImplementation(libs.fabric.loader)
modImplementation(libs.fabric.api)
include(libs.bundles.specter)
modImplementation(libs.bundles.specter)
modRuntimeOnly(libs.specter.debug)
modImplementation(libs.lambdynamiclights)
}
tasks.processResources {
val map = mapOf(
"mod_id" to mod.id,
"mod_version" to mod.version,
"fabric_loader_version" to libs.versions.fabric.loader.get(),
"minecraft_version" to libs.versions.minecraft.get()
)
inputs.properties(map)
filesMatching("fabric.mod.json") { expand(map) }
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release = 21
}
tasks.jar { from("LICENSE") { rename { "${it}_${base.archivesName}" } } }
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
projectId.set(mod.id)
versionNumber.set(mod.version)
uploadFile.set(tasks.remapJar)
gameVersions.addAll(libs.versions.minecraft.get(), "1.21.1")
loaders.addAll("fabric", "quilt")
syncBodyFrom.set(rootProject.file("README.md").readText())
dependencies {
required.version("fabric-api", libs.versions.fabric.api.get())
optional.version("lambdynamiclights", libs.versions.lambdynamiclights.get())
}
}