Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » EMF and Gradle(EMF code generation via Gradle)
EMF and Gradle [message #1727405] Tue, 22 March 2016 18:28 Go to next message
Michael Hoffer is currently offline Michael HofferFriend
Messages: 9
Registered: August 2014
Junior Member

Hi,

I'm completely new to EMF, Xcore and Xtext. Is it possible to generate EMF models directly from Gradle without Eclipse? I saw that you made some progress with making Xtext independent from Eclipse. Do you also support EMF code generation via Gradle?

See my related StackOverflow question:

stackoverflow.com/questions/36120699/generate-emf-model-via-gradle

Regards,
Michael
Re: EMF and Gradle [message #1727408 is a reply to message #1727405] Tue, 22 March 2016 19:47 Go to previous message
Christian Dietrich is currently offline Christian DietrichFriend
Messages: 14665
Registered: July 2009
Senior Member
Hi,

Xtext has the possibility to generate xtext languages using gradle. part of this option is to run mwe2 workflows.
there is a mwe workflow component to run the ecore 2 java generator (EcoreGenerator)

thus you should be able to write a workflow that uses this component and do the generation via gradle.
unfortunately if will be manual work to stick all together

Workflow {
	
	bean = org.eclipse.emf.mwe.utils.StandaloneSetup {
		platformUri=".."
	}
	
	component = org.eclipse.emf.mwe.utils.DirectoryCleaner {
		directory ="src/main/java/sample"
	}
	
	component = org.eclipse.emf.mwe2.ecore.EcoreGenerator {
		generateCustomClasses = false
        genModel = "platform:/resource/org.xtext.example.mydsl3/model/sample.genmodel"
        srcPath = "platform:/resource/org.xtext.example.mydsl3/src/main/java" 
	}
}



e.g. you may have to adapt the genmodel regarding the places where the generated sources should go to etc.


Twitter : @chrdietrich
Blog : https://www.dietrich-it.de
Previous Topic:What does this error mean?
Next Topic:Could not find any exported element of type 'FamilyDeclaration' -> Slot 'familyDeclaration' is em
Goto Forum:
  


Current Time: Thu Apr 25 16:01:30 GMT 2024

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

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

Back to the top