mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-16 17:25:09 +01:00
better test
This commit is contained in:
@@ -11,7 +11,27 @@ architectury {
|
||||
fabric()
|
||||
}
|
||||
|
||||
sourceSets {
|
||||
test {
|
||||
compileClasspath += main.compileClasspath
|
||||
runtimeClasspath += main.runtimeClasspath
|
||||
java {
|
||||
srcDirs.add('src/test/java' as File)
|
||||
}
|
||||
resources {
|
||||
srcDirs.add('src/test/resources' as File)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
loom {
|
||||
runs {
|
||||
testClient {
|
||||
client()
|
||||
configName = "Test Minecraft Client"
|
||||
source sourceSets.test
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -27,10 +47,12 @@ configurations {
|
||||
dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${rootProject.fabric_loader_version}"
|
||||
modApi "net.fabricmc.fabric-api:fabric-api:${rootProject.fabric_api_version}"
|
||||
modCompileOnly ("com.terraformersmc:modmenu:${rootProject.mod_menu_version}")
|
||||
modCompileOnly("com.terraformersmc:modmenu:${rootProject.mod_menu_version}")
|
||||
|
||||
common(project(path: ":common", configuration: "namedElements")) { transitive false }
|
||||
shadowCommon(project(path: ":common", configuration: "transformProductionFabric")) { transitive false }
|
||||
|
||||
testImplementation common(project(path: ':common', configuration: 'testOutput'))
|
||||
}
|
||||
|
||||
processResources {
|
||||
@@ -41,6 +63,14 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
processTestResources {
|
||||
inputs.property "version", rootProject.version
|
||||
|
||||
filesMatching("fabric.mod.json") {
|
||||
expand "version": rootProject.version
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
exclude "architectury.common.json"
|
||||
|
||||
@@ -71,7 +101,7 @@ unifiedPublishing {
|
||||
releaseType = "$project.release_type"
|
||||
changelog = releaseChangelog()
|
||||
gameVersions = []
|
||||
gameLoaders = ["fabric","quilt"]
|
||||
gameLoaders = ["fabric", "quilt"]
|
||||
mainPublication remapJar
|
||||
relations {
|
||||
depends {
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
package eu.midnightdust.test.fabric;
|
||||
|
||||
import eu.midnightdust.test.config.MidnightConfigExample;
|
||||
import eu.midnightdust.lib.config.MidnightConfig;
|
||||
import net.fabricmc.api.ModInitializer;
|
||||
|
||||
public class MLExampleFabric implements ModInitializer {
|
||||
@Override
|
||||
public void onInitialize() {
|
||||
MidnightConfig.init("modid", MidnightConfigExample.class);
|
||||
}
|
||||
}
|
||||
23
fabric/src/test/resources/fabric.mod.json
Normal file
23
fabric/src/test/resources/fabric.mod.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"schemaVersion": 1,
|
||||
"id": "testmod",
|
||||
"version": "${version}",
|
||||
|
||||
"name": "MidnightLib Example",
|
||||
"description": "Wow, you can do so much.",
|
||||
"authors": [ "MidnightDust" ],
|
||||
|
||||
"license": "CC0",
|
||||
"icon": "assets/midnightlib/icon.png",
|
||||
|
||||
"environment": "*",
|
||||
"entrypoints": {
|
||||
"main": [
|
||||
"eu.midnightdust.test.fabric.MLExampleFabric"
|
||||
]
|
||||
},
|
||||
"depends": {
|
||||
"fabric-resource-loader-v0": "*",
|
||||
"midnightlib": ">=1.6.0"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user