From 2f373adad401b8620e8e0d5ee62dd560d231db3b Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Wed, 6 Sep 2023 11:30:10 +1000 Subject: [PATCH] [ci skip] Update Blossom --- common/build.gradle.kts | 13 ++++++++++--- .../viaversion/viabackwards/utils/VersionInfo.java | 13 +++++++++++-- settings.gradle.kts | 3 ++- 3 files changed, 23 insertions(+), 6 deletions(-) rename common/src/main/{java => java-templates}/com/viaversion/viabackwards/utils/VersionInfo.java (71%) diff --git a/common/build.gradle.kts b/common/build.gradle.kts index 5d73703f..bb927cf6 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -1,10 +1,17 @@ plugins { id("net.kyori.blossom") + id("org.jetbrains.gradle.plugin.idea-ext") } -blossom { - replaceToken("\$VERSION", project.version) - replaceToken("\$IMPL_VERSION", "git-ViaBackwards-${project.version}:${rootProject.latestCommitHash()}") +sourceSets { + main { + blossom { + javaSources { + property("version", project.version.toString()) + property("impl_version", "git-ViaBackwards-${project.version}:${rootProject.latestCommitHash()}") + } + } + } } dependencies { diff --git a/common/src/main/java/com/viaversion/viabackwards/utils/VersionInfo.java b/common/src/main/java-templates/com/viaversion/viabackwards/utils/VersionInfo.java similarity index 71% rename from common/src/main/java/com/viaversion/viabackwards/utils/VersionInfo.java rename to common/src/main/java-templates/com/viaversion/viabackwards/utils/VersionInfo.java index d83be259..7bc3b1ba 100644 --- a/common/src/main/java/com/viaversion/viabackwards/utils/VersionInfo.java +++ b/common/src/main/java-templates/com/viaversion/viabackwards/utils/VersionInfo.java @@ -17,7 +17,16 @@ */ package com.viaversion.viabackwards.utils; -public class VersionInfo { +public final class VersionInfo { - public static final String VERSION = "$VERSION"; + public static final String VERSION = "{{ version }}"; + private static final String IMPLEMENTATION_VERSION = "{{ impl_version }}"; + + public static String getVersion() { + return VERSION; + } + + public static String getImplementationVersion() { + return IMPLEMENTATION_VERSION; + } } diff --git a/settings.gradle.kts b/settings.gradle.kts index 3d4d4dfa..b422af03 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -15,7 +15,8 @@ dependencyResolutionManagement { pluginManagement { plugins { - id("net.kyori.blossom") version "1.3.1" + id("net.kyori.blossom") version "2.0.1" + id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.7" id("com.github.johnrengelman.shadow") version "8.1.1" } }