Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EMFIncQuery/DeveloperDocumentation/DevEnvironment

< EMFIncQuery
Revision as of 07:07, 18 February 2016 by Harmath.incquerylabs.com (Talk | contribs) (Update and restructure)

Setup

Choose one of the following options:

Manual

Prerequisites

  • Eclipse Modeling Tools 3.7, 3.8, 4.2, 4.3, 4.4 or 4.5 distribution
    • 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.4 and 4.5)
  • Xtext SDK 2.8
    • Xtext update site http://download.eclipse.org/modeling/tmf/xtext/updates/composite/releases/
    • Other versions of Xtext are not supported
    • This also requires a current version of EMF (2.10)
  • Xcore SDK 1.3
  • EGit (and JGit) - required components for downloading source from Git
    • Available from Eclipse release train update site: http://download.eclipse.org/releases/mars

Editor Settings

Code style: slightly modified built-in Eclipse style

  • line width: 120 characters both for code and comments
  • using spaces for indentation

Downloadable style available from File:IncQueryFormatter.xml.zip

Comment templates:

  • Copyright header for each Java file
  • Leaving override annotations out

Downloadable template available from File:Eiq-jdt-templates.xml.zip

Downloading source projects from Git

The project is available in the from the Eclipse repository at http://git.eclipse.org/c/incquery/org.eclipse.incquery.git/. To download it, you can select either clone URLs listed. However, if you want to use the committer account, you have to use the ssh url.

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.

Optional dependencies

Zest, GMF and Graphiti are marked as dependencies of optional supplementary components. You can either install GMF and Graphiti from the Juno update site, while Zest uses the GEF4 version. Alternatively you can just close the projects depending on them (as they are non-essential).

As the GEF4 Zest component is under heavy refactoring, the extra update site of EMF-IncQuery also contains a Zest version known working with the current version.

Automatic (Oomph)

  • Download and run Eclipse Installer
  • Product:
    • Product: Eclipse IDE for Java Developers
    • Product Version: Mars
  • Projects:
  • Variables:
    • Target Platform: Mars

Bootstrapping

Bootstrapping metamodel and grammar code generation

The projects contain both manually written and generated code. They are placed in different source folders: all src folders contain only manually written code, the following folders contain generated code:

  • The emf-gen folders contain code generated by the EMF metamodel generation workflows.
  • The src-gen folders contain code generated by the Xtext code generation workflows.
  • The xtend-gen files contain code generated by the Xtend compiler which is run incrementally. These files do have dependencies of the other workflow-generated files: before the workflow is executed, it is normal for these files to be erroneous.

Generated code is not committed into Git. To ensure that the workspace contains generated code:

  • The Oomph setup runs all workflows in the proper order automatically on bootstrapping the development environment.
  • Whenever a metamodel, grammar or workflow file changes, run the corresponding workflow manually.

Xtext code generator workflows require about 30-60 seconds to run - be patient.

Bootstrapping query code generation

Some components already include VIATRA Query patterns but the generated code is not stored in version control. In order to correctly compile these projects, run the Bootstrap launch configuration and import the following projects:

  • org.eclipse.viatra.addon.viewers.runtime
  • org.eclipse.viatra.addon.viewers.runtime.zest
  • org.eclipse.viatra.cep.core
  • org.eclipse.viatra.cep.core.metamodels
  • org.eclipse.viatra.integration.uml
  • org.eclipse.viatra.query.testing.queries
  • org.eclipse.viatra.query.testing.snapshot
  • org.eclipse.viatra.query.tooling.ui.retevis
  • org.eclipse.viatra.transformation.views

After importing, the VIATRA Query builder should generate the code for each pattern definition as needed.

Notes:

  • You may have to manually open and edit-save the *.vql files to trigger the builder.
  • If you do not use this launch configuration, make sure to exclude these imported projects from it, and either include the metamodel projects required by them in it or import them into the runtime workspace as well.

Back to the top