Terasology
Terasology copied to clipboard
ModuleManager fails to recognize modules for tests if jar task has not run
-
loadModulesFromClassPath
depends onmodule.txt
being visible toClassLoader.getSystemResources
: https://github.com/MovingBlocks/Terasology/blob/3833ede320e614bcd500483ab839ecda7ebcc448/engine/src/main/java/org/terasology/engine/core/module/ModuleManager.java#L151-L156 -
module.txt
is in the base directory of a module's source, but that directory is never on the classpath. The task that currently picks up that file is the jar task: https://github.com/MovingBlocks/Terasology/blob/3833ede320e614bcd500483ab839ecda7ebcc448/build-logic/src/main/kotlin/terasology-module.gradle.kts#L157 - the jar task is not a dependency of the test task
(This is what caused the module loading failure where I saw with https://github.com/Terasology/ModuleTestingEnvironment/issues/69)