Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XtextGenerator unexpected package name for generated UI.Activator
XtextGenerator unexpected package name for generated UI.Activator [message #1778365] Wed, 13 December 2017 13:59 Go to next message
Michael Müller is currently offline Michael MüllerFriend
Messages: 2
Registered: December 2017
Junior Member
Hello together,
I want to migrate a internal project form xtext 2.8.4 to 2.13.0.

In the first step i modified the mwe2 Workflow. I have switched from deprecated org.eclipse.xtext.generator.Generator to the new org.eclipse.xtext.xtext.generator.XtextGenerator.

At the end i have one topic where i have no idea how to solve it.

In the existing version of the dsl, the project name is a little bit different to the grammar name.

In the grammar we are using com.xx_companyname.mydsl . The project names are com.xx-companyname.my.

With the old generator there was no problem with this difference. With the new XtextGenerator for the most of the generated classes, the package is fine and it is used from the grammar definition. But for the Activator in the UI project the project name is used. So at the end, the generator produces a invalid package name. Also the name of the Activator looks different like before. In the version 2.8.4 the last segment from the grammar name was used. Now it is the last segment from the project name.

Is there a possibility to configure the generator in a different way to get the correct package name?
Re: XtextGenerator unexpected package name for generated UI.Activator [message #1778383 is a reply to message #1778365] Wed, 13 December 2017 16:06 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 12028
Registered: July 2009
Senior Member
see https://bugs.eclipse.org/bugs/show_bug.cgi?id=492303
dont know a workaround.
maybe you can subclass org.eclipse.xtext.xtext.generator.XtextGeneratorNaming.getEclipsePluginActivator()
and apply the proposed fix. you should be able to set a custom generator naming in the workflow like

https://github.com/eclipse/xtext-web/blob/84fed56df30d043957e169923305fa0fcab5c097/org.eclipse.xtext.web.example.statemachine/src/org/eclipse/xtext/web/example/statemachine/GenerateStatemachine.mwe2#L19


Need professional support for Xtext, Xpand, EMF?
Go to: https://xtext.itemis.com
Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XtextGenerator unexpected package name for generated UI.Activator [message #1778577 is a reply to message #1778383] Mon, 18 December 2017 08:12 Go to previous message
Michael Müller is currently offline Michael MüllerFriend
Messages: 2
Registered: December 2017
Junior Member
Hi Christian,
thanks for the helpful answer. I have done it in the way like you proposed and it's working like expected.
Previous Topic:Migrating content assist tests to Xpect possible?
Next Topic:XText Update-Site older Releases
Goto Forum:
  


Current Time: Mon Jun 18 04:20:48 GMT 2018

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

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

Back to the top