Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » Sharing Xtext project at Github, how to do it?
Sharing Xtext project at Github, how to do it? [message #1574223] Tue, 20 January 2015 05:28 Go to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
I want to distribute my Xtext/Xtend project through Github. I'd been using SVN for all my code and it had generally been going OK (with me as the only contributor). I had checked everything into SVN, including the generated files. Recently, I imported everything from SVN into Github.

In Eclipse Luna, I imported all these files via Git into a fresh workspace. Previously I'd been using Kepler. All sorts of errors popped up in many parts of the project.

However, if I create a new Xtext project, then copy just the 10 or so relevant source files from a ZIP exported from Github into the right places in the Xtext project, it all works great.

There is the red text when I first generate my language infrastructure from Xtext, I think it is talking about installing antlr. I have to type "y', then it downloads and installs something. Could I be missing that when I just import from Git?

My question is how should I manage this project properly through Github and how do I most effectively share this project with other people?

[Updated on: Tue, 20 January 2015 05:51]

Report message to a moderator

Re: Sharing Xtext project at Github, how to do it? [message #1574242 is a reply to message #1574223] Tue, 20 January 2015 05:45 Go to previous messageGo to next message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
HI,

this is a question with no definite answer. here are some points to consider

- do you want to check in generated sources as well (xtend-gen/src-gen)
- is in the target only xtext installed or the antlr-sdk from itemis update site as well (decides weather to check in the *antlr*jar in the project dir which is downloaded if you ask the red question in the workflow or if the red question is asked at all)
- do you use maven tycho or something else. if you use maven tycho do you use the fornax m2 plugin or the maven exec plugin to run the workflow?


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Re: Sharing Xtext project at Github, how to do it? [message #1574269 is a reply to message #1574242] Tue, 20 January 2015 06:05 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
Hi Christian,

I want to do whatever makes it work, and is hopefully easy for other people to follow.

Currently I'm missing the src-gen folder from my backups, which I added per suggestion in this thread.

http://stackoverflow.com/questions/22556567/how-to-import-an-xtext-project-from-git-in-eclipse

However I am still getting this error when I try to generate the language infrastructure (it's the first error generated).

ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module com.holycityaudio.spincad.GenerateSpinCAD: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module com.holycityaudio.spincad.GenerateSpinCAD: java.lang.reflect.InvocationTargetException

I'm starting with the Luna SR1 Java/DSL version so I didn't install antlr-sdk other than when it asked me to do it for a new project.

I'm not sure about Maven Tycho, I never did anything specific with Maven.

How can I check these things to answer your questions?

Many thanks!

GW
Re: Sharing Xtext project at Github, how to do it? [message #1574282 is a reply to message #1574269] Tue, 20 January 2015 06:11 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
Here is the full console output when I try to generate my language infrastructure:

0 [main] WARN pes.access.impl.DeclaredTypeFactory - --- xtext.common.types ---------------------------------------------------
1 [main] WARN pes.access.impl.DeclaredTypeFactory - ASM library is not available. Falling back to java.lang.reflect API.
1 [main] WARN pes.access.impl.DeclaredTypeFactory - Please note that no information about compile time constants is available.
1 [main] WARN pes.access.impl.DeclaredTypeFactory - It's recommended to use org.objectweb.asm 5.0.1 or better.
2 [main] WARN pes.access.impl.DeclaredTypeFactory - --------------------------------------------------------------------------
1073 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering platform uri 'C:\Users\User\Documents\GitHub\SpinCAD-Builder'
1304 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
1567 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/Xtext/Xbase/XAnnotations' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1572 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xtype' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1590 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/xbase/Xbase' from 'platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel'
1590 [main] INFO clipse.emf.mwe.utils.GenModelHelper - Registered GenModel 'http://www.eclipse.org/xtext/common/JavaVMTypes' from 'platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel'
1784 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module com.holycityaudio.spincad.GenerateSpinCAD: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module com.holycityaudio.spincad.GenerateSpinCAD: java.lang.reflect.InvocationTargetException
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:95)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:52)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.run(Mwe2Launcher.java:74)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:35)
Caused by: org.eclipse.emf.common.util.WrappedException: java.lang.reflect.InvocationTargetException
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:56)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:143)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalApplyAssignments(Mwe2ExecutionEngine.java:142)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:114)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.inCase(Mwe2ExecutionEngine.java:80)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:291)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.internalSwitch(Mwe2ExecutionEngine.java:66)
at org.eclipse.emf.mwe2.language.factory.Mwe2ExecutionEngine.create(Mwe2ExecutionEngine.java:62)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:93)
... 4 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
... 37 more
Caused by: org.eclipse.xtext.resource.ClasspathUriResolutionException: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/com/holycityaudio/spincad/SpinCAD.xtext'
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:48)
at org.eclipse.xtext.resource.XtextResourceSet.resolveClasspathURI(XtextResourceSet.java:185)
at org.eclipse.xtext.resource.XtextResourceSet.access$0(XtextResourceSet.java:184)
at org.eclipse.xtext.resource.XtextResourceSet$1.normalize(XtextResourceSet.java:248)
at org.eclipse.xtext.resource.XtextResourceSet.getResource(XtextResourceSet.java:203)
at org.eclipse.xtext.generator.LanguageConfig.setUri(LanguageConfig.java:228)
... 42 more
Caused by: org.eclipse.xtext.resource.FileNotFoundOnClasspathException: Couldn't find resource on classpath. URI was 'classpath:/com/holycityaudio/spincad/SpinCAD.xtext'
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.findResourceOnClasspath(ClassloaderClasspathUriResolver.java:60)
at org.eclipse.xtext.resource.ClassloaderClasspathUriResolver.resolve(ClassloaderClasspathUriResolver.java:45)
... 47 more
Re: Sharing Xtext project at Github, how to do it? [message #1574301 is a reply to message #1574282] Tue, 20 January 2015 06:25 Go to previous messageGo to next message
Gary Worsham is currently offline Gary WorshamFriend
Messages: 176
Registered: September 2013
Senior Member
There's one other twist I forgot about until just now.

Earlier I had been developing under Linux. Now I'm developing on Windows.

I looked at my Build Path and saw this:

http://imageshack.com/a/img907/6870/E1G831.png

I don't even recall why I had added those. I don't have them installed so I just deleted them all from the Build Path a minute ago. In any case, there is an absolute path problem when switching between Linux and Windows!

But now, it seems I can generate my language infrastructure. Strange!
Re: Sharing Xtext project at Github, how to do it? [message #1574353 is a reply to message #1574301] Tue, 20 January 2015 07:06 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

if your project has build path errors the eclipse builder wont copy the .xtext file to the bin folder
and thus the mwe workflow wont find it by classpath:/xxxx*.xtext


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:How to reimport xtext project
Next Topic:Missing in Xtext 2.7.3 : org.eclipse.xtext.common.types.util.TypeConformanceComputer
Goto Forum:
  


Current Time: Thu Apr 25 11:43:20 GMT 2024

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

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

Back to the top