Accessing XText project classes from the runtime eclipse [message #1719444] |
Fri, 08 January 2016 00:56 |
Larry LeBron Messages: 124 Registered: October 2015 |
Senior Member |
|
|
I am struggling with allowing my DSL-generated-code to access classes which are written in my XText Xbase project. Specifically, I'm having this issue while trying to program a project with my dsl's xtext nature, in runtime eclipse.
For example, let's say this class is in my XText project:
package org.xtext.mydsl;
public class SuperEntity {
public SuperEntity() {...}
}
Now let's say my jvmModelInferrer includes something like:
def dispatch void infer(Entity entity, IJvmDeclaredTypeAcceptor acceptor, boolean isPreIndexingPhase) {
acceptor.accept(entity.toClass(entity.name)) [
superTypes += typeRef(org.xtext.mydsl.SuperEntity)
]
How can I properly export the SuperEntity class (or ideally its containing package), so that the generated source will properly compile in runtime eclipse? Is there a way to do this via the xtext project's manifest? Ideally, I'd be able to reference the package directly vs. having to build a jar.
Thanks (yet again!).
[Updated on: Fri, 08 January 2016 08:41] Report message to a moderator
|
|
|
|
|
Re: Accessing XText project classes from the runtime [message #1719469 is a reply to message #1719467] |
Fri, 08 January 2016 08:58 |
|
hi,
- the project in the runtime eclipse has to be a java project with xtext nature
- the project need a jar containing org.xtext.mydsl.SuperEntity on the classpath (e.g. in a libary jar)
- if you use xbase expressions it needs xbase.lib on the classpath as well
if you want this "putting on the classpath" beeing happening automatically you have to build this yourself.
(xtend does this by having a quickfix)
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.02087 seconds