Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usages of Marshal #64

Merged
merged 12 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
with:
name: build-reports-${{ runner.os }}-jdk${{ matrix.java }}
path: |
modules/samples/build/reports/
modules/**/build/reports/
- name: Capture build artifacts
uses: actions/upload-artifact@v4
with:
Expand Down
6 changes: 1 addition & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

You are welcome to contribute to OverrunGL.

## Code of Conduct

You must respect the [Code of Conduct](CODE_OF_CONDUCT.md).

## Issues

Issues are only for discussing bugs and proposing new features. For other discussions such as usages,
Expand Down Expand Up @@ -47,5 +43,5 @@ The formatted code:

## Discussions

You can visit [discussions](https://github.com/Over-Run/overrungl/discussions) and create your post, share your experience
You can view [discussions](https://github.com/Over-Run/overrungl/discussions) and create your post, share your experience
or just ask some questions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2022-2024 Overrun Organization
Copyright (c) 2022-2025 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 Down
35 changes: 20 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

![License](https://img.shields.io/github/license/Over-Run/overrungl)

[//]: # (![Maven Central](https://img.shields.io/maven-central/v/io.github.over-run/overrungl))
![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)

[![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)
Expand Down Expand Up @@ -39,8 +39,15 @@ A documentation of the customizer is [here](doc/customizer/doc_on_customizer.md)
- Core module Maven coordinate: `io.github.over-run:overrungl`
- For others: `io.github.over-run:overrungl-<module-name>`

Currently, OverrunGL uses preview features preventing users from using newer JDKs,
so only `-SNAPSHOT` versions are provided at this time.
For example:

```kotlin
dependencies {
implementation(platform("io.github.over-run:overrungl-bom:<VERSION>"))
implementation("io.github.over-run:overrungl")
implementation("io.github.over-run:overrungl-glfw")
}
```

### Using -SNAPSHOT Versions

Expand Down Expand Up @@ -82,16 +89,16 @@ The customizer has already included this.

### [stb](https://github.com/nothings/stb) - single-file public domain libraries for C/C++

| Library | Description |
|------------------|---------------------------------------------------------------------------------|
| stb_easy_font | Quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc. |
| stb_image | Image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC |
| stb_image_resize | Resize images larger/smaller with good quality. |
| stb_image_write | Image writing to disk: PNG, TGA, BMP |
| stb_perlin | Revised Perlin noise (3D input, 1D output). |
| stb_rect_pack | Simple 2D rectangle packer with decent quality. |
| stb_truetype | Parse, decode, and rasterize characters from truetype fonts. |
| stb_vorbis | Decode ogg vorbis files from file/memory to float/16-bit signed output. |
| Library | Description |
|-------------------|---------------------------------------------------------------------------------|
| stb_easy_font | Quick-and-dirty easy-to-deploy bitmap font for printing frame rate, etc. |
| stb_image | Image loading/decoding from file/memory: JPG, PNG, TGA, BMP, PSD, GIF, HDR, PIC |
| stb_image_resize2 | Resize images larger/smaller with good quality. |
| stb_image_write | Image writing to disk: PNG, TGA, BMP |
| stb_perlin | Revised Perlin noise (3D input, 1D output). |
| stb_rect_pack | Simple 2D rectangle packer with decent quality. |
| stb_truetype | Parse, decode, and rasterize characters from truetype fonts. |
| stb_vorbis | Decode ogg vorbis files from file/memory to float/16-bit signed output. |

### Other

Expand All @@ -109,8 +116,6 @@ The latest Javadoc can be found [here](https://over-run.github.io/overrungl/).

The documentation of OpenGL can be found from [Khronos' references](https://registry.khronos.org/OpenGL-Refpages/gl4/) and [docs.gl](https://docs.gl/).

OverrunGL uses [Marshal](https://github.com/Over-Run/marshal).

[JavaPoet](https://github.com/palantir/javapoet) is used to generate source files.

### Credits
Expand Down
29 changes: 20 additions & 9 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* MIT License
*
* Copyright (c) 2025 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*/

plugins {
`java-platform`
`maven-publish`
Expand Down Expand Up @@ -35,20 +51,15 @@ allprojects {
links("https://download.java.net/java/early_access/$jdkEarlyAccessDoc/docs/api/")
}

links(
"https://over-run.github.io/memstack/",
"https://over-run.github.io/marshal/"
)

tags(
"glfw.callback_signature:m:Callback signature:",
"glfw.errors:m:Errors:",
"glfw.note:m:Note:",
"glfw.pointer_lifetime:m:Pointer lifetime:",
"glfw.remark:m:Remarks:",
"glfw.reentrancy:m:Reentrancy:",
"glfw.thread_safety:m:Thread safety:",
"glfw.warning:m:Warning:",
"glfw.reentrancy:m:Reentrancy:",
"glfw.pointer_lifetime:m:Pointer lifetime:",
"glfw.callback_signature:m:Callback signature:",
"glfw.note:m:Note:"
)

bottom =
Expand Down
78 changes: 58 additions & 20 deletions buildSrc/src/main/kotlin/module.conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* MIT License
*
* Copyright (c) 2025 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*/

import org.gradle.plugins.ide.idea.model.IdeaModel

plugins {
Expand All @@ -17,6 +33,7 @@ val jdkEnablePreview: String by rootProject
val targetJavaVersion = jdkVersion.toInt()

val jetbrainsAnnotationsVersion: String by rootProject
val junitVersion: String by rootProject

group = projGroupId
version = projVersion
Expand All @@ -30,6 +47,8 @@ repositories {

dependencies {
compileOnly("org.jetbrains:annotations:$jetbrainsAnnotationsVersion")
testImplementation("org.junit.jupiter:junit-jupiter:$junitVersion")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}

tasks.withType<JavaCompile> {
Expand All @@ -40,6 +59,7 @@ tasks.withType<JavaCompile> {

tasks.withType<Test> {
if (jdkEnablePreview.toBoolean()) jvmArgs("--enable-preview")
useJUnitPlatform()
}

extensions.configure<JavaPluginExtension>("java") {
Expand Down Expand Up @@ -99,26 +119,44 @@ afterEvaluate {
pom {
setupPom(it.projectName, it.projectDescription, "jar")
}
}
overrunglModule.nativeBinding.orNull?.platforms?.forEach { platform ->
getByName<MavenPublication>("overrunglBOM") {
pom {
withXml {
asElement().getElementsByTagName("dependencyManagement").item(0).apply {
asElement().getElementsByTagName("dependencies").item(0).apply {
ownerDocument.createElement("dependency").also(::appendChild).apply {
appendChild(ownerDocument.createElement("groupId")
.also(::appendChild)
.apply { textContent = projGroupId })
appendChild(ownerDocument.createElement("artifactId")
.also(::appendChild)
.apply { textContent = overrunglModule.artifactName.get() })
appendChild(ownerDocument.createElement("version")
.also(::appendChild)
.apply { textContent = projVersion })
appendChild(ownerDocument.createElement("classifier")
.also(::appendChild)
.apply { textContent = platform.classifier })

overrunglModule.nativeBinding.orNull?.also { nativeBinding ->
nativeBinding.platforms.forEach { platform ->
val nativeFileName = nativeFileName(nativeBinding, platform)
val file = rootProject.projectDir.resolve("natives").resolve(nativeFileName)
artifact(tasks.register<Jar>("${nativeBinding.bindingName}${platform.classifier}Jar") {
archiveBaseName.set(overrunglModule.artifactName)
archiveClassifier.set(platform.classifier)
from(file) { into(File(nativeFileName).parent) }
})

getByName<MavenPublication>("overrunglBOM") {
pom {
withXml {
asElement().getElementsByTagName("dependencyManagement").item(0).apply {
asElement().getElementsByTagName("dependencies").item(0).apply {
ownerDocument.createElement("dependency").also(::appendChild)
.apply {
appendChild(
ownerDocument.createElement("groupId")
.also(::appendChild)
.apply { textContent = projGroupId })
appendChild(
ownerDocument.createElement("artifactId")
.also(::appendChild)
.apply {
textContent = overrunglModule.artifactName.get()
})
appendChild(
ownerDocument.createElement("version")
.also(::appendChild)
.apply { textContent = projVersion })
appendChild(
ownerDocument.createElement("classifier")
.also(::appendChild)
.apply { textContent = platform.classifier })
}
}
}
}
}
Expand Down
42 changes: 0 additions & 42 deletions buildSrc/src/main/kotlin/native.conventions.gradle.kts

This file was deleted.

17 changes: 17 additions & 0 deletions buildSrc/src/main/kotlin/submodule.conventions.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,19 @@
/*
* MIT License
*
* Copyright (c) 2025 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*/

plugins {
`java-library`
}
Expand All @@ -6,5 +22,6 @@ val projVersion: String by rootProject

dependencies {
compileOnly(project(":core"))
testImplementation(project(":core"))
constraints { api("io.github.over-run:overrungl:$projVersion") }
}
2 changes: 0 additions & 2 deletions doc/legal/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,4 @@ We redistributed code from these libraries:

Files:

- modules/lwjgl/core/src/main/java/org/lwjgl/system/MemoryManage.java -> [modules/overrungl.core/src/main/java/overrungl/util/DebugAllocator.java](../../modules/overrungl.core/src/main/java/overrungl/util/DebugAllocator.java)
- modules/lwjgl/core/src/main/java9/org/lwjgl/system/StackWalkUtil.java -> [modules/overrungl.core/src/main/java/overrungl/util/StackWalkUtil.java](../../modules/overrungl.core/src/main/java/overrungl/util/StackWalkUtil.java)
- modules/samples/src/test/java/org/lwjgl/demo/util/IOUtil.java -> [modules/samples/src/test/java/overrungl/demo/util/IOUtil.java](../../modules/samples/src/test/java/overrungl/demo/util/IOUtil.java)
9 changes: 9 additions & 0 deletions generators/core/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
plugins {
id("generator.conventions")
}

dependencies {
implementation(project(":generators"))
}

registerGenerateTask("overrungl.CoreGeneratorKt", ":core")
21 changes: 21 additions & 0 deletions generators/core/src/main/kotlin/overrungl/CoreGenerator.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* MIT License
*
* Copyright (c) 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
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*/

package overrungl

fun main() {
memoryStack()
}
Loading
Loading