use of org.eclipse.emf.mwe.utils.StandaloneSetup in project xtext-core by eclipse.
the class XtextGenerator method initialize.
public void initialize() {
if ((this.injector == null)) {
XtextGenerator.LOG.info("Initializing Xtext generator");
new StandaloneSetup().addRegisterGeneratedEPackage("org.eclipse.xtext.common.types.TypesPackage");
this.initializeEncoding();
this.injector = this.createInjector();
this.injector.injectMembers(this);
CodeConfig _instance = this.injector.<CodeConfig>getInstance(CodeConfig.class);
final Procedure1<CodeConfig> _function = (CodeConfig it) -> {
it.initialize(this.injector);
};
ObjectExtensions.<CodeConfig>operator_doubleArrow(_instance, _function);
this.projectConfig.initialize(this.injector);
this.cleaner.initialize(this.injector);
this.standaloneSetup.initialize(this.injector);
for (final XtextGeneratorLanguage language : this.languageConfigs) {
{
final Injector languageInjector = this.createLanguageInjector(this.injector, language);
language.initialize(languageInjector);
}
}
}
}
use of org.eclipse.emf.mwe.utils.StandaloneSetup in project xtext-core by eclipse.
the class XtextGeneratorStandaloneSetup method setup.
private void setup() {
final StandaloneSetup delegate = new StandaloneSetup();
delegate.setScanClassPath(this.scanClasspath);
final Consumer<Pair<String, String>> _function = (Pair<String, String> mapping) -> {
ProjectMapping _projectMapping = new ProjectMapping();
final Procedure1<ProjectMapping> _function_1 = (ProjectMapping it) -> {
it.setProjectName(mapping.getKey());
it.setPath(mapping.getValue());
};
ProjectMapping _doubleArrow = ObjectExtensions.<ProjectMapping>operator_doubleArrow(_projectMapping, _function_1);
delegate.addProjectMapping(_doubleArrow);
};
this.getProjectMappings().forEach(_function);
}
use of org.eclipse.emf.mwe.utils.StandaloneSetup in project xtext-core by eclipse.
the class XtextGeneratorResourceSetInitializer method initialize.
public void initialize(final ResourceSet resourceSet, final List<String> referencedResources) {
final StandaloneSetup delegate = new StandaloneSetup();
delegate.setResourceSet(resourceSet);
resourceSet.getPackageRegistry().put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
final Consumer<String> _function = (String it) -> {
this.loadResource(it, resourceSet);
};
referencedResources.forEach(_function);
this.registerGenModels(resourceSet);
this.registerEPackages(resourceSet);
}
Aggregations