-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.gradle.kts
102 lines (82 loc) · 2.84 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
@file:Suppress("UnstableApiUsage")
plugins {
id("org.jetbrains.kotlin.jvm").version("1.8.10")
id("quiet-fabric-loom") version "1.4-SNAPSHOT"
}
val modId = project.properties["mod_id"].toString()
version = project.properties["version"].toString()
group = project.properties["group"].toString()
val minecraftVersion = project.properties["minecraft_version"].toString()
base.archivesBaseName = project.properties["mod_name"].toString()
repositories {
mavenCentral()
maven {
name = "Modrinth"
url = uri("https://api.modrinth.com/maven")
content {
includeGroup("maven.modrinth")
}
}
maven("https://maven.parchmentmc.org")
maven("https://maven.nucleoid.xyz/") { name = "Nucleoid" }
maven(url = "https://s01.oss.sonatype.org/content/repositories/snapshots/") {
name = "sonatype-oss-snapshots1"
mavenContent { snapshotsOnly() }
}
maven("https://oss.sonatype.org/content/repositories/snapshots")
maven("https://maven.impactdev.net/repository/development/")
}
loom {
splitEnvironmentSourceSets()
mods {
create(modId) {
sourceSet(sourceSets.main.get())
}
}
}
val modImplementationInclude by configurations.register("modImplementationInclude")
configurations {
modImplementationInclude
}
dependencies {
minecraft("com.mojang:minecraft:$minecraftVersion")
mappings(loom.layered {
officialMojangMappings()
parchment("org.parchmentmc.data:parchment-$minecraftVersion:2023.09.03@zip")
})
modImplementation("net.fabricmc:fabric-loader:${project.properties["loader_version"].toString()}")
modImplementation("net.fabricmc:fabric-language-kotlin:${project.properties["fabric_kotlin_version"].toString()}")
modImplementation("net.fabricmc.fabric-api:fabric-api:${project.properties["fabric_version"].toString()}")
modImplementation("com.cobblemon:fabric:1.4.1+1.20.1")
// Adventure Text!
modImplementation(include("net.kyori:adventure-platform-fabric:5.9.0")!!)
// PermissionsAPI
modImplementation("me.lucko:fabric-permissions-api:0.2-SNAPSHOT")
modImplementation(fileTree(mapOf("dir" to "libs", "include" to listOf("*.jar"))))
}
tasks.processResources {
inputs.property("version", version)
filesMatching("fabric.mod.json") {
expand("id" to modId, "version" to version)
}
filesMatching("**/lang/*.json") {
expand("id" to modId)
}
}
tasks.remapJar {
archiveFileName.set("${project.name}-fabric-$minecraftVersion-${project.version}.jar")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.release.set(17)
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
withSourcesJar()
}
tasks.withType<AbstractArchiveTask> {
from("LICENSE") {
rename { "${it}_${modId}" }
}
}