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.
Configuration
Section titled “Configuration”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"}-
Build your project.
Terminal window gradle build -
Start the build tool by executing the
dev.prozilla.pine.tools.BuildToolclass and passing the root directory of your project, which should include yourpine-config.jsonfile, as an argument. -
Test your application by executing the
.exefile in the subdirectory/pineinside your build directory. -
To distribute your application, copy all contents of the directory with the
.exefile inside it, or simply copy the zip file that is automatically created by default.
Gradle task
Section titled “Gradle task”A gradle task can be set up like this in order to run the build tool with fewer steps:
-
Edit your
build.gradlefile and add the following lines:build.gradle tasks.register("export", JavaExec) {mainClass = "dev.prozilla.pine.tools.BuildTool"classpath = configurations.runtimeClasspathargs = ["."]} -
If you would like to automatically run the build tool every time you build your project, add the following line to your
build.gradlefile:tasks.named("build") { finalizedBy("export") } -
To manually create an executable, run the following command:
Terminal window gradle export
Windows Installer
Section titled “Windows Installer”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.
Debugging
Section titled “Debugging”The build tool stores temporary files in a /tmp folder inside your build directory, which can give you more insights about the build process.