Skip to main content



      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 10:51 Go to next message
Eclipse UserFriend
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 13:22 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: mwe2 with resources from different projects [message #892609 is a reply to message #891965] Thu, 28 June 2012 13:40 Go to previous messageGo to next message
Eclipse UserFriend
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 13:45 Go to previous messageGo to next message
Eclipse UserFriend
component = org.eclipse.xtext.mwe.Reader {
path = 'model'
register = example.dsla.DslAStandaloneSetup {}
register = example.dslb.DslBStandaloneSetup {}
loadResource = {
slot = "model"
}
}

[Updated on: Thu, 28 June 2012 14:50] by Moderator

Re: mwe2 with resources from different projects [message #892766 is a reply to message #892613] Fri, 29 June 2012 10:22 Go to previous message
Eclipse UserFriend
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: Mon Jul 07 03:12:01 EDT 2025

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

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

Back to the top