From db291335704eac00887b0a3fb3ffa711dc809979 Mon Sep 17 00:00:00 2001 From: squid233 <60126026+squid233@users.noreply.github.com> Date: Sun, 26 Jan 2025 23:46:51 +0800 Subject: [PATCH] docs: bump version --- build.gradle.kts | 41 +++++++++++-------- gradle.properties | 2 +- .../src/main/java/overrungl/vulkan/VK.java | 9 ++++ .../overrungl/vulkan/VkCommandBuffer.java | 6 +++ .../main/java/overrungl/vulkan/VkDevice.java | 6 +++ .../vulkan/VkDispatchableHandleDevice.java | 2 + .../vulkan/VkDispatchableHandleInstance.java | 3 ++ .../java/overrungl/vulkan/VkInstance.java | 5 +++ .../overrungl/vulkan/VkPhysicalDevice.java | 6 +++ .../main/java/overrungl/vulkan/VkQueue.java | 6 +++ 10 files changed, 68 insertions(+), 18 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index b4387e3c..dabf4bbd 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,5 @@ +import org.jreleaser.model.Active + /* * MIT License * @@ -17,7 +19,7 @@ plugins { `java-platform` `maven-publish` - signing + id("org.jreleaser") version "1.16.0" } val projGroupId: String by rootProject @@ -77,26 +79,31 @@ publishing.publications { } } -// You have to add `OSSRH_USERNAME`, `OSSRH_PASSWORD`, `signing.keyId`, -// `signing.password` and `signing.secretKeyRingFile` to -// GRADLE_USER_HOME/gradle.properties publishing.repositories { maven { - name = "OSSRH" - credentials { - username = project.findProperty("OSSRH_USERNAME").toString() - password = project.findProperty("OSSRH_PASSWORD").toString() - } - url = uri( - if (projVersion.endsWith("-SNAPSHOT")) - "https://s01.oss.sonatype.org/content/repositories/snapshots/" - else "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" - ) + setUrl(layout.buildDirectory.dir("staging-deploy")) } mavenLocal() } -signing { - if (!projVersion.endsWith("-SNAPSHOT") && System.getProperty("gpg.signing", "true").toBoolean()) - sign(publishing.publications) +// check https://jreleaser.org/guide/latest/examples/maven/maven-central.html#_gradle +jreleaser { + signing { + active = Active.ALWAYS + armored = true + } + deploy { + release { + github.enabled = false + } + maven { + mavenCentral { + create("sonatype") { + active = Active.ALWAYS + url = "https://central.sonatype.com/api/v1/publisher" + stagingRepository("build/staging-deploy") + } + } + } + } } diff --git a/gradle.properties b/gradle.properties index 2f57e288..5b5cc211 100644 --- a/gradle.properties +++ b/gradle.properties @@ -20,7 +20,7 @@ org.gradle.jvmargs=-Dfile.encoding=UTF-8 projGroupId=io.github.over-run projArtifactId=overrungl projName=overrungl -projVersion=0.1.0-alpha.0 +projVersion=0.1.0-alpha.1 projLicenseYear=2022-2025 jdkVersion=23 diff --git a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VK.java b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VK.java index 2bc8734a..e58c62c5 100644 --- a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VK.java +++ b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VK.java @@ -25,12 +25,19 @@ * This class loads the Vulkan library into the JVM process. * * @author squid233 + * @see VKLoadFunc * @since 0.1.0 */ public final class VK { private static VKLoadFunc loadFunc; private static GlobalCommands globalCommands; + private VK() { + } + + /// Loads necessary functions for Vulkan to create [VkInstance] with the given loading function. + /// + /// @param func a function that returns an address of a Vulkan function specified with the given name. this can be `GLFW::glfwGetInstanceProcAddress` public static void create(VKLoadFunc func) { if (loadFunc != null) { throw new IllegalStateException("Vulkan has already been created."); @@ -39,12 +46,14 @@ public static void create(VKLoadFunc func) { globalCommands = new GlobalCommands(func); } + /// Removes loaded functions. public static void destroy() { if (loadFunc == null) return; loadFunc = null; globalCommands = null; } + /// {@return the function for which Vulkan function is acquired} public static VKLoadFunc functionLookup() { return loadFunc; } diff --git a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkCommandBuffer.java b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkCommandBuffer.java index 96819787..d287a8d3 100644 --- a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkCommandBuffer.java +++ b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkCommandBuffer.java @@ -19,12 +19,18 @@ import java.lang.foreign.MemorySegment; /** + * Wraps a Vulkan command buffer handle. + * * @author squid233 * @since 0.1.0 */ public class VkCommandBuffer extends VkDispatchableHandleDevice { private final VkDevice device; + /// Creates a `VkCommandBuffer` using the specified segment and device. + /// + /// @param segment the `VkCommandBuffer` segment + /// @param device the device on which the command buffer was created public VkCommandBuffer(MemorySegment segment, VkDevice device) { super(segment, device.capabilities()); this.device = device; diff --git a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDevice.java b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDevice.java index ac7cce69..fcac2341 100644 --- a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDevice.java +++ b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDevice.java @@ -21,12 +21,18 @@ import java.lang.foreign.MemorySegment; /** + * Wraps a Vulkan device dispatchable handle. + * * @author squid233 * @since 0.1.0 */ public class VkDevice extends VkDispatchableHandleDevice { private final VkPhysicalDevice physicalDevice; + /// Creates a `VkDevice` instance for the specified segment. + /// + /// @param segment the `VkDevice` segment + /// @param physicalDevice the physical device used to create the `VkDevice` public VkDevice(MemorySegment segment, VkPhysicalDevice physicalDevice) { super(segment, getDeviceCapabilities(segment, physicalDevice)); this.physicalDevice = physicalDevice; diff --git a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDispatchableHandleDevice.java b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDispatchableHandleDevice.java index 99594fc0..5f172910 100644 --- a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDispatchableHandleDevice.java +++ b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDispatchableHandleDevice.java @@ -38,9 +38,11 @@ public MemorySegment segment() { return segment; } + /// @return the [VKCapabilitiesDevice] instance associated with this dispatchable handle. public VKCapabilitiesDevice capabilities() { return capabilities; } + /// @return the [VKCapabilitiesInstance] instance associated with this dispatchable handle. public abstract VKCapabilitiesInstance capabilitiesInstance(); } diff --git a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDispatchableHandleInstance.java b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDispatchableHandleInstance.java index 6c5c67a2..2c060fa7 100644 --- a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDispatchableHandleInstance.java +++ b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkDispatchableHandleInstance.java @@ -21,6 +21,8 @@ import java.lang.foreign.MemorySegment; /** + * Base class for Vulkan dispatchable handles. + * * @author squid233 * @since 0.1.0 */ @@ -38,6 +40,7 @@ public MemorySegment segment() { return segment; } + /// @return the {@link VKCapabilitiesInstance} instance associated with this dispatchable handle. public VKCapabilitiesInstance capabilities() { return capabilities; } diff --git a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkInstance.java b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkInstance.java index ceb30887..77dd1f4e 100644 --- a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkInstance.java +++ b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkInstance.java @@ -19,10 +19,15 @@ import java.lang.foreign.MemorySegment; /** + * Wraps a Vulkan instance handle. + * * @author squid233 * @since 0.1.0 */ public class VkInstance extends VkDispatchableHandleInstance { + /// Creates a `VkInstance` instance for the specified segment. + /// + /// @param segment the `VkInstance` segment public VkInstance(MemorySegment segment) { super(segment, getInstanceCapabilities(segment)); } diff --git a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkPhysicalDevice.java b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkPhysicalDevice.java index 9439a7cd..6518b503 100644 --- a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkPhysicalDevice.java +++ b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkPhysicalDevice.java @@ -19,12 +19,18 @@ import java.lang.foreign.MemorySegment; /** + * Wraps a Vulkan physical device handle. + * * @author squid233 * @since 0.1.0 */ public class VkPhysicalDevice extends VkDispatchableHandleInstance { private final VkInstance instance; + /// Creates a `VkPhysicalDevice` using the specified segment and Vulkan instance. + /// + /// @param segment the `VkDevice` segment + /// @param instance the Vulkan instance from which the physical device was enumerated public VkPhysicalDevice(MemorySegment segment, VkInstance instance) { super(segment, instance.capabilities()); this.instance = instance; diff --git a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkQueue.java b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkQueue.java index da9cdcce..50161a70 100644 --- a/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkQueue.java +++ b/modules/overrungl.vulkan/src/main/java/overrungl/vulkan/VkQueue.java @@ -19,12 +19,18 @@ import java.lang.foreign.MemorySegment; /** + * Wraps a Vulkan queue handle. + * * @author squid233 * @since 0.1.0 */ public class VkQueue extends VkDispatchableHandleDevice { private final VkDevice device; + /// Creates a `VkQueue` using the specified segment and device. + /// + /// @param segment the `VkQueue` segment + /// @param device the device from which the queue was retrieved public VkQueue(MemorySegment segment, VkDevice device) { super(segment, device.capabilities()); this.device = device;