importedModules = «Collections.importedName».emptySet();
«ENDIF»
- «val path = m.moduleSourcePath.replace(java.io.File.separatorChar, '/')»
- «InputStream.importedName» stream = «CLASS».class.getResourceAsStream("«path»");
+ «InputStream.importedName» stream = «CLASS».class.getResourceAsStream("«sourcePath»");
if (stream == null) {
- throw new IllegalStateException("Resource «path» is missing");
+ throw new IllegalStateException("Resource «sourcePath» is missing");
}
try {
stream.close();
@Override
public «InputStream.importedName» getModuleSourceStream() throws IOException {
- «InputStream.importedName» stream = «CLASS».class.getResourceAsStream("«path»");
+ «InputStream.importedName» stream = «CLASS».class.getResourceAsStream("«sourcePath»");
if (stream == null) {
- throw new «IOException.importedName»("Resource «path» is missing");
+ throw new «IOException.importedName»("Resource «sourcePath» is missing");
}
return stream;
}
return importedModules;
}
'''
+
+ def getSourcePath() {
+ return "/" + module.moduleSourcePath.replace(java.io.File.separatorChar, '/')
+ }
private def imports() '''
«IF !importMap.empty»