diff --git a/api/paper/build.gradle.kts b/api/paper/build.gradle.kts index ed12679..d09b3b8 100644 --- a/api/paper/build.gradle.kts +++ b/api/paper/build.gradle.kts @@ -1,6 +1,7 @@ plugins { `java-library` alias(libs.plugins.indra) + id("authmevelocity.publishing") } java { @@ -24,43 +25,3 @@ tasks { } } } - -indra { - javaVersions { - testWith().add(17) - } - - issues { - url("https://github.com/4drian3d/AuthMeVelocity/issues") - system("Github Issues") - } - - github("4drian3d", "AuthMeVelocity") { - ci(true) - } - - gpl3OrLaterLicense() - - scm { - connection("scm:git:git://github.com/4drian3d/AuthMeVelocity.git") - developerConnection("scm:git:ssh://github.com/4drian3d/AuthMeVelocity.git") - url("http://github.com/4drian3d/AuthMeVelocity/") - } - - configurePublications { - groupId = project.group as String - artifactId = "api-paper" - version = project.version as String - from(components["java"]) - - pom { - developers { - developer { - id.set("4drian3d") - name.set("Adrian") - } - } - } - } -} - diff --git a/api/velocity/build.gradle.kts b/api/velocity/build.gradle.kts index 59fc1ed..c09a044 100644 --- a/api/velocity/build.gradle.kts +++ b/api/velocity/build.gradle.kts @@ -1,6 +1,7 @@ plugins { `java-library` alias(libs.plugins.indra) + id("authmevelocity.publishing") } dependencies { @@ -24,42 +25,3 @@ tasks { } } } - -indra { - javaVersions { - testWith().add(17) - } - - issues { - url("https://github.com/4drian3d/AuthMeVelocity/issues") - system("Github Issues") - } - - github("4drian3d", "AuthMeVelocity") { - ci(true) - } - - gpl3OrLaterLicense() - - scm { - connection("scm:git:git://github.com/4drian3d/AuthMeVelocity.git") - developerConnection("scm:git:ssh://github.com/4drian3d/AuthMeVelocity.git") - url("http://github.com/4drian3d/AuthMeVelocity/") - } - - configurePublications { - groupId = project.group as String - artifactId = "api-velocity" - version = project.version as String - from(components["java"]) - - pom { - developers { - developer { - id.set("4drian3d") - name.set("Adrian") - } - } - } - } -} diff --git a/build-logic/build.gradle.kts b/build-logic/build.gradle.kts new file mode 100644 index 0000000..18057e2 --- /dev/null +++ b/build-logic/build.gradle.kts @@ -0,0 +1,17 @@ +plugins { + `kotlin-dsl` +} + +dependencies { + implementation(libs.plugin.shadow) + implementation(libs.build.indra) +} + +repositories { + gradlePluginPortal() +} + +java { + sourceCompatibility = JavaVersion.VERSION_11 + targetCompatibility = JavaVersion.VERSION_11 +} \ No newline at end of file diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts new file mode 100644 index 0000000..80c5fb3 --- /dev/null +++ b/build-logic/settings.gradle.kts @@ -0,0 +1,14 @@ +rootProject.name = "build-logic" + +dependencyResolutionManagement { + repositories { + gradlePluginPortal() + mavenCentral() + } + + versionCatalogs { + register("libs") { + from(files("../gradle/libs.versions.toml")) + } + } +} \ No newline at end of file diff --git a/build-logic/src/main/kotlin/authmevelocity.publishing.gradle.kts b/build-logic/src/main/kotlin/authmevelocity.publishing.gradle.kts new file mode 100644 index 0000000..17e955d --- /dev/null +++ b/build-logic/src/main/kotlin/authmevelocity.publishing.gradle.kts @@ -0,0 +1,31 @@ +plugins { + id("net.kyori.indra.publishing") +} + +indra { + javaVersions { + testWith().add(17) + } + + github("4drian3d", "AuthMeVelocity") { + ci(true) + } + + gpl3OrLaterLicense() + + configurePublications { + groupId = project.group as String + artifactId = project.name.replaceFirst("authmevelocity-", "") + version = project.version as String + from(components["java"]) + + pom { + developers { + developer { + id.set("4drian3d") + name.set("Adrian") + } + } + } + } +} diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 3d6c1fb..46a2afa 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -36,6 +36,9 @@ bstats-velocity = { group = "org.bstats", name = "bstats-velocity", version.ref configurate-hocon = { group = "org.spongepowered", name = "configurate-hocon", version.ref = "configurate" } +build-indra = { module = "net.kyori:indra-common", version.ref = "indra" } +plugin-shadow = { group = "gradle.plugin.com.github.johnrengelman", name = "shadow", version.ref = "shadow" } + [plugins] pluginyml-bukkit = { id = "net.minecrell.plugin-yml.bukkit", version.ref = "pluginyml" } diff --git a/settings.gradle.kts b/settings.gradle.kts index ba8295d..3bc03c6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,4 +8,12 @@ listOf("common", "paper", "velocity").forEach { listOf("paper", "velocity").forEach { include("authmevelocity-api-$it") project(":authmevelocity-api-$it").projectDir = file("api/$it") +} + +pluginManagement { + includeBuild("build-logic") + repositories { + gradlePluginPortal() + mavenCentral() + } } \ No newline at end of file