From f331afe3397f3e560da2bf6102fc2ee5d9e3abe6 Mon Sep 17 00:00:00 2001 From: Benj Date: Wed, 22 Jun 2022 09:24:11 +0800 Subject: [PATCH 1/2] Refix Javadoc and readd getPlugin comments --- .../emu/grasscutter/auth/ExternalAuthenticator.java | 12 ++++++------ .../java/emu/grasscutter/plugin/PluginManager.java | 5 +++++ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/main/java/emu/grasscutter/auth/ExternalAuthenticator.java b/src/main/java/emu/grasscutter/auth/ExternalAuthenticator.java index 6bf78af6e..16c3f5b9e 100644 --- a/src/main/java/emu/grasscutter/auth/ExternalAuthenticator.java +++ b/src/main/java/emu/grasscutter/auth/ExternalAuthenticator.java @@ -16,18 +16,18 @@ public interface ExternalAuthenticator { /** * Called when an external account creation request is made. * @param request The authentication request. - * - * For developers: Use {@link AuthenticationRequest#getRequest()} to get the request body. - * Use {@link AuthenticationRequest#getResponse()} to get the response body. + * + * For developers: Use AuthenticationRequest#getRequest() to get the request body. + * Use AuthenticationRequest#getResponse() to get the response body. */ void handleAccountCreation(AuthenticationRequest request); /** * Called when an external password reset request is made. * @param request The authentication request. - * - * For developers: Use {@link AuthenticationRequest#getRequest()} to get the request body. - * Use {@link AuthenticationRequest#getResponse()} to get the response body. + * + * For developers: Use AuthenticationRequest#getRequest() to get the request body. + * Use AuthenticationRequest#getResponse() to get the response body. */ void handlePasswordReset(AuthenticationRequest request); } diff --git a/src/main/java/emu/grasscutter/plugin/PluginManager.java b/src/main/java/emu/grasscutter/plugin/PluginManager.java index f6f1cfbf7..756d32a0f 100644 --- a/src/main/java/emu/grasscutter/plugin/PluginManager.java +++ b/src/main/java/emu/grasscutter/plugin/PluginManager.java @@ -171,6 +171,11 @@ public final class PluginManager { .toList().forEach(handler -> this.invokeHandler(event, handler)); } + /** + * Gets a plugin's instance by its name. + * @param name The name of the plugin. + * @return Either null, or the plugin's instance. + */ public Plugin getPlugin(String name) { return this.plugins.get(name); } From b5c6b4795eaa58b07528460737c5084d9f7d1b15 Mon Sep 17 00:00:00 2001 From: Benj Date: Wed, 22 Jun 2022 09:24:43 +0800 Subject: [PATCH 2/2] Set up publishing to 4benj-maven for dev builds --- build.gradle | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index 630646f75..32a3948c7 100644 --- a/build.gradle +++ b/build.gradle @@ -116,7 +116,7 @@ jar { from { configurations.runtimeClasspath.collect { it.isDirectory() ? it : zipTree(it) } } - + duplicatesStrategy = DuplicatesStrategy.INCLUDE from('src/main/java') { @@ -171,13 +171,23 @@ publishing { } repositories { maven { - // change URLs to point to your repos, e.g. http://my.org/repo - def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' - def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' - url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl + if(version.endsWith('-dev')) { + println ("Publishing to 4benj-maven") + url 'https://repo.4benj.com/releases' + name '4benj-maven' + credentials { + username System.getenv('benj_maven_username') + password System.getenv('benj_maven_token') + } + } else { + println ("Publishing to sonatype") + def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/' + def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/' + url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl - name = 'sonatype' - credentials(PasswordCredentials) + name = 'sonatype' + credentials(PasswordCredentials) + } } } } @@ -225,7 +235,9 @@ eclipse { } signing { - sign publishing.publications.mavenJava + if(!version.endsWith('-dev')) { + sign publishing.publications.mavenJava + } } javadoc {