use of org.eclipse.xtext.generator.GeneratorContext in project xtext-xtend by eclipse.
the class XtendBatchCompiler method generateJavaFiles.
protected void generateJavaFiles(ResourceSet resourceSet) {
JavaIoFileSystemAccess javaIoFileSystemAccess = javaIoFileSystemAccessProvider.get();
javaIoFileSystemAccess.setOutputPath(outputPath);
javaIoFileSystemAccess.setWriteTrace(writeTraceFiles);
GeneratorContext context = new GeneratorContext();
context.setCancelIndicator(CancelIndicator.NullImpl);
for (Resource resource : newArrayList(resourceSet.getResources())) {
if (isSourceFile(resource)) {
if (isWriteStorageFiles()) {
StorageAwareResource storageAwareResource = (StorageAwareResource) resource;
storageAwareResource.getResourceStorageFacade().saveResource(storageAwareResource, javaIoFileSystemAccess);
}
generator.generate(resource, javaIoFileSystemAccess, context);
}
}
}
Aggregations