generated from natanfudge/fabric-example-mod-kotlin
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
79 lines (66 loc) · 2.28 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
plugins {
kotlin("jvm") version Jetbrains.Kotlin.version
id("fabric-loom") version Fabric.Loom.version
`maven-publish`
}
repositories {
mavenCentral()
maven(url = "https://maven.fabricmc.net/") { name = "Fabric" }
maven(url = "https://server.bbkr.space/artifactory/libs-release") { name = "CottonMC" }
maven(url = "https://maven.siphalor.de") { name = "Siphalor's Maven" }
maven(url = "https://maven.terraformersmc.com/") { name = "TerraformersMC" }
}
minecraft {
}
tasks.test {
useJUnitPlatform()
}
dependencies {
minecraft("com.mojang", "minecraft", Minecraft.version)
mappings("net.fabricmc", "yarn", Fabric.YarnMappings.version, classifier = Fabric.YarnMappings.classifier)
modImplementation("net.fabricmc", "fabric-loader", Fabric.Loader.version)
modImplementation("net.fabricmc", "fabric-language-kotlin", Fabric.Kotlin.version)
modImplementation("net.fabricmc.fabric-api", "fabric-api", Fabric.API.version)
modImplementation(include(Mods.libgui)!!)
modImplementation(Mods.modmenu)
modImplementation(Mods.nbtcrafting)
testRuntimeOnly(JUnit.jupiter_engine)
testImplementation(JUnit.jupiter)
testImplementation(Google.truth)
}
// ensure that the encoding is set to UTF-8, no matter what the system default is
// this fixes some edge cases with special characters not displaying correctly
// see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks {
compileJava {
targetCompatibility = "16"
sourceCompatibility = "16"
}
compileKotlin {
kotlinOptions {
jvmTarget = "16"
freeCompilerArgs = listOf(
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalStdlibApi"
)
}
}
processResources {
filesMatching("fabric.mod.json") {
expand(
"modid" to Info.modid,
"name" to Info.name,
"version" to Info.version,
"description" to Info.description,
"kotlinVersion" to Jetbrains.Kotlin.version,
"fabricApiVersion" to Fabric.API.version
)
}
}
jar {
from("LICENSE")
}
}