diff --git a/build.gradle.kts b/build.gradle.kts index 23995906..23853a65 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,68 +1,52 @@ plugins { - alias(libs.plugins.minotaur) - alias(libs.plugins.hangar) - - `java-plugin` + `maven-publish` + `java-library` } val buildNumber: String? = System.getenv("BUILD_NUMBER") rootProject.version = if (buildNumber != null) "${libs.versions.minecraft.get()}-$buildNumber" else "2.5.1" -val isSnapshot = false - -val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8) - subprojects.filter { it.name != "api" }.forEach { it.project.version = rootProject.version } -modrinth { - token.set(System.getenv("MODRINTH_TOKEN")) - - projectId.set(rootProject.name.lowercase()) - - versionType.set(if (isSnapshot) "beta" else "release") - - versionName.set("${rootProject.name} ${rootProject.version}") - versionNumber.set(rootProject.version as String) - - changelog.set(content) - - uploadFile.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar")) +subprojects { + apply(plugin = "maven-publish") + apply(plugin = "java-library") - gameVersions.set(listOf(libs.versions.minecraft.get())) + group = "com.badbones69.crazyenchantments" + description = "Adds over 80 unique enchantments to your server and more!" - loaders.addAll(listOf("purpur", "paper", "folia")) + repositories { + maven("https://repo.codemc.io/repository/maven-public") - autoAddDependsOn.set(false) - detectLoaders.set(false) -} - -hangarPublish { - publications.register("plugin") { - apiKey.set(System.getenv("HANGAR_KEY")) + maven("https://repo.crazycrew.us/libraries") + maven("https://repo.crazycrew.us/releases") - id.set(rootProject.name.lowercase()) + maven("https://jitpack.io") - version.set(rootProject.version as String) - - channel.set(if (isSnapshot) "Beta" else "Release") + mavenCentral() + } - changelog.set(content) + java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(21)) + } + } - platforms { - paper { - jar.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar")) + tasks { + compileJava { + options.encoding = Charsets.UTF_8.name() + options.release.set(21) + } - platformVersions.set(listOf(libs.versions.minecraft.get())) + javadoc { + options.encoding = Charsets.UTF_8.name() + } - dependencies { - hangar("PlaceholderAPI") { - required = false - } - } - } + processResources { + filteringCharset = Charsets.UTF_8.name() } } } \ No newline at end of file diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts deleted file mode 100644 index 46f9c3f7..00000000 --- a/buildSrc/build.gradle.kts +++ /dev/null @@ -1,3 +0,0 @@ -plugins { - `kotlin-dsl` -} \ No newline at end of file diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts deleted file mode 100644 index 8acdbd52..00000000 --- a/buildSrc/settings.gradle.kts +++ /dev/null @@ -1,7 +0,0 @@ -rootProject.name = "buildSrc" - -dependencyResolutionManagement { - repositories { - mavenCentral() - } -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/java-plugin.gradle.kts b/buildSrc/src/main/kotlin/java-plugin.gradle.kts deleted file mode 100644 index c813141b..00000000 --- a/buildSrc/src/main/kotlin/java-plugin.gradle.kts +++ /dev/null @@ -1,41 +0,0 @@ -plugins { - `maven-publish` - - `java-library` -} - - -repositories { - maven("https://repo.extendedclip.com/content/repositories/placeholderapi") - - maven("https://repo.codemc.io/repository/maven-public") - - maven("https://repo.crazycrew.us/releases") - - maven("https://repo.oraxen.com/releases") - - maven("https://jitpack.io") - - mavenCentral() -} - -java { - toolchain { - languageVersion.set(JavaLanguageVersion.of(21)) - } -} - -tasks { - compileJava { - options.encoding = Charsets.UTF_8.name() - options.release.set(21) - } - - javadoc { - options.encoding = Charsets.UTF_8.name() - } - - processResources { - filteringCharset = Charsets.UTF_8.name() - } -} \ No newline at end of file diff --git a/buildSrc/src/main/kotlin/paper-plugin.gradle.kts b/buildSrc/src/main/kotlin/paper-plugin.gradle.kts deleted file mode 100644 index 3a7ba790..00000000 --- a/buildSrc/src/main/kotlin/paper-plugin.gradle.kts +++ /dev/null @@ -1,17 +0,0 @@ -plugins { - id("java-plugin") -} - -repositories { - maven("https://repo.md-5.net/content/repositories/snapshots/") - - maven("https://ci.ender.zone/plugin/repository/everything/") - - maven("https://repo.papermc.io/repository/maven-public") - - maven("https://repo.glaremasters.me/repository/towny/") - - maven("https://repo.bg-software.com/repository/api/") - - maven("https://maven.enginehub.org/repo/") -} \ No newline at end of file diff --git a/gradle.properties b/gradle.properties deleted file mode 100644 index c1216892..00000000 --- a/gradle.properties +++ /dev/null @@ -1,10 +0,0 @@ -org.gradle.jvmargs = -Xmx3G -org.gradle.daemon = false -org.gradle.parallel = false - -group = com.badbones69.crazyenchantments -authors = ["ryderbelserion", "BadBones69", "TDL"] -description = Adds over 80 unique enchantments to your server and more! -website = https://modrinth.com/plugin/crazyenchantments -sources = https://github.com/Crazy-Crew/CrazyEnchantments -issues = https://github.com/Crazy-Crew/CrazyEnchantments/issues \ No newline at end of file diff --git a/paper/build.gradle.kts b/paper/build.gradle.kts index 18732f87..0ea4f280 100644 --- a/paper/build.gradle.kts +++ b/paper/build.gradle.kts @@ -1,15 +1,30 @@ plugins { - alias(libs.plugins.paperweight) alias(libs.plugins.runPaper) alias(libs.plugins.shadow) - `paper-plugin` + alias(libs.plugins.paperweight) } base { archivesName.set(rootProject.name) } +repositories { + maven("https://repo.papermc.io/repository/maven-public") + + maven("https://repo.md-5.net/content/repositories/snapshots") + + maven("https://ci.ender.zone/plugin/repository/everything") + + maven("https://repo.glaremasters.me/repository/towny") + + maven("https://repo.bg-software.com/repository/api") + + maven("https://maven.enginehub.org/repo") + + maven("https://repo.oraxen.com/releases") +} + dependencies { paperweight.paperDevBundle(libs.versions.paper) @@ -99,22 +114,15 @@ tasks { shadowJar { archiveBaseName.set(rootProject.name) archiveClassifier.set("") - - listOf( - "de.tr7zw.changeme.nbtapi" - ).forEach { - relocate(it, "libs.$it") - } } processResources { inputs.properties("name" to rootProject.name) inputs.properties("version" to project.version) inputs.properties("group" to "${project.group}.paper") - inputs.properties("description" to project.properties["description"]) + inputs.properties("description" to project.description) inputs.properties("apiVersion" to libs.versions.minecraft.get()) - inputs.properties("authors" to project.properties["authors"]) - inputs.properties("website" to project.properties["website"]) + inputs.properties("website" to "https://modrinth.com/plugin/crazyenchantments") filesMatching("plugin.yml") { expand(inputs.properties) diff --git a/paper/src/main/resources/plugin.yml b/paper/src/main/resources/plugin.yml index 7c2e4523..05f15880 100644 --- a/paper/src/main/resources/plugin.yml +++ b/paper/src/main/resources/plugin.yml @@ -1,7 +1,10 @@ name: '${name}' main: '${group}.${name}' -authors: ${authors} +authors: + - ryderbelserion + - BadBones69 + - TDL version: '${version}' api-version: '${apiVersion}' diff --git a/publish/build.gradle.kts b/publish/build.gradle.kts new file mode 100644 index 00000000..53ffc8e0 --- /dev/null +++ b/publish/build.gradle.kts @@ -0,0 +1,64 @@ +plugins { + alias(libs.plugins.minotaur) + alias(libs.plugins.hangar) +} + +val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8) + +val isBeta = false +val pluginName = rootProject.name +val mcVersion = libs.versions.minecraft.get() + +tasks { + modrinth { + token.set(System.getenv("MODRINTH_TOKEN")) + + projectId.set(rootProject.name) + + versionType.set(if (isBeta) "beta" else "release") + + versionName.set("$pluginName ${rootProject.version}") + versionNumber.set(rootProject.version as String) + + changelog.set(content) + + uploadFile.set(rootProject.projectDir.resolve("jars/$pluginName-${rootProject.version}.jar")) + + gameVersions.set(listOf(mcVersion)) + + loaders.addAll(listOf("purpur", "paper", "folia")) + + syncBodyFrom.set(rootProject.file("README.md").readText(Charsets.UTF_8)) + + autoAddDependsOn.set(false) + detectLoaders.set(false) + } + + hangarPublish { + publications.register("plugin") { + apiKey.set(System.getenv("HANGAR_KEY")) + + id.set(pluginName) + + version.set(rootProject.version as String) + + channel.set(if (isBeta) "Beta" else "Release") + + changelog.set(content) + + platforms { + paper { + jar.set(rootProject.projectDir.resolve("jars/$pluginName-${rootProject.version}.jar")) + + platformVersions.set(listOf(mcVersion)) + + dependencies { + hangar("PlaceholderAPI") { + required = false + } + } + } + } + } + } +} \ No newline at end of file diff --git a/settings.gradle.kts b/settings.gradle.kts index 2b7f63f4..5b6ddab9 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,3 @@ rootProject.name = "CrazyEnchantments" -include("paper") \ No newline at end of file +include("publish" ,"paper") \ No newline at end of file