9
0
mirror of https://gitlab.com/SamB440/rpgregions-2.git synced 2025-12-19 14:59:19 +00:00

Cloud 2 migration, 1.20.6, bump all deps, refactor project layout

This commit is contained in:
SamB440
2024-05-16 18:10:41 +01:00
parent 6f32fa9e42
commit 3f77dc266d
80 changed files with 759 additions and 765 deletions

View File

@@ -0,0 +1,23 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
// Support convention plugins written in Kotlin. Convention plugins are build scripts in 'src/main' that automatically become available as plugins in the main build.
`kotlin-dsl`
}
repositories {
// Use the plugin portal to apply community plugins in convention plugins.
gradlePluginPortal()
mavenCentral()
}
dependencies {
implementation("io.github.goooler.shadow:io.github.goooler.shadow.gradle.plugin:8.1.7")
implementation("com.diffplug.spotless:spotless-plugin-gradle:6.25.0")
// implementation("net.kyori:indra-licenser-spotless:3.1.3")
implementation("net.kyori:blossom:2.1.0")
}

View File

@@ -0,0 +1,15 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This settings file is used to specify which projects to include in your build-logic build.
* This project uses @Incubating APIs which are subject to change.
*/
dependencyResolutionManagement {
// Reuse version catalog from the main build.
versionCatalogs {
create("libs", { from(files("../gradle/libs.versions.toml")) })
}
}
rootProject.name = "build-logic"

View File

@@ -0,0 +1,135 @@
plugins {
// Apply the java Plugin to add support for Java.
java
id("io.github.goooler.shadow")
id("com.diffplug.spotless")
// id("net.kyori.indra.licenser.spotless")
}
spotless {
java {
toggleOffOn("@formatter:off", "@formatter:on")
trimTrailingWhitespace()
formatAnnotations()
removeUnusedImports()
endWithNewline()
toggleOffOn()
}
kotlinGradle {
endWithNewline()
indentWithSpaces(4)
trimTrailingWhitespace()
}
}
repositories {
mavenCentral()
mavenLocal()
maven("https://s01.oss.sonatype.org/content/repositories/snapshots/")
maven("https://hub.spigotmc.org/nexus/content/repositories/snapshots/")
maven("https://repo.codemc.io/repository/maven-snapshots/")
maven("https://jitpack.io")
maven("https://repo.convallyria.com/releases")
maven("https://repo.convallyria.com/snapshots")
maven("https://papermc.io/repo/repository/maven-public/")
maven("https://oss.sonatype.org/content/groups/public/")
maven("https://repo.aikar.co/content/groups/aikar/")
// worldguard
maven("https://maven.enginehub.org/repo/")
// PAPI
maven("https://repo.extendedclip.com/content/repositories/placeholderapi/")
// MythicMobs
maven("https://mvn.lumine.io/repository/maven-public/")
// Dynmap
maven("https://repo.mikeprimm.com")
// GriefDefender
maven("https://repo.glaremasters.me/repository/bloodshot")
// Crunch
maven("https://redempt.dev")
flatDir { dir("../libraries") }
}
project.group = "net.islandearth.rpgregions"
project.version = "1.4.7-SNAPSHOT"
group = project.group
version = project.version
dependencies {
constraints {
// Define dependency versions as constraints
compileOnly("net.kyori:adventure-api:4.17.0")
implementation("net.kyori:adventure-api:4.17.0")
testImplementation("net.kyori:adventure-api:4.17.0")
}
implementation("com.convallyria.languagy:api:3.0.3-SNAPSHOT")
implementation("com.google.code.gson:gson:2.10.1")
implementation("net.kyori:adventure-api:4.17.0")
implementation("net.kyori:adventure-text-serializer-plain:4.17.0")
implementation("net.kyori:adventure-platform-bukkit:4.3.3-SNAPSHOT") // IMPLEMENTED VIA LIBRARIES
// implementation("net.kyori:adventure-platform-api:4.3.3-SNAPSHOT")
implementation("net.kyori:adventure-text-minimessage:4.17.0") // IMPLEMENTED VIA LIBRARIES
}
testing {
suites {
// Configure the built-in test suite
val test by getting(JvmTestSuite::class) {
// Use JUnit Jupiter test framework
useJUnitJupiter("5.10.1")
}
}
}
// Apply a specific Java toolchain to ease working on different environments.
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
disableAutoTargetJvm()
}
tasks {
processResources {
filesMatching("plugin.yml") {
expand("version" to project.version)
}
}
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(16)
}
build {
dependsOn(shadowJar)
}
shadowJar {
archiveBaseName.set("rpgregions-2-${project.name}")
archiveClassifier.set("")
relocate("net.kyori", "rpgregions-libs.adventure")
relocate("com.google.gson", "rpgregions-libs.gson")
relocate("org.incendo.cloud", "rpgregions-libs.commandframework")
relocate("io.leangen.geantyref", "rpgregions-libs.typetoken")
relocate("com.convallyria.languagy", "rpgregions-libs.languagy")
relocate("io.papermc.lib", "rpgregions-libs.paperlib")
relocate("redempt.crunch", "rpgregions-libs.crunch")
relocate("co.aikar.idb", "rpgregions-libs.idb")
relocate("com.github.stefvanschie.inventoryframework", "rpgregions-libs.inventoryframework")
relocate("org.bstats", "rpgregions-libs.bstats")
relocate("me.lucko.helper", "rpgregions-libs.helper")
relocate("net.wesjd", "rpgregions-libs.anvilgui")
}
}

View File

@@ -0,0 +1,13 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
// Apply the common convention plugin for shared build configuration between library and application projects.
id("buildlogic.java-common-conventions")
// Apply the java-library plugin for API and implementation separation.
`java-library`
}

View File

@@ -0,0 +1,52 @@
/*
* This file was generated by the Gradle 'init' task.
*
* This project uses @Incubating APIs which are subject to change.
*/
plugins {
// Apply the common convention plugin for shared build configuration between library and application projects.
id("buildlogic.java-library-conventions")
`maven-publish`
}
java {
withSourcesJar()
withJavadocJar()
}
publishing {
publications {
create<MavenPublication>("maven") {
groupId = "net.islandearth.rpgregions"
artifactId = project.name
version = project.version.toString()
from(components["java"])
// skip shadow jar from publishing. Workaround for https://github.com/johnrengelman/shadow/issues/651
val javaComponent = components["java"] as AdhocComponentWithVariants
javaComponent.withVariantsFromConfiguration(configurations["shadowRuntimeElements"]) { skip() }
}
}
repositories {
// See Gradle docs for how to provide credentials to PasswordCredentials
// https://docs.gradle.org/current/samples/sample_publishing_credentials.html
maven {
val snapshotUrl = "https://repo.convallyria.com/snapshots/"
val releaseUrl = "https://repo.convallyria.com/releases/"
// Check which URL should be used
url = if (project.version.toString().endsWith("SNAPSHOT")) {
uri(snapshotUrl)
} else {
uri(releaseUrl)
}
name = "convallyria"
credentials {
credentials(PasswordCredentials::class)
}
}
}
}