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.
Before running the build tool, make sure you create a configuration file for your application.
-
Build your project.
Terminal window gradle build -
Start the build tool with
gradle :pine:runBuildTool ROOT_DIR. ReplaceROOT_DIRwith the root directory of your project, which should include yourpine-config.jsonfile. -
Test your application by executing the
.exefile in the subdirectory/pineinside your build directory. -
To distribute your application, copy the entire parent directory of your
.exefile, including the/JREand/resourcesfolder and theversion.txtfile.
Gradle task
Section titled “Gradle task”Alternatively, you can set up a gradle task to run the build tool with fewer steps:
-
Edit your
build.gradlefile and add the following lines:build.gradle tasks.register("createExe") {doLast {def buildTask = tasks.getByPath(":pine:runBuildTool")buildTask.args = [projectDir.absolutePath] // Pass the project directory as an argumentbuildTask.exec()}} -
If you would like to automatically run the build tool every time your build your project, add the following line to
build.gradle:tasks.named("build") { finalizedBy("createExe") } -
To manually create an exe, run the following command:
Terminal window gradle createExe