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:
-
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).
-
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.
-
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.
-
We recommend installing the latest SonarLint plugin in Settings > Plugins to get real-time code quality analysis in your IDE.
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​
-
See the required tools for compiling Refinery on obtaining the required JDK version.
-
Download and extract the Eclipse IDE for Java and DSL Developers 2023-12 package.
-
Launch Eclipse and create a new workspace.
-
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
-
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 thebin
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.
-
Clone the project Git repository but do not import it into Eclipse yet.
-
Open a new terminal and run
- Linux or macOS
- Windows (PowerShell)
./gradlew prepareEclipse
.\gradlew prepareEclipse
in the cloned repository.
- This should complete without any compilation errors.
- To troubleshoot any error, see the instructions for compiling Refinery.
-
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.
-
See the required tools for compiling Refinery on obtaining the required JDK version.
-
Install the following VS Code extensions:
- EditorConfig for VS Code [Open VSX] [Extension Marketplace]
- ESLint [Open VSX] [Extension Marketplace]
- MDX [Open VSX] [Extension Marketplace]
- Prettier - Code formatter [Open VSX] [Extension Marketplace]
- XState VSCode [Open VSX] [Extension Marketplace]
- ZipFS - a zip file system [Open VSX] [Extension Marketplace]
-
Clone the project Git repository but do not import it into VS Code yet.
-
Run
- Linux or macOS
- Windows (PowerShell)
./gradlew installFrontend
.\gradlew installFrontend
to install all required Node.js tooling.
-
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.