22
33plugins {
44 id ' multiloader-loader'
5- id ' net.neoforged.gradle.userdev '
5+ id ' net.neoforged.moddev '
66}
77
88// All jar files from this folder will be added automatically as runtime mod dependencies (inspired by AE2's build.gradle)
@@ -16,10 +16,13 @@ repositories {
1616}
1717
1818dependencies {
19- implementation " net.neoforged:neoforge:${ neoforge_version} "
20-
21- testImplementation " junit:junit:4.12"
22- testImplementation " org.mockito:mockito-core:1.+"
19+ testImplementation ' org.junit.jupiter:junit-jupiter:5.7.1'
20+ testImplementation ' org.junit.jupiter:junit-jupiter-params:5.7.1'
21+ testImplementation ' org.junit.platform:junit-platform-suite-api:1.14.1'
22+ testImplementation ' org.hamcrest:hamcrest:2.1'
23+ testImplementation " org.mockito:mockito-core:2.+"
24+ testRuntimeOnly ' org.junit.platform:junit-platform-suite-engine'
25+ testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
2326
2427 // Locally sourced extra mods for runtime (i.e. testing)
2528 for (extraModJar in fileTree(dir : extraModsDir, include : ' *.jar' )) {
@@ -34,45 +37,45 @@ dependencies {
3437
3538sourceSets. main. resources { srcDir ' src/generated/resources' }
3639
37- minecraft {
38- // Automatically enable neoforge AccessTransformers if the file exists
39- def at = project(' :loader-common' ). file(' src/main/resources/META-INF/accesstransformer.cfg' )
40- if (at. exists()) {
41- accessTransformers {
42- file(at. absolutePath)
43- }
44- }
45- }
40+ neoForge {
41+ version = " ${ neoforge_version} "
4642
47- subsystems {
4843 parchment {
49- minecraftVersion = " ${ parchment_minecraft_version} "
5044 mappingsVersion = " ${ parchment_version} "
51- }
52- }
53-
54- runs {
55- configureEach {
56- systemProperty ' neoforge.logging.markers' , ' REGISTRIES'
57- systemProperty ' neoforge.logging.console.level' , ' debug'
58- modSource project. sourceSets. main
45+ minecraftVersion = " ${ parchment_minecraft_version} "
5946 }
6047
61- client {
62- systemProperty ' neoforge.enabledGameTestNamespaces' , " cyclopscore,${ mod_id} "
48+ // Automatically enable neoforge AccessTransformers if the file exists
49+ def at = project(' :loader-common' ). file(' src/main/resources/META-INF/accesstransformer.cfg' )
50+ if (at. exists()) {
51+ accessTransformers = [ at. absolutePath ]
6352 }
6453
65- server {
66- systemProperty ' neoforge.enabledGameTestNamespaces' , " cyclopscore,${ mod_id} "
67- argument ' --nogui'
68- }
54+ // TODO: enable this once the Forge ATs change format
55+ // validateAccessTransformers = true
6956
70- gameTestServer {
71- systemProperty ' neoforge.enabledGameTestNamespaces' , " cyclopscore,${ mod_id} "
57+ runs {
58+ client {
59+ client()
60+ }
61+ server {
62+ server()
63+ programArgument ' --nogui'
64+ }
65+ gameTestServer {
66+ type = " gameTestServer"
67+ }
68+ configureEach {
69+ systemProperty ' forge.logging.markers' , ' REGISTRIES'
70+ logLevel = org.slf4j.event.Level . DEBUG
71+ systemProperty ' neoforge.enabledGameTestNamespaces' , " cyclopscore,${ mod_id} "
72+ }
7273 }
7374
74- clientData {
75- arguments. addAll ' --mod' , mod_id, ' --all' , ' --output' , file(' src/generated/resources/' ). getAbsolutePath(), ' --existing' , file(' src/main/resources/' ). getAbsolutePath()
75+ mods {
76+ " ${ mod_id} " {
77+ sourceSet(sourceSets. main)
78+ }
7679 }
7780}
7881
0 commit comments