plugins { id 'fabric-loom' version '1.10.5' } version = project.mod_version group = project.maven_group base { archivesName = project.archives_base_name } repositories { } dependencies { minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" } processResources { inputs.property "version", project.version filesMatching("fabric.mod.json") { expand "version": inputs.properties.version } } tasks.withType(JavaCompile).configureEach { it.options.release = 21 it.options.encoding = "UTF-8" } java { sourceCompatibility = JavaVersion.VERSION_21 targetCompatibility = JavaVersion.VERSION_21 withSourcesJar() } // End-to-end client test: ./gradlew runClientGameTest fabricApi { configureTests { createSourceSet = true modId = "combocoal-gametest" enableGameTests = false enableClientGameTests = true eula = true } } // Optional: trust a self-signed test certificate for the game test (-PtestTrustStore=path/to/trust.p12). if (project.hasProperty("testTrustStore")) { loom.runs.configureEach { if (name == "clientGameTest") { vmArg "-Djavax.net.ssl.trustStore=${project.property('testTrustStore')}" vmArg "-Djavax.net.ssl.trustStorePassword=changeit" } } } // Optional: point the game test at a running stats backend (-PtestEndpoint=https://localhost:5443). if (project.hasProperty("testEndpoint")) { loom.runs.configureEach { if (name == "clientGameTest") { vmArg "-Dcombocoal.testEndpoint=${project.property('testEndpoint')}" } } } // Optional two-client test: join an external server with a given username and run directory. if (project.hasProperty("testServer")) { loom.runs.configureEach { if (name == "clientGameTest") { vmArg "-Dcombocoal.testServer=${project.property('testServer')}" vmArg "-Dfabric.client.gametest.disableNetworkSynchronizer=true" programArgs "--username", project.property("testUsername") runDir project.property("testRunDir") } } }