Skip to main content
Version: 0.1.4

Setting up the development environment

IntelliJ IDEA​

We prefer IntelliJ IDEA as a Java development environment. No special preparations should be necessary for importing the project as a Gradle project into IDEA:

  1. See the required tools for compiling Refinery on obtaining the required JDK version. You’ll also need a version of IntelliJ IDEA that supports Java 21 (version 2023.3 or later).

  2. Clone the project git repository and open it in IntelliJ IDEA. Make sure to open the project instead of creating a new one in the same directory.

  3. IntelliJ IDEA should build and index the project. If there are errors, it is likely that the JAVA_HOME was incorrectly set:

    • In Project Structure > Project settings > Project > SDK, a Java 21 compatible JDK should be selected.
    • In Project Structure > Project settings > Project > Language level, either SDK default or 21 should be selected.
    • Make sure that each module in Project Structure > Project settings > Module uses the Project default language level in Sources > Language level and the Project SDK in Dependencies > Module SDK.
    • In Settings > Gradle settings > Gradle Projects > Gradle, the Distribution should be set to Wrapper and the Gradle JVM should be set to Project SDK.
  4. We recommend installing the latest SonarLint plugin in Settings > Plugins to get real-time code quality analysis in your IDE.

note

You’ll need Eclipse to edit Xtext (*.xtext) and MWE2 (*.mwe2) files and Ecore class diagrams (*.aird, *.ecore, *.genmodel). If you do not plan on making changes to such files, feel free to skip the Eclipse installation steps below.

You’ll also need VS Code to edit the TypeScript code in Refinery.

Eclipse​

  1. See the required tools for compiling Refinery on obtaining the required JDK version.

  2. Download and extract the Eclipse IDE for Java and DSL Developers 2023-12 package.

  3. Launch Eclipse and create a new workspace.

  4. Open Help > Eclipse Marketplace and install the following software:

    • EclEmma Java Code Coverage
    • EcoreTools : Ecore Diagram Editor
    • Sirius (ignore the warning during installation about the solution Sirius not being available)
    • SonarLint
  5. Open Window > Preferences and set the following preferences:

    • General > Workspace > Text file encoding should be UTF-8.
    • General > Workspace > New text file line delimiter should be Unix.
    • Add the JDK 21 to Java > Installed JREs.
    • Make sure JDK 21 is selected for JavaSE-21 at Java > Installed JREs > Execution Environments.
    • Set Gradle > Java home to the JAVA_HOME directory (the directory which contains the bin directory) of JDK 21. Here, Buildship will show a yellow warning sign, which can be safely ignored.
    • Set Java > Compiler > JDK Compliance > Compiler compliance level to 21.
  6. Clone the project Git repository but do not import it into Eclipse yet.

  7. Open a new terminal and run

    ./gradlew prepareEclipse

    in the cloned repository.

  8. Select File > Import… > Gradle > Existing Gradle Project and import the cloned repository in Eclipse.

    • Make sure to select the root of the repository (containing this file) as the Project root directory and that the Gradle distribution is Gradle wrapper.
    • If you have previously imported the project into Eclipse, this step will likely fail. In that case, you should remove the projects from Eclipse, run git clean -fxd in the repository, and start over from step 8.

VS Code​

We recommend VSCodium or Visual Studio Code to work with the parts of Refinery that are written is TypeScript.

  1. See the required tools for compiling Refinery on obtaining the required JDK version.

  2. Install the following VS Code extensions:

  3. Clone the project Git repository but do not import it into VS Code yet.

  4. Run

    ./gradlew installFrontend

    to install all required Node.js tooling.

  5. Open the repository with Open Folder… in VS Code.

    • When asked, select that you Trust the folder.
    • When asked, enable using the TypeScript and ESLint tooling specified in the repository.