diff options
author | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-26 22:50:54 +0200 |
---|---|---|
committer | DeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com> | 2022-05-26 22:50:54 +0200 |
commit | f9fa7deb715c024621c9fdfab165629a6997b73c (patch) | |
tree | 33bd1c64b673a8184ffcfa0df960edefaaa1a6a7 | |
parent | 7571e9bbe71c4341d6b596fec9e958704ee71b9d (diff) | |
download | OneConfig-f9fa7deb715c024621c9fdfab165629a6997b73c.tar.gz OneConfig-f9fa7deb715c024621c9fdfab165629a6997b73c.tar.bz2 OneConfig-f9fa7deb715c024621c9fdfab165629a6997b73c.zip |
publishing and rename InternetUtils to NetworkUtils
-rw-r--r-- | build.gradle.kts | 83 | ||||
-rw-r--r-- | gradle.properties | 11 | ||||
-rw-r--r-- | settings.gradle.kts | 1 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java | 4 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java | 10 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java | 4 | ||||
-rw-r--r-- | src/main/java/cc/polyfrost/oneconfig/utils/NetworkUtils.java (renamed from src/main/java/cc/polyfrost/oneconfig/utils/InternetUtils.java) | 2 |
7 files changed, 80 insertions, 35 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 0bddf1f..fb67cc5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -11,6 +11,8 @@ plugins { id("com.github.johnrengelman.shadow") id("net.kyori.blossom") version "1.3.0" id("io.github.juuxel.loom-quiltflower-mini") + id("maven-publish") + id("signing") java } @@ -95,12 +97,12 @@ val lwjglJar by tasks.registering(ShadowJar::class) { group = "shadow" archiveClassifier.set("lwjgl") configurations = listOf(lwjgl) - exclude ("META-INF/versions/**") - exclude ("**/module-info.class") - exclude ("**/package-info.class") + exclude("META-INF/versions/**") + exclude("**/module-info.class") + exclude("**/package-info.class") relocate("org.lwjgl", "org.lwjgl3") { - include ("org.lwjgl.PointerBuffer") - include ("org.lwjgl.BufferUtils") + include("org.lwjgl.PointerBuffer") + include("org.lwjgl.BufferUtils") } } @@ -129,22 +131,22 @@ dependencies { isTransitive = false } - lwjgl ("org.lwjgl:lwjgl:3.3.1") - lwjgl ("org.lwjgl:lwjgl-stb:3.3.1") - lwjgl ("org.lwjgl:lwjgl-tinyfd:3.3.1") - lwjgl ("org.lwjgl:lwjgl-nanovg:3.3.1") - lwjglNative ("org.lwjgl:lwjgl:3.3.1:natives-windows") - lwjglNative ("org.lwjgl:lwjgl-stb:3.3.1:natives-windows") - lwjglNative ("org.lwjgl:lwjgl-tinyfd:3.3.1:natives-windows") - lwjglNative ("org.lwjgl:lwjgl-nanovg:3.3.1:natives-windows") - lwjglNative ("org.lwjgl:lwjgl:3.3.1:natives-linux") - lwjglNative ("org.lwjgl:lwjgl-stb:3.3.1:natives-linux") - lwjglNative ("org.lwjgl:lwjgl-tinyfd:3.3.1:natives-linux") - lwjglNative ("org.lwjgl:lwjgl-nanovg:3.3.1:natives-linux") - lwjglNative ("org.lwjgl:lwjgl:3.3.1:natives-macos") - lwjglNative ("org.lwjgl:lwjgl-stb:3.3.1:natives-macos") - lwjglNative ("org.lwjgl:lwjgl-tinyfd:3.3.1:natives-macos") - lwjglNative ("org.lwjgl:lwjgl-nanovg:3.3.1:natives-macos") + lwjgl("org.lwjgl:lwjgl:3.3.1") + lwjgl("org.lwjgl:lwjgl-stb:3.3.1") + lwjgl("org.lwjgl:lwjgl-tinyfd:3.3.1") + lwjgl("org.lwjgl:lwjgl-nanovg:3.3.1") + lwjglNative("org.lwjgl:lwjgl:3.3.1:natives-windows") + lwjglNative("org.lwjgl:lwjgl-stb:3.3.1:natives-windows") + lwjglNative("org.lwjgl:lwjgl-tinyfd:3.3.1:natives-windows") + lwjglNative("org.lwjgl:lwjgl-nanovg:3.3.1:natives-windows") + lwjglNative("org.lwjgl:lwjgl:3.3.1:natives-linux") + lwjglNative("org.lwjgl:lwjgl-stb:3.3.1:natives-linux") + lwjglNative("org.lwjgl:lwjgl-tinyfd:3.3.1:natives-linux") + lwjglNative("org.lwjgl:lwjgl-nanovg:3.3.1:natives-linux") + lwjglNative("org.lwjgl:lwjgl:3.3.1:natives-macos") + lwjglNative("org.lwjgl:lwjgl-stb:3.3.1:natives-macos") + lwjglNative("org.lwjgl:lwjgl-tinyfd:3.3.1:natives-macos") + lwjglNative("org.lwjgl:lwjgl-nanovg:3.3.1:natives-macos") shade(lwjglJar.get().outputs.files) shade(prebundle(shadeRelocated)) } @@ -256,4 +258,43 @@ afterEvaluate { logger.error("`setupGradle` is in the loom category of your gradle project.") logger.error("--------------") } +} + +publishing { + publications { + register<MavenPublication>("oneconfig-1.8.9-forge") { + groupId = "cc.polyfrost" + artifactId = "oneconfig-1.8.9-forge" + + from(components["java"]) + artifact(tasks["remapJar"]) + } + } + + repositories { + maven { + name = "releases" + url = uri("https://repo.polyfrost.cc/releases") + credentials(PasswordCredentials::class) + authentication { + create<BasicAuthentication>("basic") + } + } + maven { + name = "snapshots" + url = uri("https://repo.polyfrost.cc/snapshots") + credentials(PasswordCredentials::class) + authentication { + create<BasicAuthentication>("basic") + } + } + maven { + name = "private" + url = uri("https://repo.polyfrost.cc/private") + credentials(PasswordCredentials::class) + authentication { + create<BasicAuthentication>("basic") + } + } + } }
\ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 2954b27..bd50c0e 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,7 +1,12 @@ -org.gradle.jvmargs=-Xmx2G mod_name = OneConfig mod_id = oneconfig -mod_version = 1.0.0 +mod_version = 0.1.0 loom.platform = forge -essential.defaults.loom=0
\ No newline at end of file +essential.defaults.loom=0 + +org.gradle.daemon=true +org.gradle.parallel=true +org.gradle.configureoncommand=true +org.gradle.parallel.threads=4 +org.gradle.jvmargs=-Xmx2G
\ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 8cbfd4e..92d73b9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -30,5 +30,4 @@ listOf( projectDir = file("versions/$version") buildFileName = "../../build.gradle.kts" } - }
\ No newline at end of file diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java index e85e223..4e04f5c 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/elements/ColorSelector.java @@ -11,7 +11,7 @@ import cc.polyfrost.oneconfig.lwjgl.image.Images; import cc.polyfrost.oneconfig.lwjgl.image.SVGs; import cc.polyfrost.oneconfig.utils.ColorUtils; import cc.polyfrost.oneconfig.utils.InputUtils; -import cc.polyfrost.oneconfig.utils.InternetUtils; +import cc.polyfrost.oneconfig.utils.NetworkUtils; import cc.polyfrost.oneconfig.utils.MathUtils; import org.lwjgl.input.Mouse; @@ -318,7 +318,7 @@ public class ColorSelector { hueInput.setInput(String.format("%.01f", (float) color.getHue())); hexInput.setInput("#" + color.getHex()); } - if(guideBtn.isClicked()) InternetUtils.browseLink("https://www.youtube.com/watch?v=dQw4w9WgXcQ"); + if(guideBtn.isClicked()) NetworkUtils.browseLink("https://www.youtube.com/watch?v=dQw4w9WgXcQ"); // draw the color preview diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java b/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java index e2c342c..db19226 100644 --- a/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java +++ b/src/main/java/cc/polyfrost/oneconfig/gui/pages/HomePage.java @@ -10,7 +10,7 @@ import cc.polyfrost.oneconfig.lwjgl.font.Fonts; import cc.polyfrost.oneconfig.lwjgl.image.SVGs; import cc.polyfrost.oneconfig.utils.ColorUtils; import cc.polyfrost.oneconfig.utils.InputUtils; -import cc.polyfrost.oneconfig.utils.InternetUtils; +import cc.polyfrost.oneconfig.utils.NetworkUtils; import java.awt.*; @@ -32,11 +32,11 @@ public class HomePage extends Page { public HomePage() { super("Home Dashboard"); - socialsBtn.setClickAction(() -> InternetUtils.browseLink("https://twitter.com/polyfrost")); - discordBtn.setClickAction(() -> InternetUtils.browseLink("https://discord.gg/4BdUuGpMdf")); - webBtn.setClickAction(() -> InternetUtils.browseLink("https://polyfrost.cc")); + socialsBtn.setClickAction(() -> NetworkUtils.browseLink("https://twitter.com/polyfrost")); + discordBtn.setClickAction(() -> NetworkUtils.browseLink("https://discord.gg/4BdUuGpMdf")); + webBtn.setClickAction(() -> NetworkUtils.browseLink("https://polyfrost.cc")); creditsBtn.setClickAction(new CreditsPage()); - guideBtn.setClickAction(() -> InternetUtils.browseLink("https://www.youtube.com/watch?v=dQw4w9WgXcQ")); + guideBtn.setClickAction(() -> NetworkUtils.browseLink("https://www.youtube.com/watch?v=dQw4w9WgXcQ")); } diff --git a/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java b/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java index 8f43aa7..8d68715 100644 --- a/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java +++ b/src/main/java/cc/polyfrost/oneconfig/lwjgl/RenderManager.java @@ -12,7 +12,7 @@ import cc.polyfrost.oneconfig.libs.universal.UGraphics; import cc.polyfrost.oneconfig.libs.universal.UMinecraft; import cc.polyfrost.oneconfig.libs.universal.UResolution; import cc.polyfrost.oneconfig.utils.InputUtils; -import cc.polyfrost.oneconfig.utils.InternetUtils; +import cc.polyfrost.oneconfig.utils.NetworkUtils; import net.minecraft.client.gui.Gui; import net.minecraft.client.shader.Framebuffer; import org.lwjgl.nanovg.*; @@ -199,7 +199,7 @@ public final class RenderManager { float length = getTextWidth(vg, url, size, font); drawRectangle(vg, x, y + size / 2, length, 1, OneConfigConfig.PRIMARY_500); if(InputUtils.isAreaClicked((int) (x - 2), (int) (y - 1), (int) (length + 4), (int) (size / 2 + 3))) { - InternetUtils.browseLink(url); + NetworkUtils.browseLink(url); } } diff --git a/src/main/java/cc/polyfrost/oneconfig/utils/InternetUtils.java b/src/main/java/cc/polyfrost/oneconfig/utils/NetworkUtils.java index 6d6d7ed..3192a2e 100644 --- a/src/main/java/cc/polyfrost/oneconfig/utils/InternetUtils.java +++ b/src/main/java/cc/polyfrost/oneconfig/utils/NetworkUtils.java @@ -11,7 +11,7 @@ import java.net.URL; import java.nio.charset.StandardCharsets; import java.security.MessageDigest; -public class InternetUtils { +public class NetworkUtils { private static InputStream setupConnection(String url, String userAgent, int timeout, boolean useCaches) throws IOException { HttpURLConnection connection = ((HttpURLConnection) new URL(url).openConnection()); connection.setRequestMethod("GET"); |