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_DIR
with the root directory of your project, which should include yourpine-config.json
file. -
Test your application by executing the
.exe
file in the subdirectory/pine
inside your build directory. -
To distribute your application, copy the entire parent directory of your
.exe
file, including the/JRE
and/resources
folder and theversion.txt
file.
Gradle task
Alternatively, you can set up a gradle task to run the build tool with fewer steps:
-
Edit your
build.gradle
file 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