-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
104 lines (90 loc) · 2.43 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
103
104
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType
plugins {
kotlin("jvm") version libs.versions.kotlin
alias(libs.plugins.fabric.loom)
alias(libs.plugins.ktlint)
}
group = "dev.robustum"
version = "0.1.0"
repositories {
mavenCentral()
exclusiveContent {
forRepository {
maven("https://api.modrinth.com/maven") {
name = "Modrinth"
}
}
filter {
includeGroup("maven.modrinth")
}
}
}
val testAgent = configurations.create("testAgent") {
isCanBeConsumed = false
}
dependencies {
minecraft(libs.minecraft)
mappings("net.fabricmc:yarn:${libs.versions.fabric.yarn.get()}:v2")
modImplementation(libs.bundles.mods.fabric)
modLocalRuntime(libs.bundles.mods.debug)
testImplementation("org.jetbrains.kotlin:kotlin-test")
testImplementation(libs.fabric.loader.junit)
testImplementation(libs.bundles.kotest)
testAgent(project(path = ":test-agent", configuration = "agentJar"))
}
loom {
accessWidenerPath = file("src/main/resources/robustum_core.accesswidener")
mods {
create("robustum_core") {
sourceSet(sourceSets.main.get())
}
}
}
kotlin {
jvmToolchain(21)
compilerOptions {
jvmTarget.set(JvmTarget.JVM_21)
}
}
java {
withSourcesJar()
sourceCompatibility = JavaVersion.VERSION_21
targetCompatibility = JavaVersion.VERSION_21
}
ktlint {
version = libs.versions.ktlint
reporters {
reporter(ReporterType.HTML)
reporter(ReporterType.SARIF)
}
filter {
exclude("**/generated/**")
include("**/kotlin/**")
}
}
tasks {
test {
useJUnitPlatform()
val runDir = file("build/test_run")
workingDir = runDir
// Workaround https://github.com/FabricMC/fabric-loader/issues/817
// Original: https://github.com/embeddedt/ModernFix/commit/03b23957827c42d5df5a11f3d07f807c5343e87e
jvmArgs("-javaagent:${testAgent.singleFile.absolutePath}")
dependsOn(testAgent)
doFirst {
runDir.mkdir()
}
}
processResources {
inputs.property("version", project.version)
filesMatching("fabric.mod.json") {
expand("version" to project.version)
}
}
jar {
from("LICENSE") {
rename { "${it}_${project.base.archivesName.get()}" }
}
}
}