Home » Modeling » TMF (Xtext) » Gradle Multi-Language Project (IntelliJ Idea 15, Xtend 2.9 Beta)
Gradle Multi-Language Project (IntelliJ Idea 15, Xtend 2.9 Beta) [message #1711643] |
Sun, 18 October 2015 18:33  |
Eclipse User |
|
|
|
Hi,
Xtext and Xtend is great and easy to use, but it's not so easy to find out how to use more than one DSL in a multi-language project. The projects should be seperated and build with gradle and intellij idea 15.
There were no topic to find via search.
Please checkout attached files with very simple projects of xtend 2.9 beta, gradle and intellij idea 15. It shows you how I wish to use Xtext projects in seperated projects.
mydsl + yourdsl + ourdsl = ourused
The ourused project should be able to use all DSLs, so I tried to setup all DSLs in ourdsl project.
Main problem : genmodel is unmapped, genmodels are not included in jars of gradle build
jars are included from a libs folder via dependencies in gradle and imported in mwe2 of ourdsl
Please help!
|
|
| |
Re: Gradle Multi-Language Project (IntelliJ Idea 15, Xtend 2.9 Beta) [message #1713944 is a reply to message #1711871] |
Sun, 08 November 2015 16:26   |
Eclipse User |
|
|
|
Hi Stefan,
yes the languages should live in separate repositories, because mydsl and yourdsl are technical-languages and ourdsl is a business-language. The mydsl and yourdsl can be used standalone, but ourdsl needs mydsl and yourdsl as technical vocabulary. The jar includes the model with your quickfix, but it doesn't work.
OK, what can I do ...
I build mydsl, yourdsl and the ourdsl in Eclipse Mars.1 with 2.9.0.beta5 and it was quite easy to get what I want. The ourdsl get its dependencies by MANIFEST.MF via Add Button in required plug-ins and it works very well. I can use mydsl and yourdsl in ourdsl.
A diff of the idea and eclispe projects didn't help. I couldn't find anything what's missing in IntelliJ Idea 15 RC with Gradle 2.8.
Next test to find out the problem --> gradle eclipse > import Ideas Gradle-Projects to Eclipse, but it also dosen't work. It is not possible to setup mydsl and yourdsl as required plug-ins for ourdsl. As compile dependencies mydsl and yourdsl is installed to my local m2 Repo and the jar inculdes its model. The gradle generated eclipse projects including mydsl and yourdsl. A change of access rules for the jars in Build Path settings didn't help.
Next idea use xtext-gradle-plugin to setup the languages, but nothing ... *grr*
Now I've no idea what to try next.
The problem on build is everytime the same:
22:21:26: Executing external task 'build'...
:ourdsl:generateXtextLanguage
0 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering project ourdsl at 'file:/Users/klaus/IdeaProjects/frugalSoftware/ourdsl/ourdsl.parent/ourdsl/'
2 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering project ourdsl.ide at 'file:/Users/klaus/IdeaProjects/frugalSoftware/ourdsl/ourdsl.parent/ourdsl.ide/'
3 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering project ourdsl.idea at 'file:/Users/klaus/IdeaProjects/frugalSoftware/ourdsl/ourdsl.parent/ourdsl.idea/'
3 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Registering project ourdsl.web at 'file:/Users/klaus/IdeaProjects/frugalSoftware/ourdsl/ourdsl.parent/ourdsl.web/'
30 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.eclipse.xtext.xbase.XbasePackage'
336 [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'
341 [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'
362 [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'
362 [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'
366 [main] INFO lipse.emf.mwe.utils.StandaloneSetup - Adding generated EPackage 'org.xtext.example.mydsl.myDsl.MyDslPackage'
368 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - Problems instantiating module org.xtext.example.ourdsl.GenerateOurDsl: java.lang.reflect.InvocationTargetException
java.lang.RuntimeException: Problems instantiating module org.xtext.example.ourdsl.GenerateOurDsl: 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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:296)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:296)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.xtext.util.PolymorphicDispatcher.invoke(PolymorphicDispatcher.java:296)
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(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.eclipse.emf.mwe2.language.factory.SettingProviderImpl$1$1.setValue(SettingProviderImpl.java:54)
... 29 more
Caused by: org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: java.io.IOException: The path '/mydsl/model/generated/MyDsl.genmodel' is unmapped
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
at org.eclipse.emf.mwe.utils.GenModelHelper.registerGenModel(GenModelHelper.java:35)
at org.eclipse.emf.mwe.utils.StandaloneSetup.addRegisterGenModelFile(StandaloneSetup.java:461)
... 34 more
Caused by: java.io.IOException: The path '/mydsl/model/generated/MyDsl.genmodel' is unmapped
at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:535)
at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
... 37 more
:ourdsl:generateXtextLanguage FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':ourdsl:generateXtextLanguage'.
> Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 3.388 secs
Process 'command '/Library/Java/JavaVirtualMachines/jdk1.8.0_60.jdk/Contents/Home/bin/java'' finished with non-zero exit value 1
22:21:30: External task execution finished 'build'.
May you can help. I want to use Idea and Gradle, please!
[Updated on: Sun, 08 November 2015 16:54] by Moderator
|
|
| |
Re: Gradle Multi-Language Project (IntelliJ Idea 15, Xtend 2.9 Beta) [message #1714346 is a reply to message #1714227] |
Wed, 11 November 2015 20:10   |
Eclipse User |
|
|
|
Hi Stefan,
yes, thank you it works, but the Facets in Idea (143.747.5) are not included as in Eclipse. Just *.ourdsl Files generating code and there is just a Facet and Module for OurDsl.
How to get the Facets for MyDsl and YourDsl to generate with *ourdsl, *.mydsl and *.yourdsl Files on gradle runIdea OurDsl-Project?
If project will be build and start with Eclipse there is also no Plug-In to find. There is no *.ui project as in Eclipse.
Beta6 didn't work:
1 [main] ERROR mf.mwe2.launch.runtime.Mwe2Launcher - [XtextLinkingDiagnostic: null:58 Couldn't resolve reference to JvmType 'WizardConfig'., XtextLinkingDiagnostic: null:59 Couldn't resolve reference to JvmIdentifiableElement 'runtimeRoot'., XtextLinkingDiagnostic: null:60 Couldn't resolve reference to JvmIdentifiableElement 'eclipseEditor'., XtextLinkingDiagnostic: null:61 Couldn't resolve reference to JvmIdentifiableElement 'ideaEditor'., XtextLinkingDiagnostic: null:62 Couldn't resolve reference to JvmIdentifiableElement 'webSupport'., XtextLinkingDiagnostic: null:63 Couldn't resolve reference to JvmIdentifiableElement 'genericIdeSupport'., XtextLinkingDiagnostic: null:64 Couldn't resolve reference to JvmIdentifiableElement 'testingSupport'., XtextLinkingDiagnostic: null:65 Couldn't resolve reference to JvmIdentifiableElement 'mavenLayout'., XtextLinkingDiagnostic: null:72 Couldn't resolve reference to JvmIdentifiableElement 'uri'.]
java.lang.IllegalStateException: [XtextLinkingDiagnostic: null:58 Couldn't resolve reference to JvmType 'WizardConfig'., XtextLinkingDiagnostic: null:59 Couldn't resolve reference to JvmIdentifiableElement 'runtimeRoot'., XtextLinkingDiagnostic: null:60 Couldn't resolve reference to JvmIdentifiableElement 'eclipseEditor'., XtextLinkingDiagnostic: null:61 Couldn't resolve reference to JvmIdentifiableElement 'ideaEditor'., XtextLinkingDiagnostic: null:62 Couldn't resolve reference to JvmIdentifiableElement 'webSupport'., XtextLinkingDiagnostic: null:63 Couldn't resolve reference to JvmIdentifiableElement 'genericIdeSupport'., XtextLinkingDiagnostic: null:64 Couldn't resolve reference to JvmIdentifiableElement 'testingSupport'., XtextLinkingDiagnostic: null:65 Couldn't resolve reference to JvmIdentifiableElement 'mavenLayout'., XtextLinkingDiagnostic: null:72 Couldn't resolve reference to JvmIdentifiableElement 'uri'.]
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Runner.run(Mwe2Runner.java:88)
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:78)
at org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher.main(Mwe2Launcher.java:36)
:ourdsl:generateXtextLanguage FAILED
FAILURE: Build failed with an exception.
Step by Step ... 
Thanks for your help!
https://github.com/biancode/mydsl-idea
may you can test it from github
[Updated on: Wed, 11 November 2015 20:36] by Moderator
|
|
| |
Re: Gradle Multi-Language Project (IntelliJ Idea 15, Xtend 2.9 Beta) [message #1751556 is a reply to message #1714227] |
Wed, 11 January 2017 07:58  |
Eclipse User |
|
|
|
Hi
I have added this in my source-layout.gradle
Quote:Hi Klaus,
your manifests don't have a bundle name. The bundle name is mandatory for doing platform:resource URIS in the mwe2 workflow. You need to add this to your sourceLayout.gradle
jar {
manifest {
attributes 'Bundle-SymbolicName': project.name
}
}
This has already been fixed in Beta6.
but still I am getting the same error The path /com.mncml/model/mnc.genmodel is unmapped
Please help.
Puneet
[Updated on: Wed, 11 January 2017 08:00] by Moderator
|
|
|
Goto Forum:
Current Time: Thu May 15 07:05:01 EDT 2025
Powered by FUDForum. Page generated in 0.05790 seconds
|