From 9320767934f64956a260a848290ab4b77d6241f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hasan=20Demirta=C5=9F?= Date: Tue, 20 Feb 2024 20:44:57 +0300 Subject: [PATCH] fix publishing. (#103) * add publishing again. * Update build.gradle.kts * fix javadoc links. --- build.gradle.kts | 37 +++++++ .../java/tr/com/infumia/agones4j/Agones.java | 98 +++++++++---------- 2 files changed, 86 insertions(+), 49 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index de02fbc..5996525 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,6 +3,7 @@ import com.google.protobuf.gradle.id plugins { java `java-library` + `maven-publish` alias(libs.plugins.protobuf) } @@ -79,3 +80,39 @@ tasks { duplicatesStrategy = DuplicatesStrategy.EXCLUDE } } + +publishing { + publications { + create("mavenJava") { + groupId = project.group.toString() + artifactId = "agones4j" + version = project.version.toString() + from(components["java"]) + artifact(tasks["sourcesJar"]) + artifact(tasks["javadocJar"]) + pom { + name.set("Agones4J") + description.set("Java wrapper for Agones client SDK.") + url.set("https://infumia.com.tr/") + licenses { + license { + name.set("MIT License") + url.set("https://mit-license.org/license.txt") + } + } + developers { + developer { + id.set("portlek") + name.set("Hasan Demirtaş") + email.set("utsukushihito@outlook.com") + } + } + scm { + connection.set("scm:git:git://github.com/infumia/agones4j.git") + developerConnection.set("scm:git:ssh://github.com/infumia/agones4j.git") + url.set("https://github.com/infumia/agones4j") + } + } + } + } +} diff --git a/src/main/java/tr/com/infumia/agones4j/Agones.java b/src/main/java/tr/com/infumia/agones4j/Agones.java index b6ec078..6441fcc 100644 --- a/src/main/java/tr/com/infumia/agones4j/Agones.java +++ b/src/main/java/tr/com/infumia/agones4j/Agones.java @@ -115,14 +115,14 @@ default CompletableFuture allocateFuture() { } /** - * Retrieves the current {@link Sdk.GameServer} data. + * Retrieves the current GameServer data. * * @param response the response from server. */ void getGameServer(StreamObserver response); /** - * Retrieves the current {@link Sdk.GameServer} data. + * Retrieves the current GameServer data. * * @return A future that represents the current game server. */ @@ -131,21 +131,21 @@ default CompletableFuture getGameServerFuture() { } /** - * Call when the {@link Sdk.GameServer} is ready. + * Call when the GameServer is ready. * * @param response the response from server. */ void ready(StreamObserver response); /** - * Call when the {@link Sdk.GameServer} is ready. + * Call when the GameServer is ready. */ default void ready() { this.ready(Internal.observerEmpty()); } /** - * Call when the {@link Sdk.GameServer} is ready. + * Call when the @link Sdk.GameServer is ready. * * @return A future that represents the result of the ready operation. */ @@ -154,7 +154,7 @@ default CompletableFuture readyFuture() { } /** - * Marks the {@link Sdk.GameServer} as the Reserved state for Duration. + * Marks the @link Sdk.GameServer as the Reserved state for Duration. * * @param duration the duration to mark. * @param response the response from server. @@ -162,7 +162,7 @@ default CompletableFuture readyFuture() { void reserve(Duration duration, StreamObserver response); /** - * Marks the {@link Sdk.GameServer} as the Reserved state for Duration. + * Marks the @link Sdk.GameServer as the Reserved state for Duration. * * @param duration the duration to mark. */ @@ -171,7 +171,7 @@ default void reserve(final Duration duration) { } /** - * Marks the {@link Sdk.GameServer} as the Reserved state for Duration. + * Marks the @link Sdk.GameServer as the Reserved state for Duration. * * @param duration the duration to mark. * @@ -182,21 +182,21 @@ default CompletableFuture reserveFuture(final Duration duration) { } /** - * Call when the {@link Sdk.GameServer} is shutting down. + * Call when the @link Sdk.GameServer is shutting down. * * @param response the response from server. */ void shutdown(StreamObserver response); /** - * Call when the {@link Sdk.GameServer} is shutting down. + * Call when the @link Sdk.GameServer is shutting down. */ default void shutdown() { this.shutdown(Internal.observerEmpty()); } /** - * Call when the {@link Sdk.GameServer} is shutting down. + * Call when the @link Sdk.GameServer is shutting down. * * @return A future that represents the result of the shutdown operation. */ @@ -205,7 +205,7 @@ default CompletableFuture shutdownFuture() { } /** - * Apply an Annotation to the backing {@link Sdk.GameServer} metadata. + * Apply an Annotation to the backing @link Sdk.GameServer metadata. * * @param key the key to apply. * @param value the value to apply. @@ -214,7 +214,7 @@ default CompletableFuture shutdownFuture() { void setAnnotation(String key, String value, StreamObserver observer); /** - * Apply an Annotation to the backing {@link Sdk.GameServer} metadata. + * Apply an Annotation to the backing @link Sdk.GameServer metadata. * * @param key the key to apply. * @param value the value to apply. @@ -224,7 +224,7 @@ default void setAnnotation(final String key, final String value) { } /** - * Apply an Annotation to the backing {@link Sdk.GameServer} metadata. + * Apply an Annotation to the backing @link Sdk.GameServer metadata. * * @param key the key to apply. * @param value the value to apply. @@ -236,7 +236,7 @@ default CompletableFuture setAnnotationFuture(final String key, final } /** - * Apply a Label to the backing {@link Sdk.GameServer} metadata. + * Apply a Label to the backing @link Sdk.GameServer metadata. * * @param key the key to apply. * @param value the value to apply. @@ -245,7 +245,7 @@ default CompletableFuture setAnnotationFuture(final String key, final void setLabel(String key, String value, StreamObserver response); /** - * Apply a Label to the backing {@link Sdk.GameServer} metadata. + * Apply a Label to the backing @link Sdk.GameServer metadata. * * @param key the key to apply. * @param value the value to apply. @@ -255,7 +255,7 @@ default void setLabel(final String key, final String value) { } /** - * Apply a Label to the backing {@link Sdk.GameServer} metadata. + * Apply a Label to the backing @link Sdk.GameServer metadata. * * @param key the key to apply. * @param value the value to apply. @@ -270,9 +270,9 @@ default CompletableFuture setLabelFuture(final String key, final Stri * Returns the list of the currently connected player ids. *

* This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the - * {@link Sdk.GameServer} status resource. + * @link Sdk.GameServer status resource. *

- * If {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} is set manually through the Kubernetes API, use + * If GameServer#Status#PlayerStatus#getIdsList is set manually through the Kubernetes API, use * {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. * * @param response the response from server. @@ -283,9 +283,9 @@ default CompletableFuture setLabelFuture(final String key, final Stri * Returns the list of the currently connected player ids. *

* This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the - * {@link Sdk.GameServer} status resource. + * @link Sdk.GameServer status resource. *

- * If {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} is set manually through the Kubernetes API, use + * If GameServer#Status#PlayerStatus#getIdsList is set manually through the Kubernetes API, use * {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. * * @return A future that represents the list of the currently connected player ids. @@ -295,9 +295,9 @@ default CompletableFuture> getConnectedPlayersFuture() { } /** - * Increases the SDK’s stored player count by one, and appends this playerID to {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()}. + * Increases the SDK’s stored player count by one, and appends this playerID to GameServer#Status#PlayerStatus#getIdsList. *

- * {@link Sdk.GameServer.Status.PlayerStatus#getCount()} and {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} are then set to update the player count and id list a second from now, unless there is already an update pending, in which case the update joins that batch operation. + * GameServer#Status#PlayerStatus#getCount and GameServer#Status#PlayerStatus#getIdsList are then set to update the player count and id list a second from now, unless there is already an update pending, in which case the update joins that batch operation. *

* The response returns true and adds the playerID to the list of playerIDs if this playerID was not already in the list of connected playerIDs. *

@@ -306,7 +306,7 @@ default CompletableFuture> getConnectedPlayersFuture() { * An error will be returned if the playerID was not already in the list of connected playerIDs but the player capacity for the server has been reached. * The playerID will not be added to the list of playerIDs. *

- * WARNING: Do not use this method if you are manually managing {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} and {@link Sdk.GameServer.Status.PlayerStatus#getCount()} through the Kubernetes API, as indeterminate results will occur. + * WARNING: Do not use this method if you are manually managing GameServer#Status#PlayerStatus#getIdsList and GameServer#Status#PlayerStatus#getCount through the Kubernetes API, as indeterminate results will occur. * * @param playerId the player id to connect. * @param response the response from server. @@ -314,15 +314,15 @@ default CompletableFuture> getConnectedPlayersFuture() { void playerConnect(String playerId, StreamObserver response); /** - * Increases the SDK’s stored player count by one, and appends this playerID to {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()}. - * {@link Sdk.GameServer.Status.PlayerStatus#getCount()} and {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} are then set to update the player count and id list a second from now, unless there is already an update pending, in which case the update joins that batch operation. + * Increases the SDK’s stored player count by one, and appends this playerID to GameServer#Status#PlayerStatus#getIdsList. + * GameServer#Status#PlayerStatus#getCount and GameServer#Status#PlayerStatus#getIdsList are then set to update the player count and id list a second from now, unless there is already an update pending, in which case the update joins that batch operation. *

* If the playerID exists within the list of connected playerIDs, will return false, and the list of connected playerIDs will be left unchanged. *

* An error will be returned if the playerID was not already in the list of connected playerIDs but the player capacity for the server has been reached. * The playerID will not be added to the list of playerIDs. *

- * WARNING: Do not use this method if you are manually managing {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} and {@link Sdk.GameServer.Status.PlayerStatus#getCount()} through the Kubernetes API, as indeterminate results will occur. + * WARNING: Do not use this method if you are manually managing GameServer#Status#PlayerStatus#getIdsList and GameServer#Status#PlayerStatus#getCount through the Kubernetes API, as indeterminate results will occur. * * @param playerId the player id to connect. * @@ -333,14 +333,14 @@ default CompletableFuture playerConnectFuture(final String playerId) { } /** - * Decreases the SDK’s stored player count by one, and removes the playerID from {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} - * {@link Sdk.GameServer.Status.PlayerStatus#getCount()} and {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} are then set to update the player count and id list a second from now, unless there is already an update pending, in which case the update joins that batch operation. + * Decreases the SDK’s stored player count by one, and removes the playerID from GameServer#Status#PlayerStatus#getIdsList + * GameServer#Status#PlayerStatus#getCount and GameServer#Status#PlayerStatus#getIdsList are then set to update the player count and id list a second from now, unless there is already an update pending, in which case the update joins that batch operation. *

* The response returns true and removes the playerID from the list of connected playerIDs if the playerID value exists within the list. *

* If the playerID was not in the list of connected playerIDs, the call will return false, and the connected playerID list will be left unchanged. *

- * WARNING: Do not use this method if you are manually managing {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} and {@link Sdk.GameServer.Status.PlayerStatus#getCount()} through the Kubernetes API, as indeterminate results will occur. + * WARNING: Do not use this method if you are manually managing GameServer#Status#PlayerStatus#getIdsList and GameServer#Status#PlayerStatus#getCount through the Kubernetes API, as indeterminate results will occur. * * @param playerId the player id to disconnect. * @param response the response from server. @@ -348,12 +348,12 @@ default CompletableFuture playerConnectFuture(final String playerId) { void playerDisconnect(String playerId, StreamObserver response); /** - * Decreases the SDK’s stored player count by one, and removes the playerID from {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} - * {@link Sdk.GameServer.Status.PlayerStatus#getCount()} and {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} are then set to update the player count and id list a second from now, unless there is already an update pending, in which case the update joins that batch operation. + * Decreases the SDK’s stored player count by one, and removes the playerID from GameServer#Status#PlayerStatus#getIdsList + * GameServer#Status#PlayerStatus#getCount and GameServer#Status#PlayerStatus#getIdsList are then set to update the player count and id list a second from now, unless there is already an update pending, in which case the update joins that batch operation. *

* If the playerID was not in the list of connected playerIDs, the call will return false, and the connected playerID list will be left unchanged. *

- * WARNING: Do not use this method if you are manually managing {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} and {@link Sdk.GameServer.Status.PlayerStatus#getCount()} through the Kubernetes API, as indeterminate results will occur. + * WARNING: Do not use this method if you are manually managing GameServer#Status#PlayerStatus#getIdsList and GameServer#Status#PlayerStatus#getCount through the Kubernetes API, as indeterminate results will occur. * * @param playerId the player id to disconnect. * @@ -364,11 +364,11 @@ default CompletableFuture playerDisconnectFuture(final String playerId) } /** - * Returns if the playerID is currently connected to the {@link Sdk.GameServer}. + * Returns if the playerID is currently connected to the @link Sdk.GameServer. *

- * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the {@link Sdk.GameServer} status resource. + * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the @link Sdk.GameServer status resource. *

- * If {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to determine connected status. + * If GameServer#Status#PlayerStatus#getIdsList is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to determine connected status. * * @param playerId the player id to return. * @param response the response from server. @@ -376,11 +376,11 @@ default CompletableFuture playerDisconnectFuture(final String playerId) void isPlayerConnected(String playerId, StreamObserver response); /** - * Returns if the playerID is currently connected to the {@link Sdk.GameServer}. + * Returns if the playerID is currently connected to the @link Sdk.GameServer. *

- * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the {@link Sdk.GameServer} status resource. + * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the @link Sdk.GameServer status resource. *

- * If {@link Sdk.GameServer.Status.PlayerStatus#getIdsList()} is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to determine connected status. + * If GameServer#Status#PlayerStatus#getIdsList is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to determine connected status. * * @param playerId the player id to return. * @@ -391,7 +391,7 @@ default CompletableFuture isPlayerConnected(final String playerId) { } /** - * Update the {@link Sdk.GameServer.Status.PlayerStatus#getCapacity()} value with a new capacity. + * Update the GameServer#Status#PlayerStatus#getCapacity value with a new capacity. * * @param capacity the capacity to update. * @param response the response from server. @@ -399,7 +399,7 @@ default CompletableFuture isPlayerConnected(final String playerId) { void setPlayerCapacity(long capacity, StreamObserver response); /** - * Update the {@link Sdk.GameServer.Status.PlayerStatus#getCapacity()} value with a new capacity. + * Update the GameServer#Status#PlayerStatus#getCapacity value with a new capacity. * * @param capacity the capacity to update. * @@ -412,9 +412,9 @@ default CompletableFuture setPlayerCapacityFuture(final long capaci /** * Retrieves the current player capacity. *

- * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the {@link Sdk.GameServer} status resource. + * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the @link Sdk.GameServer status resource. *

- * If {@link Sdk.GameServer.Status.PlayerStatus#getCapacity()} is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. + * If GameServer#Status#PlayerStatus#getCapacity is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. * * @param response the response from server. */ @@ -423,9 +423,9 @@ default CompletableFuture setPlayerCapacityFuture(final long capaci /** * Retrieves the current player capacity. *

- * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the {@link Sdk.GameServer} status resource. + * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the @link Sdk.GameServer status resource. *

- * If {@link Sdk.GameServer.Status.PlayerStatus#getCapacity()} is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. + * If GameServer#Status#PlayerStatus#getCapacity is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. * * @return A future that represents the current player capacity. */ @@ -436,9 +436,9 @@ default CompletableFuture getPlayerCapacityFuture() { /** * Retrieves the current player count. *

- * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the {@link Sdk.GameServer} status resource. + * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the @link Sdk.GameServer status resource. *

- * If {@link Sdk.GameServer.Status.PlayerStatus#getCount()} is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. + * If GameServer#Status#PlayerStatus#getCount is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. * * @param response the response from server. */ @@ -447,9 +447,9 @@ default CompletableFuture getPlayerCapacityFuture() { /** * Retrieves the current player count. *

- * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the {@link Sdk.GameServer} status resource. + * This is always accurate from what has been set through this SDK, even if the value has yet to be updated on the @link Sdk.GameServer status resource. *

- * If {@link Sdk.GameServer.Status.PlayerStatus#getCount()} is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. + * If GameServer#Status#PlayerStatus#getCount is set manually through the Kubernetes API, use {@link Agones#getGameServerFuture()} or {@link Agones#addGameServerWatcher(Consumer)} instead to view this value. * * @return A future that represents the current player count. */