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:2.0.3"}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:2.0.3")} -
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>2.0.3</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.
-
Go to the Releases page and download the JAR of the version you want to use.
-
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
libfolder and move the JARs inside this folder -
Add all JARs to your classpath
Minimal example
Section titled “Minimal example”The following code can be used to verify whether the installation of Pine was succesful or not. If no exception is thrown and a blank window opens, that means everything is working.
public class Main {
public static void main(String[] args) { new ApplicationBuilder().build().run(); }
}