mirror of
https://github.com/TeamMidnightDust/MidnightLib.git
synced 2025-12-16 01:15:08 +01:00
- fix: NullPointerException when the config class of mod updated
- alter: better test code in `common/src/test`, `neoforge/src/test` and `fabric/src/test`, run `Test Minecraft Client(:fabric)` or `Test Minecraft Client(:neoforge)` for testing
This commit is contained in:
@@ -13,11 +13,44 @@ repositories {
|
||||
|
||||
architectury {
|
||||
platformSetupLoomIde()
|
||||
neoForge()
|
||||
neoForge {
|
||||
platformPackage = "neoforge"
|
||||
}
|
||||
}
|
||||
|
||||
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 {
|
||||
accessWidenerPath = project(":common").loom.accessWidenerPath
|
||||
|
||||
runs {
|
||||
testClient {
|
||||
client()
|
||||
name = "Test Minecraft Client"
|
||||
|
||||
mods {
|
||||
create('midnightlib') {
|
||||
sourceSet sourceSets.main
|
||||
}
|
||||
create('modid') { // test mod
|
||||
sourceSet sourceSets.test
|
||||
}
|
||||
}
|
||||
source sourceSets.test
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
configurations {
|
||||
@@ -44,6 +77,10 @@ dependencies {
|
||||
|
||||
common(project(path: ':common', configuration: 'namedElements')) { transitive false }
|
||||
shadowBundle project(path: ':common', configuration: 'transformProductionNeoForge')
|
||||
|
||||
// testImplementation common(project(path: ':common', configuration: 'namedElements')) { transitive false }
|
||||
testImplementation common(project(path: ':common', configuration: 'testOutput')) { transitive false }
|
||||
testImplementation sourceSets.main.output
|
||||
}
|
||||
|
||||
processResources {
|
||||
@@ -54,6 +91,14 @@ processResources {
|
||||
}
|
||||
}
|
||||
|
||||
processTestResources {
|
||||
inputs.property 'version', rootProject.version
|
||||
|
||||
filesMatching('META-INF/neoforge.mods.toml') {
|
||||
expand version: rootProject.version
|
||||
}
|
||||
}
|
||||
|
||||
shadowJar {
|
||||
configurations = [project.configurations.shadowBundle]
|
||||
archiveClassifier = 'dev-shadow'
|
||||
@@ -105,4 +150,4 @@ unifiedPublishing {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user