mirror of
https://github.com/sigmasternchen/xtext-core
synced 2025-03-16 08:48:55 +00:00
[generator] get rid of hard dependency to org.eclipse.xtext.ecore
This commit is contained in:
parent
937f675950
commit
6d3c086477
2 changed files with 9 additions and 3 deletions
|
@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.xtext;x-installation:=greedy,
|
|||
org.eclipse.xtext.util;x-installation:=greedy,
|
||||
org.eclipse.xtext.xbase.lib;visibility:=reexport;x-installation:=greedy,
|
||||
org.eclipse.xtend.lib,
|
||||
org.eclipse.xtext.ecore,
|
||||
org.eclipse.emf.codegen.ecore;bundle-version="2.10.2";visibility:=reexport;x-installation:=greedy,
|
||||
org.eclipse.emf.ecore;bundle-version="2.10.2",
|
||||
org.eclipse.emf.common;bundle-version="2.10.1",
|
||||
|
|
|
@ -16,7 +16,6 @@ import org.eclipse.emf.ecore.EPackage
|
|||
import org.eclipse.emf.ecore.resource.ResourceSet
|
||||
import org.eclipse.emf.mwe.utils.GenModelHelper
|
||||
import org.eclipse.emf.mwe.utils.StandaloneSetup
|
||||
import org.eclipse.xtext.ecore.EcoreSupportStandaloneSetup
|
||||
import org.eclipse.xtext.resource.IResourceServiceProvider
|
||||
import org.eclipse.xtext.util.internal.Log
|
||||
import org.eclipse.emf.ecore.EcorePackage
|
||||
|
@ -65,7 +64,15 @@ class XtextGeneratorResourceSetInitializer {
|
|||
case 'ecore': {
|
||||
val resourceServiceProvider = IResourceServiceProvider.Registry.INSTANCE.getResourceServiceProvider(loadedResource)
|
||||
if (resourceServiceProvider === null) {
|
||||
EcoreSupportStandaloneSetup.setup()
|
||||
try {
|
||||
val xcore = Class.forName('org.eclipse.xtext.ecore.EcoreSupportStandaloneSetup')
|
||||
xcore.getDeclaredMethod('doSetup', #[]).invoke(null)
|
||||
} catch (ClassNotFoundException e) {
|
||||
LOG.error("Couldn't initialize Ecore support. Is 'org.eclipse.xtext.ecore' on the classpath?")
|
||||
LOG.debug(e.getMessage(), e)
|
||||
} catch (Exception e) {
|
||||
LOG.error("Couldn't initialize Ecore support.", e)
|
||||
}
|
||||
}
|
||||
}
|
||||
case 'xcore': {
|
||||
|
|
Loading…
Reference in a new issue