Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Error on missing referencedResource when building multiple Xtext projects
Error on missing referencedResource when building multiple Xtext projects [message #1774478] Mon, 16 October 2017 08:37 Go to next message
Henning Treu is currently offline Henning TreuFriend
Messages: 44
Registered: April 2017
Member
Hi all,

I have a setup where two Xtext projects are build using a top level MWE2 workflow like this:

module all
Workflow {
    component = @org.eclipse.smarthome.model.GenerateScript{}
    component = @org.eclipse.smarthome.model.GenerateRule{}
}


The DSL defined in org.eclipse.smarthome.model.rule depends on the model of org.eclipse.smarthome.model.script and the corresponding workflow is defined like this:

module org.eclipse.smarthome.model.rule.GenerateRules

import org.eclipse.xtext.xtext.generator.*
import org.eclipse.xtext.xtext.generator.model.project.*

Workflow {
  component = XtextGenerator {
    configuration = {
      project = StandardProjectConfig {
        baseName = "org.eclipse.smarthome.model.rule" 
        rootPath = ".."
        runtimeTest = {
          enabled = false
        }
        genericIde = {
          enabled = true
        }
        eclipsePlugin = {
          enabled = true
        }
        eclipsePluginTest = {
          enabled = false
        }
        createEclipseMetaData = true
      }
      code = {
        encoding = "UTF-8"
        fileHeader = "/*\n * generated by Xtext \${version}\n */"
      }
    }
    language = StandardLanguage {
      name = "org.eclipse.smarthome.model.rule.Rules"
      fileExtensions = "rules"
      referencedResource = "platform:/resource/org.eclipse.smarthome.model.script/model/generated/Script.ecore"
      referencedResource = "platform:/resource/org.eclipse.smarthome.model.script/model/generated/Script.genmodel"
      serializer = {
        generateStub = true
      }
    }
  }
}


When running the two workflows manually (GenerateScript 1st, GenerateRule 2nd) it works like expected. When running the top level workflow on both projects cleaned the preInvoke call checks the existence of the referenced resources and a FileNotFoundException is raised.

Is there a way of telling the top-level workflow to sequentially execute the sub-workflows or something else to circumvent this situation?

Thanks in advance.
Henning
Re: Error on missing referencedResource when building multiple Xtext projects [message #1774487 is a reply to message #1774478] Mon, 16 October 2017 09:19 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14661
Registered: July 2009
Senior Member
i dont think thats possible. you would have to create a single workflow with 2 languages

Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Error on missing referencedResource when building multiple Xtext projects [message #1774489 is a reply to message #1774487] Mon, 16 October 2017 09:46 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

As part of the GIT\org.eclipse.ocl\examples\org.eclipse.ocl.examples.build\src\org\eclipse\ocl\examples\build\GeneratePivotModel.mwe2 I cascade many steps. It is very possible, but you need to be aware that

All initializations occur first.

There is a single variable/bean name space, so e.g. resourceSet gets re-used which is usually good, but other names may clash undesirably.

You may need to ensure that your names are distinctive. You may need to ensure that you use multiple ResourceSets so that step uses an old model and step 2 with another ResourceSet uses your new model.

Regards

Ed Willink
Re: Error on missing referencedResource when building multiple Xtext projects [message #1774840 is a reply to message #1774489] Fri, 20 October 2017 12:52 Go to previous message
Henning Treu is currently offline Henning TreuFriend
Messages: 44
Registered: April 2017
Member
Thanks for your comments,

Since we only needed the aggregated workflow to initially build all languages at once I did switch to a group launch config and serialised the call to sub-workflows there.

Thanks again. Cheers.
Henning
Previous Topic:Invalid Ecore feature
Next Topic:Xtext 2.13 is out
Goto Forum:
  


Current Time: Tue Mar 19 06:10:49 GMT 2024

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

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

Back to the top