/plugins/jnario-maven-plugin/src/main/java/org/eclipse/xtend/maven/XtendMavenStandaloneSetup.java

http://github.com/bmwcarit/Jnario · Java · 26 lines · 20 code · 6 blank · 0 comment · 2 complexity · dd8fdf3e11e06c2c813a61aed2b51a63 MD5 · raw file

  1. package org.eclipse.xtend.maven;
  2. import org.eclipse.emf.ecore.EPackage;
  3. import org.eclipse.xtend.core.XtendStandaloneSetupGenerated;
  4. import org.eclipse.xtend.core.xtend.XtendPackage;
  5. import org.eclipse.xtext.ISetup;
  6. import org.eclipse.xtext.xbase.annotations.XbaseWithAnnotationsStandaloneSetup;
  7. import com.google.inject.Guice;
  8. import com.google.inject.Injector;
  9. public class XtendMavenStandaloneSetup implements ISetup {
  10. private static Injector injector = null;
  11. public Injector createInjectorAndDoEMFRegistration() {
  12. if (injector != null)
  13. return injector;
  14. XbaseWithAnnotationsStandaloneSetup.doSetup();
  15. EPackage.Registry.INSTANCE.put(XtendPackage.eINSTANCE.getNsURI(), XtendPackage.eINSTANCE);
  16. injector = Guice.createInjector(new XtendMavenModule());
  17. new XtendStandaloneSetupGenerated().register(injector);
  18. return injector;
  19. }
  20. }