Skip to content

Distribution

The Pine engine includes a build tool to distribute your games as executables, using Launch4j. The build tool also bundles the resources and a JRE.

The build tool can be configured with a pine-config.json file in your root directory. Information about all options can be found on the Javadoc page.

{
"mainClass": "com.example.Main",
"gameName": "Example App",
"jar": "build/libs/example-app-1.0.0.0-all.jar"
}
  1. Build your project.

    Terminal window
    gradle build
  2. Start the build tool by executing the dev.prozilla.pine.tools.BuildTool class and passing the root directory of your project, which should include your pine-config.json file, as an argument.

  3. Test your application by executing the .exe file in the subdirectory /pine inside your build directory.

  4. To distribute your application, copy all contents of the directory with the .exe file inside it, or simply copy the zip file that is automatically created by default.

A gradle task can be set up like this in order to run the build tool with fewer steps:

  1. Edit your build.gradle file and add the following lines:

    build.gradle
    tasks.register("export", JavaExec) {
    mainClass = "dev.prozilla.pine.tools.BuildTool"
    classpath = configurations.runtimeClasspath
    args = ["."]
    }
  2. If you would like to automatically run the build tool every time you build your project, add the following line to your build.gradle file:

    tasks.named("build") { finalizedBy("export") }
  3. To manually create an executable, run the following command:

    Terminal window
    gradle export

To make it easier for Windows users to install your application, the build tool can be configured to create a Windows installer using NSIS. This is done by setting includeInstaller to true in your configuration file.

The build tool stores temporary files in a /tmp folder inside your build directory, which can give you more insights about the build process.