use of org.eclipse.xtend.core.tests.macro.DelegatingClassloader in project xtext-xtend by eclipse.
the class ActiveAnnotationsRuntimeTest method compileMacroResourceSet.
public XtextResourceSet compileMacroResourceSet(final Pair<String, String> macroFile, final Pair<String, String> clientFile) {
final URI macroURI = this.copyToDisk(this.macroProject, macroFile);
final URI clientURI = this.copyToDisk(this.clientProject, clientFile);
File _file = new File(this.workspaceRoot, this.macroProject);
FileProjectConfig _fileProjectConfig = new FileProjectConfig(_file);
final Procedure1<FileProjectConfig> _function = (FileProjectConfig it) -> {
it.addSourceFolder("src");
};
final FileProjectConfig macroProjectConfig = ObjectExtensions.<FileProjectConfig>operator_doubleArrow(_fileProjectConfig, _function);
File _file_1 = new File(this.workspaceRoot, this.clientProject);
FileProjectConfig _fileProjectConfig_1 = new FileProjectConfig(_file_1);
final Procedure1<FileProjectConfig> _function_1 = (FileProjectConfig it) -> {
it.addSourceFolder("src");
};
final FileProjectConfig clientProjectConfig = ObjectExtensions.<FileProjectConfig>operator_doubleArrow(_fileProjectConfig_1, _function_1);
final XtextResourceSet macroResourceSet = this.resourceSetProvider.get();
ProjectConfigAdapter.install(macroResourceSet, macroProjectConfig);
macroResourceSet.setClasspathURIContext(this.getClass().getClassLoader());
macroResourceSet.createResource(macroURI);
final XtextResourceSet resourceSet = this.resourceSetProvider.get();
ProjectConfigAdapter.install(resourceSet, clientProjectConfig);
resourceSet.createResource(clientURI);
final IAcceptor<CompilationTestHelper.Result> _function_2 = (CompilationTestHelper.Result result) -> {
ClassLoader _classLoader = this.getClass().getClassLoader();
final DelegatingClassloader classLoader = new DelegatingClassloader(_classLoader, result);
resourceSet.setClasspathURIContext(classLoader);
this.compiler.setJavaCompilerClassPath(classLoader);
};
this.compiler.compile(macroResourceSet, _function_2);
return resourceSet;
}
Aggregations