update build script

This commit is contained in:
Ryder Belserion 2024-10-08 15:18:58 -04:00
parent 9b719a3761
commit aa22ee3eea
No known key found for this signature in database
10 changed files with 168 additions and 139 deletions

View File

@ -1,72 +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 "1.6.2"
val isSnapshot = true
val content: String = rootProject.file("CHANGELOG.md").readText(Charsets.UTF_8)
subprojects.filter { it.name != "api" }.forEach {
it.project.version = rootProject.version
}
tasks {
modrinth {
token.set(System.getenv("MODRINTH_TOKEN"))
subprojects {
apply(plugin = "maven-publish")
apply(plugin = "java-library")
projectId.set(rootProject.name.lowercase())
group = "com.badbones69.crazycrates"
description = "Create unlimited crates with multiple crate types to choose from!"
versionType.set(if (isSnapshot) "beta" else "release")
repositories {
maven("https://repo.codemc.io/repository/maven-public")
versionName.set("${rootProject.name} ${rootProject.version}")
versionNumber.set(rootProject.version as String)
maven("https://repo.crazycrew.us/libraries")
maven("https://repo.crazycrew.us/releases")
changelog.set(content)
maven("https://jitpack.io")
uploadFile.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))
gameVersions.set(listOf(libs.versions.minecraft.get()))
loaders.addAll(listOf("purpur", "paper", "folia"))
syncBodyFrom.set(rootProject.file("README.md").readText(Charsets.UTF_8))
autoAddDependsOn.set(false)
detectLoaders.set(false)
mavenCentral()
}
hangarPublish {
publications.register("plugin") {
apiKey.set(System.getenv("HANGAR_KEY"))
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}
id.set(rootProject.name.lowercase())
tasks {
compileJava {
options.encoding = Charsets.UTF_8.name()
options.release.set(21)
}
version.set(rootProject.version as String)
javadoc {
options.encoding = Charsets.UTF_8.name()
}
channel.set(if (isSnapshot) "Beta" else "Release")
changelog.set(content)
platforms {
paper {
jar.set(rootProject.projectDir.resolve("jars/${rootProject.name}-${rootProject.version}.jar"))
platformVersions.set(listOf(libs.versions.minecraft.get()))
dependencies {
hangar("PlaceholderAPI") {
required = false
}
}
}
}
processResources {
filteringCharset = Charsets.UTF_8.name()
}
}
}

View File

@ -1,3 +0,0 @@
plugins {
`kotlin-dsl`
}

View File

@ -1,7 +0,0 @@
rootProject.name = "buildSrc"
dependencyResolutionManagement {
repositories {
mavenCentral()
}
}

View File

@ -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/libraries")
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()
}
}

View File

@ -1,9 +0,0 @@
plugins {
id("java-plugin")
}
repositories {
maven("https://repo.papermc.io/repository/maven-public")
maven("https://maven.enginehub.org/repo")
}

View File

@ -10,52 +10,76 @@ shadow = { id = "com.gradleup.shadow", version.ref = "shadow" }
paper = "1.21.1-R0.1-SNAPSHOT"
velocity = "3.3.0-SNAPSHOT"
minecraft = "1.21.1"
brigadier = "1.3.10"
# Gradle Plugins
paperweight = "1.7.2"
paperweight = "1.7.3"
runPaper = "2.3.0"
minotaur = "2.+"
shadow = "8.3.0"
minotaur = "2.8.7"
hangar = "0.1.2"
shadow = "8.3.0"
# Bukkit Plugins
itemsadder = "3.6.3-beta-14"
decentholograms = "2.8.8"
headdatabaseapi = "1.3.1"
placeholderapi = "2.11.6"
decentholograms = "2.8.8"
fancyholograms = "2.2.0"
fancyholograms = "2.3.3"
oraxen = "1.171.0"
vault = "1.7.1"
# Libraries
# Common API
triumph-cmd = "2.0.0-ALPHA-10"
jetbrains = "24.1.0"
adventure = "4.17.0"
gson = "2.10.1"
jalu = "1.4.1"
# Vital API
vital-paper = "0.0.7"
[libraries]
# Velocity API
velocity = { module = "com.velocitypowered:velocity-api", version.ref = "velocity" }
# Mojang API
brigadier = { module = "com.mojang:brigadier", version.ref = "brigadier" }
# Paper API
paper = { module = "io.papermc.paper:paper-api", version.ref = "paper" }
# Kyori
# Kyori API
kyori-logger = { module = "net.kyori:adventure-text-logger-slf4j", version.ref = "adventure" }
kyori-text = { module = "net.kyori:adventure-text-minimessage", version.ref = "adventure" }
kyori-api = { module = "net.kyori:adventure-api", version.ref = "adventure" }
# Bukkit Plugins
# Bukkit Plugins API
decent-holograms = { module = "com.github.decentsoftware-eu:decentholograms", version.ref = "decentholograms" }
fancy-holograms = { module = "de.oliver:FancyHolograms", version.ref = "fancyholograms" }
headdatabaseapi = { module = "com.arcaniax:HeadDatabase-API", version.ref = "headdatabaseapi" }
itemsadder = { module = "com.github.LoneDev6:api-itemsadder", version.ref = "itemsadder" }
fancy-holograms = { module = "de.oliver:FancyHolograms", version.ref = "fancyholograms" }
placeholderapi = { module = "me.clip:placeholderapi", version.ref = "placeholderapi" }
vault = { module = "com.github.MilkBowl:VaultAPI", version.ref = "vault" }
itemsadder = { module = "com.github.LoneDev6:api-itemsadder", version.ref = "itemsadder" }
oraxen = { module = "io.th0rgal:oraxen", version.ref = "oraxen" }
cmi-api = { module = "CMI-API:CMI-API", version = "9.7.4.1" }
cmi-lib = { module = "CMILib:CMILib", version = "1.5.1.4" }
# Libraries
triumph-cmds = { module = "dev.triumphteam:triumph-cmd-bukkit", version.ref = "triumph-cmd" }
# Vital API
vital-paper = { module = "com.ryderbelserion.vital:paper", version.ref = "vital-paper" }
# Common API
triumph-cmds = { module = "dev.triumphteam:triumph-cmd-bukkit", version.ref = "triumph-cmd" }
jetbrains = { module = "org.jetbrains:annotations", version.ref = "jetbrains" }
gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
jalu = { module = "ch.jalu:configme", version.ref = "jalu" }
[bundles]
holograms = ["decent-holograms", "fancy-holograms"]
items = ["itemsadder", "oraxen"]
# Soft Depends
dependencies = ["decent-holograms", "fancy-holograms", "cmi-lib", "cmi-api"]
# Shared with the git submodules
shared = ["headdatabaseapi", "placeholderapi", "oraxen", "vault"]
# Adventure API
adventure = ["kyori-api", "kyori-text", "kyori-logger"]

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME

View File

@ -1,29 +1,30 @@
plugins {
alias(libs.plugins.paperweight)
alias(libs.plugins.runPaper)
alias(libs.plugins.shadow)
}
`paper-plugin`
repositories {
maven("https://repo.extendedclip.com/content/repositories/placeholderapi")
maven("https://repo.papermc.io/repository/maven-public")
maven("https://repo.triumphteam.dev/snapshots")
maven("https://repo.fancyplugins.de/releases")
maven("https://repo.oraxen.com/releases")
maven("https://maven.enginehub.org/repo")
}
dependencies {
paperweight.paperDevBundle(libs.versions.paper)
implementation(libs.vital.paper) {
exclude("org.yaml")
}
compileOnly(libs.placeholderapi)
compileOnly(libs.bundles.shared)
compileOnly(libs.oraxen)
compileOnly(libs.vault)
compileOnly(fileTree("libs").include("*.jar"))
}
paperweight {
reobfArtifactConfiguration = io.papermc.paperweight.userdev.ReobfArtifactConfiguration.MOJANG_PRODUCTION
compileOnly(libs.paper)
}
tasks {
@ -51,7 +52,7 @@ tasks {
archiveClassifier.set("")
listOf(
"com.ryderbelserion"
"com.ryderbelserion.vital"
).forEach {
relocate(it, "libs.$it")
}

84
publish/build.gradle.kts Normal file
View File

@ -0,0 +1,84 @@
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)
dependencies {
optional.version("fancyholograms", "2.3.2")
}
}
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
}
hangar("FancyHolograms") {
required = false
}
url("Oraxen", "https://www.spigotmc.org/resources/%E2%98%84%EF%B8%8F-oraxen-custom-items-blocks-emotes-furniture-resourcepack-and-gui-1-18-1-20-4.72448/") {
required = false
}
url("CMI", "https://www.spigotmc.org/resources/cmi-298-commands-insane-kits-portals-essentials-economy-mysql-sqlite-much-more.3742/") {
required = false
}
url("DecentHolograms", "https://www.spigotmc.org/resources/decentholograms-1-8-1-20-4-papi-support-no-dependencies.96927/") {
required = false
}
}
}
}
}
}
}

View File

@ -1,3 +1,3 @@
rootProject.name = "CrazyAuctions"
include("paper")
include("publish" ,"paper")