use of org.eclipse.xtext.generator.JavaIoFileSystemAccess in project xtext-xtend by eclipse.
the class XtendBatchCompiler method createStubs.
protected File createStubs(ResourceSet resourceSet) {
File outputDirectory = createTempDir("stubs");
JavaIoFileSystemAccess fileSystemAccess = javaIoFileSystemAccessProvider.get();
fileSystemAccess.setOutputPath(outputDirectory.toString());
List<Resource> resources = Lists.newArrayList(resourceSet.getResources());
for (Resource resource : resources) {
IResourceDescription description = resourceDescriptionManager.getResourceDescription(resource);
stubGenerator.doGenerateStubs(fileSystemAccess, description);
}
return outputDirectory;
}
use of org.eclipse.xtext.generator.JavaIoFileSystemAccess 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