Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Standalone generator & models in multiple jars(Referencing models in separate jars)
Standalone generator & models in multiple jars [message #1061937] Wed, 05 June 2013 00:38 Go to next message
Karel Alfonso is currently offline Karel AlfonsoFriend
Messages: 1
Registered: June 2013
Junior Member
Hi,

I have two projects both containing files for a DSL I've designed. I'm using maven and have declared the dependency as required. The base project packages the DSL files inside the jar artifact that gets generated.

I get an error when invoking from maven and I try to load a DSL file that references elements that are in the jar file of the project dependency.

I'm using the code below:

Provider<XtextResourceSet> resourceSetProvider

.....

XtextResourceSet resourceSet = resourceSetProvider.get();
resourceSet.addLoadOption(XtextResource.OPTION_RESOLVE_ALL, Boolean.TRUE);

// Iterate through all the files in a configured directory and add to resource
URI uri = URI.createURI(file.getPath());
resourceSet.getResource(uri, true);


I thought that by setting OPTION_RESOLVE_ALL Xtext will index the classpath to find the DSL resources.

So, if I don't know the name of the jar files in advance, is there a way to tell Xtext to scan the classpath and find the DSL resources? Eclipse does it in a way as I'm able to navigate from a DSL file in one project to another project even with "workspace resolution" disabled.

Any help will be appreciated.

Thanks, Karel
Re: Standalone generator & models in multiple jars [message #1061950 is a reply to message #1061937] Wed, 05 June 2013 06:11 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14669
Registered: July 2009
Senior Member
Hi,

you have to scan for resources and load them to the resourceset yourself.
this is intended.

you may use org.eclipse.xtext.mwe.Reader
instead of doing the resource handling yourself


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:[XBase] Find JvmType for specific class name?
Next Topic:Using Xbase in a Papyrus popup editor
Goto Forum:
  


Current Time: Fri Apr 26 20:07:06 GMT 2024

Powered by FUDForum. Page generated in 0.02866 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top