Installation
The Pine engine is distributed using GitHub Packages. The GitHub Packages docs contain more information about how it works.
Option 1: Use boilerplate project setup
Section titled “Option 1: Use boilerplate project setup”This is the same as option 2, but with most of the work already done for you.
- Fork the Pine-boilerplate repository
- Follow the setup guide in the README file
- Change the package name to something that suits your project (Optional)
Option 2: Install using Gradle
Section titled “Option 2: Install using Gradle”-
In your
build.gradlefile, add the following lines:build.gradle repositories {mavenCentral()maven {url "https://repo.gradle.org/gradle/libs-releases"}maven {url = uri("https://maven.pkg.github.com/prozilla/pine")credentials {username = project.findProperty("gpr.user") ?: System.getenv("USERNAME")password = project.findProperty("gpr.token") ?: System.getenv("TOKEN")}}}dependencies {implementation "dev.prozilla:pine:3.0.1"}build.gradle.kts repositories {mavenCentral()maven {url = uri("https://repo.gradle.org/gradle/libs-releases")}maven {url = uri("https://maven.pkg.github.com/prozilla/pine")credentials {username = findProperty("gpr.user") as String? ?: System.getenv("USERNAME")password = findProperty("gpr.token") as String? ?: System.getenv("TOKEN")}}}dependencies {implementation("dev.prozilla:pine:3.0.1")} -
Create a
gradle.propertiesfile or a.envfile with your environment variables. ReplaceYOUR_USERNAMEandYOUR_TOKENwith your GitHub username and token respectively.gradle.properties gpr.user=YOUR_USERNAMEgpr.token=YOUR_TOKEN.env USERNAME=YOUR_USERNAMETOKEN=YOUR_TOKENMake sure to add this file to
.gitignoreso it remains private.
Option 3: Install using Maven
Section titled “Option 3: Install using Maven”-
In your
pom.xmlfile, add the following lines:pom.xml <repositories><repository><id>gradle-releases</id><url>https://repo.gradle.org/gradle/libs-releases</url></repository><repository><id>pine-github</id><url>https://maven.pkg.github.com/prozilla/pine</url></repository></repositories><dependencies><dependency><groupId>dev.prozilla</groupId><artifactId>pine</artifactId><version>3.0.1</version></dependency></dependencies> -
Create a global
settings.xmlfile in your Maven configuration folder (.m2) that stores your GitHub credentials. ReplaceYOUR_USERNAMEandYOUR_TOKENwith your GitHub username and token respectively..m2/settings.xml <settings><servers><server><id>pine-github</id><username>YOUR_USERNAME</username><password>YOUR_TOKEN</password></server></servers></settings>
Option 4: Using JARs
Section titled “Option 4: Using JARs”It is possible to use Pine by downloading the JARs of Pine and its dependencies and adding them to the classpath. Sources and Javadoc JARs are also available.
This can also be used to install unreleased versions of Pine, like the development branch or a fork, by building Pine from source.
-
Go to the Releases page and download the JAR of the version you want to use, or build Pine from source.
-
Download the JARs of each dependency:
- LWJGL
- Core
- GLFW
- OpenGL
- OpenAL
- stb
- Natives (Determined by the target platform)
- Jackson
- Core
- Databind
- Annotations
- LWJGL
-
Create a
libsfolder and move the JARs inside this folder -
Add all JARs to your classpath
Hybrid usage
Section titled “Hybrid usage”When using a build system, it is possible to only download the Pine JAR manually and to import the other dependencies using said build system.
dependencies { implementation files("libs/pine-engine-3.0.1.jar")
// LWJGL // Use https://www.lwjgl.org/customize to install the required LWJGL packages
// Other Pine dependencies implementation "com.fasterxml.jackson.core:jackson-databind:2.18.1" implementation "org.gradle:gradle-tooling-api:8.8" runtimeOnly "org.slf4j:slf4j-simple:2.0.16"}Minimal example
Section titled “Minimal example”The following code can be used to quickly verify whether the installation of Pine was succesful or not. If no exception is thrown and a blank window opens, that means everything needed to run a Pine application is installed correctly.
public class Main {
public static void main(String[] args) { new ApplicationBuilder().build().run(); }
}