From 46483489305d043497994072b490b813671708e6 Mon Sep 17 00:00:00 2001 From: Evan Fiordeliso Date: Mon, 6 Nov 2023 19:42:01 -0500 Subject: [PATCH] Add template expansions --- .gitea/template | 4 + .idea/uiDesigner.xml | 124 ++++++++++++++++++ build.gradle.kts | 2 +- devenv.nix | 2 +- settings.gradle.kts | 2 +- .../${REPO_NAME_PASCAL}.kt} | 5 +- src/main/resources/plugin.yml | 10 +- 7 files changed, 138 insertions(+), 11 deletions(-) create mode 100644 .gitea/template create mode 100644 .idea/uiDesigner.xml rename src/main/kotlin/net/fifitido/{templateplugin/TemplatePlugin.kt => ${REPO_NAME_SNAKE}/${REPO_NAME_PASCAL}.kt} (67%) diff --git a/.gitea/template b/.gitea/template new file mode 100644 index 0000000..4013dce --- /dev/null +++ b/.gitea/template @@ -0,0 +1,4 @@ +src/main/resources/plugin.yml +build.grade.kts +devenv.nix +settings.gradle.kts \ No newline at end of file diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml new file mode 100644 index 0000000..2b63946 --- /dev/null +++ b/.idea/uiDesigner.xml @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 95fd697..80853c1 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -3,7 +3,7 @@ plugins { id("io.papermc.paperweight.userdev") version "1.5.9" } -group = "org.example" +group = "net.fifitido.${REPO_NAME_SNAKE}" version = "1.0-SNAPSHOT" repositories { diff --git a/devenv.nix b/devenv.nix index ae37daf..78603b5 100644 --- a/devenv.nix +++ b/devenv.nix @@ -2,7 +2,7 @@ { # https://devenv.sh/basics/ - env.NAME = "mc-plugin"; + env.NAME = "$REPO_NAME"; # https://devenv.sh/packages/ packages = with pkgs;[ diff --git a/settings.gradle.kts b/settings.gradle.kts index 055adb3..3324ad9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -9,4 +9,4 @@ plugins { id("org.gradle.toolchains.foojay-resolver-convention") version "0.5.0" } -rootProject.name = "mc-plugin" \ No newline at end of file +rootProject.name = "${REPO_NAME_SNAKE}" \ No newline at end of file diff --git a/src/main/kotlin/net/fifitido/templateplugin/TemplatePlugin.kt b/src/main/kotlin/net/fifitido/${REPO_NAME_SNAKE}/${REPO_NAME_PASCAL}.kt similarity index 67% rename from src/main/kotlin/net/fifitido/templateplugin/TemplatePlugin.kt rename to src/main/kotlin/net/fifitido/${REPO_NAME_SNAKE}/${REPO_NAME_PASCAL}.kt index ec7004e..7858f97 100644 --- a/src/main/kotlin/net/fifitido/templateplugin/TemplatePlugin.kt +++ b/src/main/kotlin/net/fifitido/${REPO_NAME_SNAKE}/${REPO_NAME_PASCAL}.kt @@ -1,9 +1,8 @@ -package net.fifitido.templateplugin +package net.fifitido.${REPO_NAME_SNAKE} import net.kyori.adventure.text.Component -import org.bukkit.plugin.java.JavaPlugin -class TemplatePlugin : JavaPlugin() { +class ${REPO_NAME_PASCAL} : JavaPlugin() { override fun onEnable() { componentLogger.info(Component.text("Plugin Enabled")) } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 934c73b..c35cd41 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -1,7 +1,7 @@ -name: ExamplePlugin +name: ${REPO_NAME} version: 1.0.0 -main: net.fifitido.templateplugin.TemplatePlugin -description: A template plugin -author: FiFiTiDo -website: https://fifitido.net +main: net.fifitido.${REPO_NAME_SNAKE}.${REPO_NAME_PASCAL} +description: ${REPO_DESCRIPTION} +author: ${REPO_OWNER} +website: ${REPO_LINK} api-version: '1.20' \ No newline at end of file