Skip to content

Commit

Permalink
Merge branch 'main' into jdk22
Browse files Browse the repository at this point in the history
  • Loading branch information
squid233 authored Oct 5, 2023
2 parents a750954 + e74a40f commit c53a968
Show file tree
Hide file tree
Showing 76 changed files with 1,305 additions and 1,792 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Feature request
description: Suggest an idea for this project
title: "Feature: "
labels: [ "enhancement", "P4" ]
labels: [ "enhancement", "P5" ]
assignees:
- "squid233"
body:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,15 @@

name: Java CI with Gradle

on: [ push, pull_request ]
on: [ push, pull_request, workflow_dispatch ]

jobs:
build:
strategy:
matrix:
java: [
22-ea
22-ea,
21
]
os: [ ubuntu-latest, windows-latest ]
runs-on: ${{ matrix.os }}
Expand All @@ -25,7 +26,6 @@ jobs:
with:
java-version: |
${{ matrix.java }}
20
distribution: 'temurin'
- name: Grant execute permission for gradlew
if: ${{ runner.os != 'Windows' }}
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ enables cross-platform access to a set of C/C++ library bindings, and provides s
[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/8310626), which has better performance.
but OverrunGL uses [FFM API](https://openjdk.org/jeps/454), which has better performance.

## Getting Started

Expand All @@ -41,7 +41,7 @@ unstable, so you have to use `-SNAPSHOT` version.

You can import with `io.github.over-run:overrungl-bom:{the version}` and other submodules.

We will provide a module customizer soon.
We have provided an artifacts customizer [here](https://over-run.github.io/overrungl-gen/).

### Using -SNAPSHOT Versions

Expand Down Expand Up @@ -119,7 +119,7 @@ natives
│ │ │ └─ libglfw3.so
│ │ └─ x64
│ │ └─ libglfw3.so
│ ├─ os x
│ ├─ macos
│ │ ├─ arm64
│ │ │ └─ libglfw3.dylib
│ │ └─ x64
Expand All @@ -135,7 +135,7 @@ natives
│ │ │ └─ libnfd.so
│ │ └─ x64
│ │ └─ libnfd.so
│ ├─ os x
│ ├─ macos
│ │ ├─ arm64
│ │ │ └─ libnfd.dylib
│ │ └─ x64
Expand All @@ -153,7 +153,7 @@ natives
│ │ └─ libstb.so
│ └─ x64
│ └─ libstb.so
├─ os x
├─ macos
│ ├─ arm64
│ │ └─ libstb.dylib
│ └─ x64
Expand Down
19 changes: 9 additions & 10 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ enum class NativePlatform(
LINUX_64("linux", "x64", "linux", "lib", ".so", "Linux64"),
LINUX_ARM32("linux", "arm32", "linux-arm32", "lib", ".so", "LinuxArm32"),
LINUX_ARM64("linux", "arm64", "linux-arm64", "lib", ".so", "LinuxArm64"),
MACOS("os x", "x64", "macos", "lib", ".dylib", "Macos"),
MACOS_ARM64("os x", "arm64", "macos-arm64", "lib", ".dylib", "MacosArm64");
MACOS("macos", "x64", "macos", "lib", ".dylib", "Macos"),
MACOS_ARM64("macos", "arm64", "macos-arm64", "lib", ".dylib", "MacosArm64");

companion object {
val ALL = values()
Expand Down Expand Up @@ -113,7 +113,7 @@ enum class Artifact(

fun nativeFileName(platform: NativePlatform): String? {
return if (nativeBinding == null) null
else "$nativeBinding/${platform.osFamilyName}/${platform.osArch}/${platform.nativeLibPrefix}${nativeBinding.basename}${platform.nativeLibSuffix}"
else "${nativeBinding.bindingName}/${platform.osFamilyName}/${platform.osArch}/${platform.nativeLibPrefix}${nativeBinding.basename}${platform.nativeLibSuffix}"
}
}

Expand Down Expand Up @@ -197,13 +197,12 @@ subprojects {
archives(tasks["javadocJar"])
}

val idea: IdeaModel by extensions
idea.module.inheritOutputDirs = true
the<IdeaModel>().module.inheritOutputDirs = true
}

tasks.register("assembleJavadocArgs") {
group = "build"
val mspFile = Path("${rootProject.buildDir}/tmp/modulesourcepath.args")
val mspFile = Path("${rootProject.layout.buildDirectory.get().asFile}/tmp/modulesourcepath.args")
outputs.file(mspFile)

doLast {
Expand All @@ -223,13 +222,13 @@ tasks.register<Javadoc>("aggregateJavadoc") {
val projectsToDoc = Artifact.values().map { project(it.subprojectName) }
dependsOn(projectsToDoc.map { it.getTasksByName("classes", true) })
source(projectsToDoc.map { it.sourceSets["main"].java })
destinationDir = file("$buildDir/docs/javadoc")
destinationDir = File("${layout.buildDirectory.get().asFile}/docs/javadoc")

classpath = files(projectsToDoc.map { it.configurations["compileClasspath"].files })

executable = project.findProperty("javadocExecutable") as String?

options.optionFiles = listOf(file("${rootProject.buildDir}/tmp/modulesourcepath.args"))
options.optionFiles = listOf(File("${rootProject.layout.buildDirectory.get().asFile}/tmp/modulesourcepath.args"))
}

allprojects {
Expand Down Expand Up @@ -320,9 +319,9 @@ publishing.publications {
}
module.nativeBinding?.platforms?.forEach {
val nativeName = module.nativeFileName(it)!!
val file = file("${rootProject.projectDir}/natives/$nativeName")
val file = File("${rootProject.projectDir}/natives/$nativeName")
if (file.exists()) {
val nativeParent = file(nativeName).parent
val nativeParent = File(nativeName).parent
artifact(tasks.create<Jar>("nativeJar${module.mavenName}${it.taskSuffix}") {
archiveBaseName.set(module.artifactName)
archiveClassifier.set(it.classifier)
Expand Down
Loading

0 comments on commit c53a968

Please sign in to comment.