Skip to content

Build from Source

wiki de pasquale edited this page Aug 22, 2022 · 2 revisions

Building GraalVM binary

  1. Install GraalVM

    • GraalVM is a substitution for JDK, you don't generally need another one, if you don't depend on specific functionality or performance of another JDK
    • Simplest way is to use brew cask as described here otherwise use static installation available for download here
    • Follow the installation closely, you will need to link bin folder to path and fix permissions on macOS
  2. Install Native Image

    • You will use gu to install native-image, tutorial here
  3. Checkout the project

    • Use your favorite tool to download this project
    • Unzip (if applicable) and cd to the directory
  4. Build runnable Jar

    • ./gradlew shadowJar
    • This step builds the utility and prepares jar files for following step
  5. Build Native Image

    • native-image --no-fallback -cp dragapult.app.MainKt -jar dragapult-app/build/libs/dragapult-app.jar dragapult
    • It optimizes code, injects runtime dependencies and wraps the utility with self executable binary. Please note that it will only build a binary that's applicable on your local machine. If you need to run it on some other system, use a host system to build it for you. Otherwise Matrix build on Github Actions works too.
  6. Done!

    • You should see a dragapult binary ready to use in root directory of your project.
Clone this wiki locally