Skip to content

Building from source

There are two ways to build from source: using IntelliJ IDEA, or manually. Using IntelliJ is the preferred method, as the IDE streamlines the process.

Using IntelliJ

To begin, install IntelliJ. Both the Ultimate and Community versions are compatible.

Cloning from source

If you are wanting to contribute changes to the source code, you should fork the GitHub repository first using your GitHub account. You can find more information on forking on this GitHub Docs page.

If you do not plan to submit your changes, you can clone the base repository.

At the IntelliJ home screen, click Get from VCS. In the URL field, enter the URL of the repository to clone. This is either the URL of your forked repository, or the base repository: https://github.com/wyskoj/midis2jam2. Click Clone.

Find more information on Git cloning on this IntelliJ help page.

Info

If you do not have Git installed on your machine, IntelliJ will prompt you to automatically install it before proceeding.

Project Configuration

Minimal configuration is required to begin building and contributing.

Select the JDK

IntelliJ needs to know what Java Development Kit to use.

First, enter the File | Project Structure window. Next to SDK, select a JDK that is at least version 17. If you do not have a JDK installed, select Add SDK | Download JDK. Select 17 as the version, and Amazon Corretto as the vendor. Click Download, then choose it in the list. Click OK to save changes.

Find more information on selecting a JDK on this IntelliJ help page.

Create a run configuration

IntelliJ needs to know how to start the app.

First, enter the Run | Edit Configurations window. Click Add new run configuration, and select Gradle. In the Tasks and arguments field, type run. Click OK to save changes.

Find more information on configuring a run configuration on this IntelliJ help page.

Reload Gradle

Finally, open the Gradle tab on the right side of the editor. Click the Reload All Gradle Projects button.

Starting the app

Press the Play button at the top of the screen to begin to app, or press Shift + F10.

Note

Reloading the Gradle project may make some time before IntelliJ can start the app.

Manually

Some manual installation of software is necessary:

Software Purpose
Git Download source code
JDK 17 Compile source code

Compile the source code with JDK (Java Development Kit) 17. Other versions of the JDK may not work. Amazon Corretto is the recommended vendor, but other JDK vendors may work.

Use the terminal to run commands. On Windows, use the Command Prompt or PowerShell. On macOS, use the Terminal app. On Linux, use the Terminal app or any other terminal emulator.

Finally, use an IDE to edit the source code. IntelliJ IDEA is the recommended IDE, but any IDE that supports Kotlin will work. Text editors like Visual Studio Code also work.

Downloading the source code

To download the source code, run the following command:

git clone https://github.com/wyskoj/midis2jam2

Note

The preceding command downloads the latest version of the source code. It may be unstable. To download a stable version of the source code, run this command instead:

git clone --branch vX.X.X https://github.com/wyskoj/midis2jam2

Replace X.X.X with the desired version. The list of versions is available on the tags page at GitHub.

Building the app

To build and run the app, run the following command:

./gradlew run

To build the app without running it, run the following command:

./gradlew build

To package the app to a JAR file, run the following command:

./gradlew shadowJar