Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » TMF (Xtext) » how to execute two generators
how to execute two generators [message #755831] Wed, 09 November 2011 17:49 Go to next message
Jens Missing name is currently offline Jens Missing nameFriend
Messages: 27
Registered: November 2011
Junior Member
hi,

I have two separate generator files (.xtend).
But I have only one ME2 Workflow file.
How can I execute them both with only one run.
I hope you can help me.

My idea was to create two separate mwe2 files. But
that's not a good solution.

regards,
jens


my mew2 file looks like this:

module org.xtext.gui.GenerateGuiDsl

import org.eclipse.emf.mwe.utils.*
import org.eclipse.xtext.generator.*
import org.eclipse.xtext.ui.generator.*

var grammarURI = "classpath:/org/xtext/gui/GuiDsl.xtext"
var file.extensions = "dmodel"
var projectName = "org.xtext.gui"
var runtimeProject = "../${projectName}"

Workflow {
bean = StandaloneSetup {
scanClassPath = true
platformUri = "${runtimeProject}/.."
}

component = DirectoryCleaner {
directory = "${runtimeProject}/src-gen"
}

component = DirectoryCleaner {
directory = "${runtimeProject}.ui/src-gen"
}

component = Generator {
pathRtProject = runtimeProject
pathUiProject = "${runtimeProject}.ui"
pathTestProject = "${runtimeProject}.tests"
projectNameRt = projectName
projectNameUi = "${projectName}.ui"
language = {
uri = grammarURI
fileExtensions = file.extensions

// Java API to access grammar elements (required by several other fragments)
fragment = grammarAccess.GrammarAccessFragment {}

// generates Java API for the generated EPackages
fragment = ecore.EcoreGeneratorFragment {
// referencedGenModels = "
// platform:/resource/org.eclipse.xtext.xbase/model/Xbase.genmodel,
// platform:/resource/org.eclipse.xtext.common.types/model/JavaVMTypes.genmodel
// "
}

// Serializer 2.0
fragment = serializer.SerializerFragment {}

// the serialization component (1.0)
// fragment = parseTreeConstructor.ParseTreeConstructorFragment {}

// a custom ResourceFactory for use with EMF
fragment = resourceFactory.ResourceFactoryFragment {
fileExtensions = file.extensions
}

// The antlr parser generator fragment.
fragment = parser.antlr.XtextAntlrGeneratorFragment {
// options = {
// backtrack = true
// }
}

// java-based API for validation
fragment = validation.JavaValidatorFragment {
composedCheck = "org.eclipse.xtext.validation.ImportUriValidator"
composedCheck = "org.eclipse.xtext.validation.NamesAreUniqueValidator"
}

// scoping and exporting API
// fragment = scoping.ImportURIScopingFragment {}
// fragment = exporting.SimpleNamesFragment {}

// scoping and exporting API
fragment = scoping.ImportNamespacesScopingFragment {}
fragment = exporting.QualifiedNamesFragment {}
fragment = builder.BuilderIntegrationFragment {}

// generator API
fragment = generator.GeneratorFragment {
generateMwe = true
generateJavaMain = true
}

// formatter API
fragment = formatting.FormatterFragment {}

// labeling API
fragment = labeling.LabelProviderFragment {}

// outline API
fragment = outline.OutlineTreeProviderFragment {}
fragment = outline.QuickOutlineFragment {}

// quickfix API
fragment = quickfix.QuickfixProviderFragment {}

// content assist API
fragment = contentAssist.JavaBasedContentAssistFragment {}

// generates a more lightweight Antlr parser and lexer tailored for content assist
fragment = parser.antlr.XtextAntlrUiGeneratorFragment {}

// generates junit test support classes into Generator#pathTestProject
fragment = junit.Junit4Fragment {}

// project wizard (optional)
// fragment = projectWizard.SimpleProjectWizardFragment {
// generatorProjectName = "${projectName}"
// modelFileExtension = file.extensions
// }

// provides the necessary bindings for java types integration
fragment = types.TypesGeneratorFragment {}

// generates the required bindings only if the grammar inherits from Xbase
fragment = xbase.XbaseGeneratorFragment {}

// provides a preference page for template proposals
fragment = templates.CodetemplatesGeneratorFragment {}

// rename refactoring
fragment = refactoring.RefactorElementNameFragment {}

// provides a compare view
fragment = compare.CompareFragment {
fileExtensions = file.extensions
}

}
}
}

[Updated on: Wed, 09 November 2011 17:50]

Report message to a moderator

Re: how to execute two generators [message #755832 is a reply to message #755831] Wed, 09 November 2011 18:01 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7098
Registered: July 2009
Senior Member
Hi Jens

You can write a workflow of workflows; e.g.

module GenerateAllEditors

/**
* Generate all Xtext editors (but not their Concrete Syntax Models).
*/
Workflow {
component = @GenerateEssentialOCLEditor {}
component = @GenerateOCLinEcoreEditor {}
component = @GenerateCompleteOCLEditor {}
component = @GenerateOCLstdlibEditor {}
}

Regards

Ed Willink
Previous Topic:EclipseCon North America
Next Topic:compilation warnings MyPackage.Literals interface
Goto Forum:
  


Current Time: Fri Apr 16 15:38:57 GMT 2021

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

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

Back to the top