@@ -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 {
@@ -51,23 +44,16 @@ repositories {
5144 // Loom adds the essential maven repositories to download Minecraft and libraries from automatically.
5245 // See https://docs.gradle.org/current/userguide/declaring_repositories.html
5346 // for more information about repositories.
54- }
55-
56- // Override vulnerable dependencies until Minecraft updates to newer versions
57- configurations. all {
58- resolutionStrategy {
59- // v2.5.1, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2024-57699
60- force " net.minidev:json-smart:2.5.2"
61- // v2.13.4, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-52999
62- force " com.fasterxml.jackson.core:jackson-core:2.15.0"
63- // v3.17.0, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-48924
64- force " org.apache.commons:commons-lang3:3.18.0"
65- // v9.40, used by Minecraft 1.21.4 - 1.21.10, is vulnerable to CVE-2025-53864
66- force " com.nimbusds:nimbus-jose-jwt:10.0.2"
67- // v4.1.118.Final, used by Minecraft 1.21.5 - 1.21.10, is vulnerable to CVE-2025-58057
68- force " io.netty:netty-codec:4.1.125.Final"
69- // v4.1.118.Final, used by Minecraft 1.21.5 - 1.21.10, is vulnerable to CVE-2025-58056
70- force " io.netty:netty-codec-http:4.1.125.Final"
47+ exclusiveContent {
48+ forRepository {
49+ maven {
50+ name = " Modrinth"
51+ url = " https://api.modrinth.com/maven"
52+ }
53+ }
54+ filter {
55+ includeGroup " maven.modrinth"
56+ }
7157 }
7258}
7359
@@ -90,54 +76,53 @@ dependencies {
9076 modImplementation " com.google.code.findbugs:jsr305:3.0.2"
9177}
9278
79+ fabricApi. configureTests {
80+ createSourceSet = true
81+ enableGameTests = false
82+ enableClientGameTests = true
83+ modId = " wurst_testmod"
84+ username = " Wurst-Bot"
85+ }
86+
9387loom {
9488 accessWidenerPath = file(" src/main/resources/wurst.accesswidener" )
89+
90+ runs {
91+ clientGameTestWithMods {
92+ inherit client
93+ source = sourceSets. gametest
94+ runDir = " build/run/clientGameTestWithMods"
95+ vmArgs. add(" -Dfabric.client.gametest" )
96+ vmArgs. add(" -Dwurst.test.withMods=true" )
97+ programArgs. add(" --username=Wurst-Bot" )
98+ }
99+ }
95100}
96101
97102configurations {
98- productionRuntime {
99- extendsFrom configurations. minecraftLibraries
100- extendsFrom configurations. loaderLibraries
101- extendsFrom configurations. minecraftRuntimeLibraries
103+ testMods {
104+ transitive = false
102105 }
103106}
104107
105108dependencies {
106- productionRuntime " net.fabricmc:fabric-loader:${ project.loader_version} "
107- productionRuntime " net.fabricmc:intermediary:${ project.minecraft_version} "
109+ testMods " maven.modrinth:sodium:${ project.sodium_version} "
108110}
109111
110- import net.fabricmc.loom.util.Platform
111- import java.util.Locale
112- tasks. register(' runEndToEndTest' , JavaExec ) {
113- dependsOn remapJar, downloadAssets
114- classpath. from configurations. productionRuntime
115- mainClass = " net.fabricmc.loader.impl.launch.knot.KnotClient"
116- workingDir = file(" run" )
117-
118- doFirst {
119- classpath. from loom. minecraftProvider. minecraftClientJar
120- workingDir. mkdirs()
121-
122- args(
123- " --assetIndex" , loom. minecraftProvider. versionInfo. assetIndex(). fabricId(loom. minecraftProvider. minecraftVersion()),
124- " --assetsDir" , new File (loom. files. userCache, " assets" ). absolutePath,
125- " --gameDir" , workingDir. absolutePath
126- )
127-
128- if (Platform . CURRENT . operatingSystem. isMacOS()) {
129- jvmArgs(" -XstartOnFirstThread" )
130- }
131-
132- jvmArgs(
133- " -Dfabric.addMods=${ configurations.modImplementation.find { it.name.contains('fabric-api') }.absolutePath}${ File.pathSeparator}${ remapJar.archiveFile.get().asFile.absolutePath} " ,
134- " -Dwurst.e2eTest" ,
135- " -Dfabric-tag-conventions-v2.missingTagTranslationWarning=fail" ,
136- " -Dfabric-tag-conventions-v1.legacyTagWarning=fail" ,
137- " -Dmixin.debug.verify=true" ,
138- " -Dmixin.debug.countInjections=true"
139- )
140- }
112+ def cleanClientGameTestWithMods = tasks. register(" cleanClientGameTestWithMods" , Delete ) {
113+ delete layout. buildDirectory. dir(" run/clientGameTestWithMods" )
114+ }
115+
116+ def prepareClientGameTestWithMods = tasks. register(" prepareClientGameTestWithMods" , Sync ) {
117+ dependsOn cleanClientGameTestWithMods
118+ from configurations. testMods
119+ into layout. buildDirectory. dir(" run/clientGameTestWithMods/mods" )
120+ }
121+
122+ def doModCompatTest = providers. gradleProperty(" do_mod_compat_test" ). map { it. toBoolean() }. orElse(false )
123+ tasks. named(" runClientGameTestWithMods" ) {
124+ onlyIf { doModCompatTest. get() }
125+ dependsOn prepareClientGameTestWithMods
141126}
142127
143128processResources {
@@ -236,13 +221,13 @@ spotless {
236221 eclipse(). configFile(file(" codestyle/formatter.xml" ))
237222 }
238223 format(" licenseHeader" ) {
239- target(" src/*/java/**/*.java" , " src/test/java/**/*.java " )
224+ target(" src/*/java/**/*.java" )
240225 def header_file = file(" codestyle/license_header.txt" )
241226 def delimiter = LicenseHeaderStep . DEFAULT_JAVA_HEADER_DELIMITER
242227 licenseHeaderFile(header_file, delimiter). updateYearWithLatest(true )
243228 }
244229 json {
245- target " src/**/*.json"
230+ target( " src/**/*.json" , " src/**/*.mcmeta " )
246231 gson(). indentWithSpaces(2 ). version(" 2.11.0" )
247232 }
248233}
0 commit comments