Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » XText + XSemantics + Maven(Need help with project setup)
XText + XSemantics + Maven [message #1847059] Wed, 13 October 2021 09:50 Go to next message
Simon Cockx is currently offline Simon CockxFriend
Messages: 69
Registered: October 2021
Member
I'm trying to setup a new project with Xsemantics, but following the documentation on Getting Started hasn't worked for me yet.

There is an example Maven project located at https://github.com/eclipse/xsemantics/blob/master/tests/org.eclipse.xsemantics.example.maven.test/pom.xml, but it doesn't look anything like the multi-module Maven project that is generated when starting a new Xtext project, so I'm not sure what to do.

The steps I tried:
(1) create a new Maven-based XText project called mydsl
(2) add the update site to the target platform and select XSemantics 1.20.x (https://download.eclipse.org/xsemantics/milestones/)
(3) Activate the target platform
(4) Edit the pom.xml of the parent-project by copying relevant changes as in the example pom-file from the documentation (https://github.com/eclipse/xsemantics/blob/master/tests/org.eclipse.xsemantics.example.maven.test/pom.xml)
(4a) Copy the three repositories (Xsemantics, eclipse, Xtext Update Site)
(4b) Copy the two plugin repositories (sonatype_releases, sonatype_snapshots)
(4c) Add the xsemantics-gen folder to the filesets of the maven-clean-plugin
(4d) Copy the xtext-maven-plugin to my plugins

This results in an error when updating the Maven project: org.eclipse.xsemantics:org.eclipse.xsemantics.dsl:jar:1.20.0 was not found in https://oss.sonatype.org/content/repositories/releases/.

The documentation also mentions to add a dependency to "it.xsemantics.runtime", but I'm not sure where I should add this dependency. In the pom of the parent project? In the pom of the main Xtext project?

I'm not very experienced with Eclipse plugin development, so I might be overlooking something simple. Any help is welcome.

Kind regards, Simon

Re: XText + XSemantics + Maven [message #1847061 is a reply to message #1847059] Wed, 13 October 2021 11:24 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
aint this a pure maven problem?
https://oss.sonatype.org/content/repositories/releases/.
does not seem to contain xsematics at all
https://oss.sonatype.org/content/repositories/snapshots/org/eclipse/xsemantics/
does contain snapshots
so maybe you should use snapshot version


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: XText + XSemantics + Maven [message #1847064 is a reply to message #1847061] Wed, 13 October 2021 12:16 Go to previous messageGo to next message
Simon Cockx is currently offline Simon CockxFriend
Messages: 69
Registered: October 2021
Member
Hi Christian. Thanks for the quick response!

This might be purely Maven-related, though I would argue this is also a documentation issue in the getting-started guide of Xsemantics. ;) The guide is at least out-dated, and contains a lot of broken links. (if Lorenzo Bettini reads this: I think many people could benefit from an update :) )

Anyway, setting the version of Xsemantics to 1.20.0-SNAPSHOT seems to have resolved my first problem. For my second problem: not knowing where to add the it.xsemantics.runtime dependency, I added it to the parent project. Eclipse does not show any errors anymore, but when I create an xsemantics file (MyDsl.xsemantics in the org.xtext.example.mydsl package), write "system mydsl.xsemantics.MyDslSystem" and save the file, there is no code being generated. There is also no syntax highlightning in the file, so I guess the setup hasn't succeeded yet. Any idea what I'm missing?

As a side note, I'm a bit puzzled about why the installation of Xsemantics is this complicated. For example: the pom file of a newly generated Xtext project does not contain the xtext-maven-plugin, but then xsemantics apparently requires it (okay, scratch this, I looked up what the xtext-maven-plugin is for, and I get it now). The need to add five repositories to the pom also seems a bit superficial to me... Without a clear documentation I guess I'm just groping in the dark here.

In any case, I appreciate your help very much. Thank you.

[Updated on: Wed, 13 October 2021 12:25]

Report message to a moderator

Re: XText + XSemantics + Maven [message #1847070 is a reply to message #1847064] Wed, 13 October 2021 14:42 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
if you have a plugin project you add the dependency ususally to manifest.mf
maybe you better ask in xsematics github issue or discussion

and compare with https://github.com/eclipse/xsemantics/tree/master/examples


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de

[Updated on: Wed, 13 October 2021 17:09]

Report message to a moderator

Re: XText + XSemantics + Maven [message #1847089 is a reply to message #1847070] Thu, 14 October 2021 09:56 Go to previous message
Simon Cockx is currently offline Simon CockxFriend
Messages: 69
Registered: October 2021
Member
Thanks. One thing I also did was to install Xsemantics via Help > Install new software... . This (at least) fixed the syntax highlighting. Now it appears to be working.
Previous Topic:3AC three addresses code grammar
Next Topic:User defined functions with builtin functions
Goto Forum:
  


Current Time: Thu Apr 25 11:48:05 GMT 2024

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

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

Back to the top