@@ -2,6 +2,7 @@ buildscript {
22 repositories {
33 maven { url = ' https://maven.minecraftforge.net' }
44 mavenCentral()
5+ mavenLocal()
56 }
67
78 dependencies {
@@ -62,22 +63,15 @@ sourceSets {
6263 test {
6364 java { srcDir " src/main/test" }
6465
66+ resources {
67+ srcDir " src/test/resources"
68+ }
69+
6570 runtimeClasspath + = sourceSets. api. output
6671 compileClasspath + = sourceSets. api. output
6772 runtimeClasspath + = sourceSets. main. output
6873 compileClasspath + = sourceSets. main. output
6974 }
70-
71- // test {
72- // compileClasspath += sourceSets.api.output
73- // compileClasspath += sourceSets.main.output
74- // runtimeClasspath += sourceSets.api.output
75- // runtimeClasspath += sourceSets.main.output
76- //
77- // resources {
78- // srcDir "src/test/resources"
79- // }
80- // }
8175}
8276
8377println (' Java: ' + System . getProperty(' java.version' ) + ' JVM: ' + System . getProperty(' java.vm.version' ) + ' (' + System . getProperty(' java.vendor' ) + ' ) Arch: ' + System . getProperty(' os.arch' ))
@@ -156,71 +150,40 @@ minecraft {
156150 }
157151 }
158152
159- // unitTests {
160- // parent runs.server
161- //
162- // workingDirectory project.file('run/test')
163- // main 'com.alcatrazescapee.mcjunitlib.DedicatedTestServerLauncher'
164- // // The main class which launches a customized server which then runs JUnit tests
165- // ideaModule "${project.name}.test"
166- // property 'forge.logging.console.level', 'unittest'
167- // environment 'MOD_MODULES', String.join(File.pathSeparator, "${mod_id}%%${project.name}.test")
168- // environment 'target', 'fmltestserver'
169- // environment 'targetModId', "${mod_id}"
170- // environment "CC_TEST_RESOURCES", sourceSets.test.resources.srcDirs[0]
171- // arg '--keepAlive'
172- // forceExit = false
173- // mods {
174- // compactcrafting {
175- // source sourceSets.main
176- // source sourceSets.api
177- // source sourceSets.test
178- // }
179- // }
180- // }
181- //
182- // unitTestsCI {
183- // parent runs.server
184- //
185- // workingDirectory project.file('run/test')
186- // main 'com.alcatrazescapee.mcjunitlib.DedicatedTestServerLauncher'
187- // // The main class which launches a customized server which then runs JUnit tests
188- // ideaModule "${project.name}.test"
189- // property 'forge.logging.console.level', 'unittest'
190- // environment 'MOD_MODULES', String.join(File.pathSeparator, "${mod_id}%%${project.name}.test")
191- // environment 'target', 'fmltestserver'
192- // environment 'targetModId', "${mod_id}"
193- // environment "CC_TEST_RESOURCES", sourceSets.test.resources.srcDirs[0]
194- // arg '--crashOnFailedTests'
195- // forceExit = false
196- // mods {
197- // compactcrafting {
198- // source sourceSets.main
199- // source sourceSets.api
200- // source sourceSets.test
201- // }
202- // }
203- // }
204- }
205- }
153+ gametestserver {
154+ workingDirectory project. file(' run/gametest' )
155+
156+ // Recommended logging data for a userdev environment
157+ // The markers can be added/remove as needed separated by commas.
158+ // "SCAN": For mods scan.
159+ // "REGISTRIES": For firing of registry events.
160+ // "REGISTRYDUMP": For getting the contents of all registries.
161+ property ' forge.logging.markers' , ' REGISTRIES'
162+
163+ // Recommended logging level for the console
164+ // You can set various levels here.
165+ // Please read: https://stackoverflow.com/questions/2031163/when-to-use-the-different-log-levels
166+ property ' forge.logging.console.level' , ' debug'
167+
168+ property ' mixin.env.remapRefMap' , ' true'
169+ property ' mixin.env.refMapRemappingFile' , " ${ buildDir} /createSrgToMcp/output.srg"
170+
171+ // Only runs gametests which use "examplemod" as the namespace
172+ args ' --enableNamespace' , mod_id
206173
207- def format (String jar_name ) {
208- def index = jar_name. lastIndexOf(' -' )
209- index = jar_name. substring(0 , index). lastIndexOf(' -' )
210- def mod_version = jar_name. substring(index). replace(" .jar" , " " )
211- if (mod_version. startsWith(' -' )) {
212- mod_version = mod_version. substring(1 );
174+ mods {
175+ compactcrafting {
176+ source sourceSets. api
177+ source sourceSets. main
178+ source sourceSets. test
179+ }
180+ }
181+ }
213182 }
214- def mod_name = jar_name. substring(0 , index)
215- return mod_name + " :" + mod_name + " :" + mod_version
216183}
217184
218- def dev_mods_dir = " mods"
219-
220185repositories {
221- flatDir {
222- dirs dev_mods_dir
223- }
186+ mavenLocal()
224187
225188 maven {
226189 url " https://www.cursemaven.com"
@@ -255,40 +218,37 @@ repositories {
255218 }
256219}
257220
258- def dev_mods = fileTree(" mods" ). filter { it -> it. isFile() }. files. name. collect({ format(it) })
259-
260221dependencies {
261222 // Specify the version of Minecraft to use, If this is any group other then 'net.minecraft' it is assumed
262223 // that the dep is a ForgeGradle 'patcher' dependency. And it's patches will be applied.
263224 // The userdev artifact is a special name and will get all sorts of transformations applied to it.
264225 minecraft " net.minecraftforge:forge:${ minecraft_version} -${ forge_version} "
265226
266- testImplementation( " org.junit.jupiter:junit-jupiter:5.8.2 " )
267- // testImplementation fg.deobf("com.github.alcatrazEscapee:mcjunitlib:${mcunittest_version}")
227+ testImplementation ' org.junit.jupiter:junit-jupiter-api :5.8.1 '
228+ testImplementation ' org.junit.jupiter:junit-jupiter-engine:5.4.2 '
268229
269230 library " io.reactivex.rxjava3:rxjava:3.1.1" ;
270231
271- // Deobfuscate each dev mod for runtime
272- dev_mods . each { implementation fg. deobf(it) }
232+ // Nicephore - Screenshots and Stuff
233+ runtimeOnly( fg. deobf(" curse.maven:nicephore-401014:3574658 " ))
273234
274- runtimeOnly(fg . deobf( " curse.maven:nicephore-401014:3542531 " ))
235+ // Shut up Experimental Settings - so we don't have to deal with that CONSTANTLY
275236 runtimeOnly(fg. deobf(" curse.maven:shutupexperimental-407174:3544525" ))
276237
277238 // JEI
278- compileOnly fg. deobf(" mezz.jei:jei-${ minecraft_version } :${ jei_version} :api" )
279- runtimeOnly fg. deobf(" mezz.jei:jei-${ minecraft_version } :${ jei_version} " )
239+ compileOnly fg. deobf(" mezz.jei:jei-${ jei_mc_version } :${ jei_version} :api" )
240+ runtimeOnly fg. deobf(" mezz.jei:jei-${ jei_mc_version } :${ jei_version} " )
280241
281242 // The One Probe
282- // compileOnly fg.deobf("mcjty.theoneprobe:TheOneProbe-1.16:${top_version}:api")
283- // runtimeOnly fg.deobf("mcjty.theoneprobe:TheOneProbe-1.16:${top_version}")
243+ implementation(fg. deobf(" curse.maven:theoneprobe-245211:3550084" ))
284244}
285245
286246processResources {
287- duplicatesStrategy = DuplicatesStrategy . WARN
247+ duplicatesStrategy( DuplicatesStrategy . EXCLUDE )
288248}
289249
290250processTestResources {
291- duplicatesStrategy = DuplicatesStrategy . WARN
251+ duplicatesStrategy( DuplicatesStrategy . EXCLUDE )
292252}
293253
294254assemble {
@@ -397,5 +357,7 @@ publishing {
397357}
398358
399359test {
400- useJUnitPlatform()
360+ useJUnitPlatform {
361+ excludeTags " minecraft"
362+ }
401363}
0 commit comments