Setting up the EMF-IncQuery Development Environment
Outdated page
This page is now maintained in the Eclipse wiki: http://wiki.eclipse.org/EMFIncQuery/DeveloperDocumentation/DevEnvironment
The rest of the page is preserved here only for archive purposes.
Prerequisites
-
Eclipse Modeling Tools 3.7.2 distribution (also works with 3.8.x and 4.2.x)
- Other Eclipse distributions might work as well, but this contains EMF-related plug-ins
- Newer Eclipse versions should also work (we regularly test and develop with Eclipse 4.2 Juno)
-
Xtext and Xtend 2.3
- Earlier versions will not work
- Currently install 2.3 from http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/
- Xtext/Xtend 2.4 will also not work
-
EGit (and JGit) - required components for downloading source from Git
- Available from Eclipse Juno update site: http://download.eclipse.org/releases/juno
- Version 1.1 is not recommended - it often throws exceptions during usage
Downloading IncQuery source projects from Git
The project is available at http://eclipse.org/incquery. To download it, you shoud point your Git client to http://git.eclipse.org/c/incquery/org.eclipse.incquery.git/ and after obtaining a local git repository on your hard disk, import the Eclipse plug-in projects under the plugins/ subfolder into your Eclipse workspace.
For details, see the Eclipse EGit help and the Git tutorial from Lars Vogel.
Important: Do not forget to set up your name and email address in your local Git repository - Git identifies your commits using your email address.
Generating the Editor Components
The projects contain both manually written and generated code. They are placed in different source folders: all src folders contain only manually written code, all src-gen and xtend-gen folders contain generated code.
- The src-gen folders contain code generated by the Xtext code generation workflows. These files are not committed into Git; they are to generated in the workspace after cloning and after changes of the grammar or workflow files.
- The xtend-gen files contain code generated from Xtend files. These files do have dependencies of the Xtext workflow-generated files: before the workflow was executed, it is normal for these files to be erroneous.
Xtext code generation workflows
In order to generate editor and parser code, execute the mwe2 code generation workflows by right clicking to the files below, and selecting Run as | MWW2 Workflow in the following order:
- org.eclipse.incquery.patternlanguage/src/org.eclipse.incquery.patternlanguage/GeneratePatternLanguage.mwe2
- org.eclipse.incquery.patternlanguage.emf/src/org.eclipse.incquery.patternlanguage.emf/GenerateEMFPatternLanguage.mwe2: Type "y" in the console window to download antlr and finish code generation.
- org.eclipse.incquery.tooling.generator.model/src/org.eclipse.incquery.tooling.generator.model/GenerateGeneratorModel.mwe2: Type "y" in the console window to download antlr and finish code generation.
After issuing code generation, Eclipse should warn you about compile errors in the projects. To resolve them (by generating the missing code), click "Proceed". All workflow files require about 30-60 seconds to run - be patient.
Xtend code generation
Xtend files are used for code generation and some other reasons in language projects and tests. After the Xtext code generation workflows are executed, it might be required to clean the projects with xtend files, otherwise they do not find the freshly generated java code. (It is the easiest to issue a clean all and then build the entire workspace.)
Optional dependencies
Zest and Graphiti are marked as dependencies of optional supplementary components. You can either install these external plug-ins from the Juno update site, or just close the projects depending on them (as they are non-essential).