Terasology icon indicating copy to clipboard operation
Terasology copied to clipboard

ModuleManager fails to recognize modules for tests if jar task has not run

Open keturn opened this issue 2 years ago • 1 comments

  • loadModulesFromClassPath depends on module.txt being visible to ClassLoader.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

keturn avatar Sep 27 '21 20:09 keturn

(This is what caused the module loading failure where I saw with https://github.com/Terasology/ModuleTestingEnvironment/issues/69)

keturn avatar Sep 27 '21 20:09 keturn