Using an Integrated Development Environment

The Platform does not include an Integrated Development Environment but such a tool is a must have for development activities. Typical options include JetBrains IntelliJ IDEA (the Community Edition is available for free) and Microsoft Visual Studio Code (free).

The project you can generate as described in Chapter Generating the Application Structure, will be fully configured to compile with Gradle. It can be run either from the command line using, for example, gradlew bootRun or through Docker. This section explains how you can work on this project using an Integrated Development Environment, such as JetBrains IntelliJ IDEA.

Note:

Note that the Platform code uses the Spring boot library, so we recommend using IntelliJ Ultimate edition that provides enhanced support for it.

To start working on your project under IntelliJ, simply open it. IntelliJ will then detect the presence of Gradle build scripts and will import the information they contain to create the project structure in terms of IntelliJ modules, dependencies, external libraries, etc.

There are several ways to open a project in IntelliJ. When you launch IntelliJ for the first time, you are presented with a splash dialog with several options: choose Open.... Then, if you already have a project open in IntelliJ, select the File > Open... menu entry. In all cases, choose the root directory of your project in the file chooser that appears.

In addition to the Java processing capabilities of IntelliJ, you can easily configure it to develop and debug Python code as follows:

To configure IntelliJ for Python

Information regarding other products than the Platform is subject to change without notice.

  1. Install the JetBrain Python plugin for IntelliJ.

    If you have not yet initialized the Python virtual environment, open a terminal and run ./gradlew pythonInitVirtualenv. Remember to do it every time you update Python dependencies.

  2. If you have not yet initialized the Python virtual environment, open a terminal and run ./gradlew pythonInitVirtualenv. Remember to do it if you update Python dependencies. For more details, please refer to Section Using Gradle Configuration Files.

  3. From the IntelliJ menu, click on File > Project Structure. A pop-up window opens.

  4. In Section SDKs, add the value virtualenv generated by Gradle as follows:

    1. Click on the button +.

    2. Select Existing environment and provide the Interpreter from one of the following directories:

      • <project-root>/.gradle/python/virtualenv/bin/python on Linux.

      • <project-root>\.gradle\python\virtualenv\Scripts\python.exe on Windows.

      Select Existing environment and provide the Interpreter from directory .gradle/python/virtualenv/bin/python located at the root of the project.

      Selecting the Python Environment in IntelliJ

  5. In the section Modules, import the Python modules for the project as follows:

    1. Click on the button +.

    2. Select the following files:

      • gene-model/gene-model-dom-python/python/python.gene-model-dom-python.iml

      • processing/python-engine/python/python.python-engine.iml

      • workers/python-engine-worker/worker-shell/python.worker-shell-python.iml

      Adding the Project Python Modules to IntelliJ

You can now develop with IntelliJ, run tests with debug, navigate through the code, etc.

You can also use IntelliJ to debug your running Python worker by adding breakpoints.

To Add Debug Breakpoints into Python Workers using IntelliJ

Information regarding other products than the Platform is subject to change without notice.

  1. From the IntelliJ tab left tool bar, click on Services. The tab opens.

  2. In the Tab toolbar, click on the menu item + Add Service > Run Configuration Type > Gradle. The configuration is updated.

  3. In the Tab toolbar, click on the menu item + Add Service > Run Configuration Type > Python Debug Server. The configuration is updated.

  4. Start the Python Engine Worker run configuration in debug mode through IntelliJ. For more details, please refer to the Official IntelliJ documentation.

  5. Start the Python Debug Server run configuration.

  6. Then, you can add breakpoints into your Python code. For more details, please refer to the Official Python documentation.