From b534e77d62010355be31b7093061c72296cfd758 Mon Sep 17 00:00:00 2001 From: Zak Date: Thu, 13 Jan 2022 12:40:36 +0000 Subject: [PATCH] Clean up gradle file --- build.gradle.kts | 6 +++--- .../pink/zak/minestom/operadora/config/OperadoraMeta.java | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 7b20bd8..2a26224 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -41,8 +41,8 @@ tasks { processResources { expand(mapOf( "version" to version, - "build_number" to if (System.getenv("BUILD_NUMBER") == null) "unknown" else System.getenv("BUILD_NUMBER"), - "commit_hash" to if (System.getenv("BUILD_VCS_NUMBER") == null) "unknown" else System.getenv("BUILD_VCS_NUMBER") + "build_number" to if (hasProperty("BUILD_NUMBER")) System.getenv("BUILD_NUMBER") else "unknown", + "commit_hash" to if (hasProperty("BUILD_VCS_NUMBER")) System.getenv("BUILD_VCS_NUMBER") else "unknown" )) } named("test") { @@ -63,7 +63,7 @@ publishing { } repositories { maven { - val isSnapshot = System.getenv("BUILD_NUMBER") != null + val isSnapshot = hasProperty("BUILD_NUMBER") url = uri(mavenRepo + (if (isSnapshot) "/snapshots" else "/releases")) credentials { diff --git a/src/main/java/pink/zak/minestom/operadora/config/OperadoraMeta.java b/src/main/java/pink/zak/minestom/operadora/config/OperadoraMeta.java index b6fd837..24eddaa 100644 --- a/src/main/java/pink/zak/minestom/operadora/config/OperadoraMeta.java +++ b/src/main/java/pink/zak/minestom/operadora/config/OperadoraMeta.java @@ -13,15 +13,13 @@ public static OperadoraMeta load() { try { String jsonString = new String(FileUtils.class.getClassLoader().getResourceAsStream("operadora.json").readAllBytes()); JsonObject jsonObject = JsonParser.parseString(jsonString).getAsJsonObject(); - System.out.println(jsonString); - System.out.println(jsonObject); return new OperadoraMeta( jsonObject.get("version").getAsString(), jsonObject.get("buildNumber").getAsString(), jsonObject.get("commitHash").getAsString() ); } catch (Exception ex) { - LOGGER.error("Error loading OperadoraMeta (MANIFEST.MF)", ex); + LOGGER.error("Error loading OperadoraMeta", ex); return null; } }