Build and Develop
Before you dive into contributing to Punkt, let's get your environment set up and ready to build.
Welcome to the developer guide! We are thrilled that you are interested in building Punkt from source. This guide will walk you through the process step-by-step.
Prerequisites
Before we begin, you will need to ensure your development environment is equipped with the right tools. Please refer to the official documentation for the following dependencies to get them installed on your machine:
A note on versions: Since Punkt does not distribute standard JARs, we have the luxury of always staying on the cutting edge. We generally target the very latest version of Kotlin available, and then select the most recent compatible versions for our other dependencies.
Clone the Project
Clone the project from the GitHub repository with:
git clone https://github.com/anson-ryea/punkt.gitInitialising the Project
Once you have cloned the repository and have your dependencies sorted, you can initialise the project just as you would with any standard Gradle project. Pop open your terminal and run:
./gradlew initRunning the Application
The project utilises the Gradle application plugin, making it quite straightforward to run directly from the source. You can fire it up with:
./gradlew runHowever, as Punkt is a command-line interface (CLI) tool, you will likely want to pass arguments to it to see it in action. You can do this using the --args flag.
For instance, if you wished to execute the equivalent of punkt list ~/audrey, you would run the following command:
./gradlew run --args="list ~/audrey"Testing and Building Native Images
While the previous step ran the application on the JVM, Punkt is designed to be distributed as a GraalVM native image executable. It is crucial to ensure that your changes not only work on the JVM but also survive the native compilation process and pass all tests in that environment.
To run the test suite natively, please use:
./gradlew nativeTestWhen you are ready to build the final native executable:
./gradlew nativeBuildOnce the build completes, you can find your shiny new executable waiting for you in the build/native/nativeImage directory. Give it a spin to make sure everything is ship-shape!