Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » mwe2 with resources from different projects(mwe2 with resources from different projects)
mwe2 with resources from different projects [message #891917] Tue, 26 June 2012 14:51 Go to next message
Balazs Molnar is currently offline Balazs MolnarFriend
Messages: 11
Registered: March 2010
Junior Member
Hello,

I am trying to setup a generation workflow where dsl files come from (two) different projects. My setup is the following:

project A contains a.dsla, and an mwe2 workflow,
project B contains b.dslb, and an mwe2 workflow. this dsl requires a.dsla resource to be accessible (it contains references to it). The workflow fails, when validating b.dslb it complains that A's types are inaccessible.

Using eclipse test runtime I can simply set up project B to have project A on the build path, then the builder (and editor) works fine.

Using mwe2 (and maven, tycho) I cannot set up the workflow in project B to be able to refer to project A a.dsla. How can I have the org.eclipse.xtext.mwe.Reader to get resources from different projects ?

thanks,
Balázs
Re: mwe2 with resources from different projects [message #891965 is a reply to message #891917] Tue, 26 June 2012 17:22 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13373
Registered: July 2009
Senior Member
Hi,

simply make sure you call the standalonesetups for both dsls
in the second workflow

~Christian

On 2012-06-26 14:51:27 +0000, Balazs Molnar said:

> Hello,
>
> I am trying to setup a generation workflow where dsl files come from
> (two) different projects. My setup is the following:
>
> project A contains a.dsla, and an mwe2 workflow,
> project B contains b.dslb, and an mwe2 workflow. this dsl requires
> a.dsla resource to be accessible (it contains references to it). The
> workflow fails, when validating b.dslb it complains that A's types are
> inaccessible.
> Using eclipse test runtime I can simply set up project B to have
> project A on the build path, then the builder (and editor) works fine.
>
> Using mwe2 (and maven, tycho) I cannot set up the workflow in project B
> to be able to refer to project A a.dsla. How can I have the
> org.eclipse.xtext.mwe.Reader to get resources from different projects ?
>
> thanks,
> Balázs


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: mwe2 with resources from different projects [message #892609 is a reply to message #891965] Thu, 28 June 2012 17:40 Go to previous messageGo to next message
Balazs Molnar is currently offline Balazs MolnarFriend
Messages: 11
Registered: March 2010
Junior Member
Hello,
Here is my mwe2 source, have you got some idea what could be wrong ?

Workflow {
	component = org.eclipse.xtext.mwe.Reader {
		useJavaClassPath=true
		register = example.dsla.DslAStandaloneSetup {}
		loadResource = {
			slot = "dsla-model"
			uri = ".*\\.dsla"
		}
	}	 
	component = org.eclipse.xtext.mwe.Reader {
		path = 'model'
		register = example.dslb.DslBStandaloneSetup {}
		loadResource = {
			slot = "dslb-model"
			uri = ".*\\.dslb"
		}
	}
	 	
	component = FkaDslGeneratorComponent {
		register = example.dslb.DslBStandaloneSetup {} 
		slot = 'dslb-model' 
	}
}
Re: mwe2 with resources from different projects [message #892613 is a reply to message #892609] Thu, 28 June 2012 17:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 13373
Registered: July 2009
Senior Member
component = org.eclipse.xtext.mwe.Reader {
path = 'model'
register = example.dsla.DslAStandaloneSetup {}
register = example.dslb.DslBStandaloneSetup {}
loadResource = {
slot = "model"
}
}


Need professional support for Xtext, Xpand, EMF?
Go to: https://www.itemis.com/en/xtext/
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Thu, 28 June 2012 18:50]

Report message to a moderator

Re: mwe2 with resources from different projects [message #892766 is a reply to message #892613] Fri, 29 June 2012 14:22 Go to previous message
Balazs Molnar is currently offline Balazs MolnarFriend
Messages: 11
Registered: March 2010
Junior Member
Hello Christian,

Thanks, it works now. It turned out that I was not good enough at specifying multiple resources for one slot (also I was at times tricked by the actual mwe2 resource run from a previous maven build, not the actual I was trying to debug). Now this is the config that seems (started to) work. I am still not very confident in it (I specified both: classPath scanning and a specific folder). So the reader parts:

var slotVar =  ResourceLoadingSlotEntry {
	slot = 'acc-model'
	uri = ".*\\.dsla"
	uri = ".*\\.dslb"
}

and the Reader
component = org.eclipse.xtext.mwe.Reader {
		path = 'model'
		useJavaClassPath=true
		register = example.dsla.DslAStandaloneSetup {}
                register = example.dslb.DslBStandaloneSetup {}
		loadResource  = slotVar
}

I have included the path variable to resolve the local (dslb) model file, and classpath scanning is set true to resolve model files from dslb project on the classpath.
Previous Topic:cannot run Junit plugin tests anymore
Next Topic:How xtext Lexer and Parser works?
Goto Forum:
  


Current Time: Sat Feb 29 13:54:14 GMT 2020

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

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

Back to the top