Gitnuro/DEVELOPMENT.md
2023-09-20 19:57:25 +02:00

2.2 KiB

Developing Gitnuro

Setting up an IDE

If you don't have another preference, the recommendation is to download and install IntelliJ IDEA Community Edition (possibly through the JetBrains Toolbox, if you have it already). The recommended plugins to improve the DX are:

By default, the JDK used by "IntelliJ IDEA Community Edition (2023.1.3)" is "JetBrains Runtime version 21" which is not currently supported by the project.

Alternative: Setting up JDK for use on CLI

You don't need this if you only use the JDK installed by IntelliJ IDEA.

Check which Java version this project currently uses (cat build.gradle.kts | grep JavaLanguageVersion) and install it. For instance on Debian-based systems, you'd run:

sudo apt-get install openjdk-17-jre openjdk-17-jdk libssh-dev
export JAVA_HOME=/usr/lib/jvm/java-17-openjdk-amd64

Once it works (e.g. ./gradlew build), you may want to add that latter line to your /etc/environment.

Running the app / unit tests

From the "Gradle" window in the IDE, under "Tasks" select "compose desktop > run" or "verification > test" for the main app or unit tests, respectively, and run it. Next time, it will already be in the "Run Configurations" at the top right of the IDE, so you won't have to open the "Gradle" window again. You can also run these in debug mode and set break points in the code.

Alternatively on CLI: ./gradlew run or ./gradlew test.

Setting up Rust

Gitnuro is mainly written in Kotlin (JVM) but also uses Rust for some specific tasks. To set up your Rust environment, please read its documentation. Cargo and rustc must be available in the path in order to build Gitnuro properly.

You may need to install perl to build OpenSSL. This can be an issues specially in Windows, where perl is not installed by default.