Skip to content

Commit

Permalink
Merge pull request #25 from Over-Run/jdk22
Browse files Browse the repository at this point in the history
Bump to JDK 22
  • Loading branch information
squid233 authored Jan 6, 2024
2 parents 1b6ea56 + 5d8650f commit 5322b3e
Show file tree
Hide file tree
Showing 68 changed files with 1,050 additions and 1,032 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
strategy:
matrix:
java: [
21
22-ea
]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
Expand All @@ -25,7 +25,7 @@ jobs:
with:
java-version: |
${{ matrix.java }}
# 20
21
distribution: 'temurin'
- name: Grant execute permission for gradlew
if: ${{ runner.os != 'Windows' }}
Expand All @@ -42,7 +42,7 @@ jobs:
path: |
modules/**/build/reports/
- name: Capture build artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '21' }}
if: ${{ runner.os == 'Linux' && matrix.java == '22-ea' }}
uses: actions/upload-artifact@v3
with:
name: Artifacts
Expand Down
20 changes: 16 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,34 @@
![Maven Central](https://img.shields.io/maven-central/v/io.github.over-run/overrungl)
![Sonatype Nexus (Snapshots)](https://img.shields.io/nexus/s/io.github.over-run/overrungl?server=https%3A%2F%2Fs01.oss.sonatype.org%2F)

![GitHub repo size](https://img.shields.io/github/repo-size/Over-Run/overrungl)
[![Java CI with Gradle](https://github.com/Over-Run/overrungl/actions/workflows/gradle.yml/badge.svg?event=push)](https://github.com/Over-Run/overrungl/actions/workflows/gradle.yml)
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8279/badge)](https://www.bestpractices.dev/projects/8279)

## Introduction

Overrun Game Library is a high-performance library implemented with Java 21,
enables cross-platform access to a set of C/C++ library bindings, and provides some useful utilities.
Overrun Game Library is a high-performance library implemented with Java 22,
which enables cross-platform access to a set of C/C++ library bindings, and provides some useful utilities.

### OverrunGL vs. LWJGL

[LWJGL 3](https://github.com/LWJGL/lwjgl3) is also a Java library that enables native access.

LWJGL 3 uses JNI to access native functions,
but OverrunGL uses [FFM API](https://openjdk.org/jeps/442), which has better performance.
but OverrunGL uses [FFM API](https://openjdk.org/jeps/454), which has better performance.

## Getting Started

You can check our [wiki](https://github.com/Over-Run/overrungl/wiki) or
the [samples](modules/samples/src/test/java/overrungl/demo).

### Enable native access

You must enable the access of OverrunGL by adding a VM argument or a manifest attribute.

```
--enable-preview-access=overrungl.core,...
```

## Using as a Dependency

~~The libraries are available on Maven Central.~~ Currently, we are developing with the first version, and it is very
Expand Down Expand Up @@ -93,6 +101,10 @@ Javadoc can be found [here](https://over-run.github.io/overrungl-doc/).

The documentation of OpenGL can be found [here](https://docs.gl/).

### Credits

[<img src="https://resources.jetbrains.com/storage/products/company/brand/logos/jb_beam.png" alt="JetBrains Logo (Main) logo." width="128" height="128">](https://jb.gg/OpenSourceSupport)

### Publishing (for internal member)

To publish this library, you need a GPG key and the write permission of Maven Central.
Expand Down
4 changes: 2 additions & 2 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

## Supported Versions

We are currently working on 0.x versions
We are currently working on 0.x versions,
and only the latest version will be supported.

| Version | Supported |
| ------- | ------------------ |
|---------|--------------------|
| 0.1.x | :white_check_mark: |

## Reporting a Vulnerability
Expand Down
18 changes: 12 additions & 6 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import org.gradle.plugins.ide.idea.model.IdeaModel
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import org.jetbrains.kotlin.utils.addToStdlib.ifTrue
import java.nio.file.Files
import kotlin.io.path.Path

Expand Down Expand Up @@ -219,10 +220,12 @@ tasks.register("assembleJavadocArgs") {
doLast {
Files.deleteIfExists(mspFile)

Files.writeString(mspFile, """
Files.writeString(
mspFile, """
--module-source-path
${rootProject.projectDir.path}/modules/*/src/main/java
""".trimIndent())
""".trimIndent()
)
}
}

Expand All @@ -246,7 +249,9 @@ allprojects {
tasks.withType<Javadoc> {
options {
if (this is CoreJavadocOptions) {
addBooleanOption("-enable-preview", true)
if (jdkEnablePreview.toBoolean()) {
addBooleanOption("-enable-preview", true)
}
addStringOption("source", targetJavaVersion.toString())
if (this is StandardJavadocDocletOptions) {
charSet = "UTF-8"
Expand All @@ -269,9 +274,10 @@ allprojects {
"glfw.note:m:Note:"
)

bottom = "<a href=\"https://github.com/Over-Run/overrungl/issues\">Report a bug or suggest an enhancement</a><br>" +
"Copyright © 2022-$projLicenseYear Overrun Organization<br>" +
"<b>$projVersion</b>"
bottom =
"<a href=\"https://github.com/Over-Run/overrungl/issues\">Report a bug or suggest an enhancement</a><br>" +
"Copyright © 2022-$projLicenseYear Overrun Organization<br>" +
"<b>$projVersion</b>"
}
}
encoding = "UTF-8"
Expand Down
6 changes: 3 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ projName=overrungl
projVersion=0.1.0-SNAPSHOT
projVcs=Over-Run/overrungl
projBranch=main
projLicenseYear=2023
projLicenseYear=2024

# Organization
orgName=Overrun Organization
orgUrl=https://over-run.github.io/

jdkVersion=21
jdkVersion=22
jdkEnablePreview=true
#jdkEarlyAccessDoc=jdk22
jdkEarlyAccessDoc=jdk22
kotlinTargetJdkVersion=21

projModules=core, glfw, nfd, joml, opengl, stb
Expand Down
2 changes: 1 addition & 1 deletion modules/overrungl.core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
val overrunPlatformVersion: String by rootProject

dependencies {
implementation("io.github.over-run:platform:$overrunPlatformVersion")
api("io.github.over-run:platform:$overrunPlatformVersion")
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* MIT License
*
* Copyright (c) 2022-2023 Overrun Organization
* Copyright (c) 2022-2024 Overrun Organization
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
Expand All @@ -17,7 +17,7 @@
package overrungl;

import overrungl.internal.Exceptions;
import overrungl.util.MemoryUtil;
import overrungl.internal.RuntimeHelper;

import java.lang.foreign.FunctionDescriptor;
import java.lang.foreign.ValueLayout;
Expand All @@ -38,13 +38,14 @@
* case 'F' -> JAVA_FLOAT;
* case 'D' -> JAVA_DOUBLE;
* case 'P' -> ADDRESS;
* case 'p' -> MemoryUtil.ADDRESS_UNBOUNDED;
* default -> throw new IllegalArgumentException();
* }}
*
* @author squid233
* @since 0.1.0
* @deprecated This class is going to be removed (but is not marked as removal).
*/
@Deprecated(since = "0.1.0")
public enum FunctionDescriptors {
// 1
D, F, I, J, P, p, V,
Expand Down Expand Up @@ -123,9 +124,9 @@ public static ValueLayout ofValue(char c) throws IllegalArgumentException {
case 'F' -> JAVA_FLOAT;
case 'D' -> JAVA_DOUBLE;
case 'P' -> ADDRESS;
case 'p' -> MemoryUtil.ADDRESS_UNBOUNDED;
case 'p' -> RuntimeHelper.ADDRESS_UNBOUNDED;
default ->
throw Exceptions.IAE. "Invalid argument c: expected one of B, S, I, J, C, Z, F, D, P or p; got '\{ c }'" ;
throw Exceptions.IAE."Invalid argument c: expected one of B, S, I, J, C, Z, F, D or P; got '\{c}'";
};
}

Expand Down
Loading

0 comments on commit 5322b3e

Please sign in to comment.