@@ -2,13 +2,6 @@ buildscript {
22 dependencies {
33 classpath " org.kohsuke:github-api:1.330"
44 }
5-
6- configurations. classpath {
7- resolutionStrategy {
8- // v28.0-jre, used by fabric-loom 1.13.3, is vulnerable to CVE-2020-8908 and CVE-2023-2976
9- force " com.google.guava:guava:32.0.1-jre"
10- }
11- }
125}
136
147plugins {
@@ -31,27 +24,16 @@ repositories {
3124 // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
3225 // See https://docs.gradle.org/current/userguide/declaring_repositories.html
3326 // for more information about repositories.
34- }
35-
36- // Override vulnerable dependencies until Minecraft updates to newer versions
37- configurations. all {
38- resolutionStrategy {
39- // v2.5.1, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2024-57699
40- force " net.minidev:json-smart:2.5.2"
41- // v2.13.4, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-52999
42- force " com.fasterxml.jackson.core:jackson-core:2.15.0"
43- // v3.17.0, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-48924
44- force " org.apache.commons:commons-lang3:3.18.0"
45- // v9.40, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-53864
46- force " com.nimbusds:nimbus-jose-jwt:10.0.2"
47- // v4.1.115.Final, used by Minecraft 1.21.4, is vulnerable to CVE-2025-25193
48- force " io.netty:netty-common:4.1.118.Final"
49- // v4.1.115.Final, used by Minecraft 1.21.4, is vulnerable to CVE-2025-24970
50- force " io.netty:netty-handler:4.1.118.Final"
51- // v4.1.115.Final, used by Minecraft 1.21.4, is vulnerable to CVE-2025-58057
52- force " io.netty:netty-codec:4.1.125.Final"
53- // v4.1.115.Final, used by Minecraft 1.21.4, is vulnerable to CVE-2025-58056
54- force " io.netty:netty-codec-http:4.1.125.Final"
27+ exclusiveContent {
28+ forRepository {
29+ maven {
30+ name = " Modrinth"
31+ url = " https://api.modrinth.com/maven"
32+ }
33+ }
34+ filter {
35+ includeGroup " maven.modrinth"
36+ }
5537 }
5638}
5739
@@ -74,53 +56,53 @@ dependencies {
7456 modImplementation " com.google.code.findbugs:jsr305:3.0.2"
7557}
7658
59+ fabricApi. configureTests {
60+ createSourceSet = true
61+ enableGameTests = false
62+ enableClientGameTests = true
63+ modId = " wurst_testmod"
64+ username = " Wurst-Bot"
65+ }
66+
7767loom {
7868 accessWidenerPath = file(" src/main/resources/wurst.accesswidener" )
69+
70+ runs {
71+ clientGameTestWithMods {
72+ inherit client
73+ source = sourceSets. gametest
74+ runDir = " build/run/clientGameTestWithMods"
75+ vmArgs. add(" -Dfabric.client.gametest" )
76+ vmArgs. add(" -Dwurst.test.withMods=true" )
77+ programArgs. add(" --username=Wurst-Bot" )
78+ }
79+ }
7980}
8081
8182configurations {
82- productionRuntime {
83- extendsFrom configurations. minecraftLibraries
84- extendsFrom configurations. loaderLibraries
85- extendsFrom configurations. minecraftRuntimeLibraries
83+ testMods {
84+ transitive = false
8685 }
8786}
8887
8988dependencies {
90- productionRuntime " net.fabricmc:fabric-loader:${ project.loader_version} "
91- productionRuntime " net.fabricmc:intermediary:${ project.minecraft_version} "
89+ testMods " maven.modrinth:sodium:${ project.sodium_version} "
9290}
9391
94- import net.fabricmc.loom.util.Platform
95- tasks. register(' runEndToEndTest' , JavaExec ) {
96- dependsOn remapJar, downloadAssets
97- classpath. from configurations. productionRuntime
98- mainClass = " net.fabricmc.loader.impl.launch.knot.KnotClient"
99- workingDir = file(" run" )
100-
101- doFirst {
102- classpath. from loom. minecraftProvider. minecraftClientJar
103- workingDir. mkdirs()
104-
105- args(
106- " --assetIndex" , loom. minecraftProvider. versionInfo. assetIndex(). fabricId(loom. minecraftProvider. minecraftVersion()),
107- " --assetsDir" , new File (loom. files. userCache, " assets" ). absolutePath,
108- " --gameDir" , workingDir. absolutePath
109- )
110-
111- if (Platform . CURRENT . operatingSystem. isMacOS()) {
112- jvmArgs(" -XstartOnFirstThread" )
113- }
114-
115- jvmArgs(
116- " -Dfabric.addMods=${ configurations.modImplementation.find { it.name.contains('fabric-api') }.absolutePath}${ File.pathSeparator}${ remapJar.archiveFile.get().asFile.absolutePath} " ,
117- " -Dwurst.e2eTest" ,
118- " -Dfabric-tag-conventions-v2.missingTagTranslationWarning=fail" ,
119- " -Dfabric-tag-conventions-v1.legacyTagWarning=fail" ,
120- " -Dmixin.debug.verify=true" ,
121- " -Dmixin.debug.countInjections=true"
122- )
123- }
92+ def cleanClientGameTestWithMods = tasks. register(" cleanClientGameTestWithMods" , Delete ) {
93+ delete layout. buildDirectory. dir(" run/clientGameTestWithMods" )
94+ }
95+
96+ def prepareClientGameTestWithMods = tasks. register(" prepareClientGameTestWithMods" , Sync ) {
97+ dependsOn cleanClientGameTestWithMods
98+ from configurations. testMods
99+ into layout. buildDirectory. dir(" run/clientGameTestWithMods/mods" )
100+ }
101+
102+ def doModCompatTest = providers. gradleProperty(" do_mod_compat_test" ). map { it. toBoolean() }. orElse(false )
103+ tasks. named(" runClientGameTestWithMods" ) {
104+ onlyIf { doModCompatTest. get() }
105+ dependsOn prepareClientGameTestWithMods
124106}
125107
126108processResources {
@@ -168,13 +150,13 @@ spotless {
168150 eclipse(). configFile(file(" codestyle/formatter.xml" ))
169151 }
170152 format(" licenseHeader" ) {
171- target(" src/*/java/**/*.java" , " src/test/java/**/*.java " )
153+ target(" src/*/java/**/*.java" )
172154 def header_file = file(" codestyle/license_header.txt" )
173155 def delimiter = LicenseHeaderStep . DEFAULT_JAVA_HEADER_DELIMITER
174156 licenseHeaderFile(header_file, delimiter). updateYearWithLatest(true )
175157 }
176158 json {
177- target " src/**/*.json"
159+ target( " src/**/*.json" , " src/**/*.mcmeta " )
178160 gson(). indentWithSpaces(2 ). version(" 2.11.0" )
179161 }
180162}
0 commit comments