use of org.eclipse.n4js.tests.codegen.OtherFile in project n4js by eclipse.
the class XtSetupParser method applyInlinedFileContents.
private static void applyInlinedFileContents(XtWorkspace workspace, Map<String, String> files) {
if (workspace == null) {
// nothing to do in this case
return;
}
for (Project prj : workspace.getAllProjects()) {
for (Folder srcFolder : prj.getSourceFolders()) {
Iterable<OtherFile> allFiles = Iterables.concat(srcFolder.getModules(), srcFolder.getOtherFiles());
for (OtherFile file : allFiles) {
String mName = file.getNameWithExtension();
if (file.getContents() == null) {
if (files.containsKey(mName)) {
String contents = files.get(mName);
file.setContents(contents);
} else {
throw new IllegalStateException(ERROR + "File not found: " + mName);
}
}
}
}
}
}
Aggregations