How to generate implementation code for Xtext plugins

From EdnaWiki
Jump to: navigation, search

The plugins

  • org.edna.datamodel.language
  • org.edna.datamodel.language.ui

are plugins developed with the Xtext framework. Xtext is using a code generator for large parts of the plugin implementations. It is good practice to avoid checking in of generated / derived sources.

After checkout of the mentioned projects the projects won't be compilable, since the source folders are empty after checkout. The svn-ignore property on this folder is configured with value "*", i.e. no content will be checked in.

To generate the implementation for the projects right-click on GenerateDatamodelDSL.mwe2 (in package org.edna.datamodel of project org.edna.datamodel.language) and select Run As / MWE2 Workflow from the context menu. On the console the following output will appear.

0    [main] INFO  lipse.emf.mwe.utils.StandaloneSetup  - Registering platform uri '/Users/thoms/Documents/Kunden/ESRF/workspace'
734  [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning /Users/thoms/Documents/Kunden/ESRF/workspace/org.edna.datamodel.language/../org.edna.datamodel.language/src-gen
743  [main] INFO  ipse.emf.mwe.utils.DirectoryCleaner  - Cleaning /Users/thoms/Documents/Kunden/ESRF/workspace/org.edna.datamodel.language/../org.edna.datamodel.language.ui/src-gen
958  [main] INFO  ipse.xtext.generator.LanguageConfig  - generating infrastructure for org.edna.datamodel.Datamodel with fragments : ImplicitRuntimeFragment, ImplicitUiFragment, GrammarAccessFragment, EcoreGeneratorFragment, ParseTreeConstructorFragment, ResourceFactoryFragment, XtextAntlrGeneratorFragment, JavaValidatorFragment, ImportNamespacesScopingFragment, QualifiedNamesFragment, BuilderIntegrationFragment, FormatterFragment, LabelProviderFragment, TransformerFragment, OutlineNodeAdapterFactoryFragment, QuickOutlineFragment, QuickfixProviderFragment, JavaBasedContentAssistFragment, XtextAntlrUiGeneratorFragment
12300 [main] INFO  or.validation.JavaValidatorFragment  - executing generate for org.eclipse.xtext.generator.validation.JavaValidatorFragment
13295 [main] INFO  .emf.mwe2.runtime.workflow.Workflow  - Done.

After this generation step the implementation should be available in the src-gen folders of both projects and the projects will be compilable.