Skip to content

Commit

Permalink
2.2.1 Release
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Jul 30, 2024
1 parent fee2b1f commit b282612
Show file tree
Hide file tree
Showing 3 changed files with 85 additions and 39 deletions.
6 changes: 6 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Changelog for versions since 2.0.0.

## 2.2.1

### Bug Fixes
- Fix cannot measure distance error in PositionHandler
- Fix logs table not being created

## 2.2.0

### New Features
Expand Down
115 changes: 77 additions & 38 deletions bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
plugins {
`java-library`
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.papermc.hangar-publish-plugin") version "0.1.2"
}

java.sourceCompatibility = JavaVersion.VERSION_17

repositories {
mavenCentral()
mavenLocal()
Expand Down Expand Up @@ -51,57 +54,93 @@ dependencies {
compileOnly("io.th0rgal:oraxen:1.173.0")
}

tasks.withType<ShadowJar> {
val projectVersion: String by project
archiveFileName.set("AuraSkills-${projectVersion}.jar")

relocate("co.aikar.commands", "dev.aurelium.auraskills.acf")
relocate("co.aikar.locales", "dev.aurelium.auraskills.locales")
relocate("de.tr7zw.changeme.nbtapi", "dev.aurelium.auraskills.nbtapi")
relocate("org.bstats", "dev.aurelium.auraskills.bstats")
relocate("com.ezylang.evalex", "dev.aurelium.auraskills.evalex")
relocate("net.kyori", "dev.aurelium.auraskills.kyori")
relocate("com.zaxxer.hikari", "dev.aurelium.auraskills.hikari")
relocate("dev.aurelium.slate", "dev.aurelium.auraskills.slate")
relocate("org.spongepowered.configurate", "dev.aurelium.auraskills.configurate")
relocate("io.leangen.geantyref", "dev.aurelium.auraskills.geantyref")
relocate("net.querz", "dev.aurelium.auraskills.querz")
relocate("com.archyx.polyglot", "dev.aurelium.auraskills.polyglot")
relocate("org.atteo.evo.inflector", "dev.aurelium.auraskills.inflector")

exclude("acf-*.properties")

finalizedBy("copyJar")
}
tasks {
withType<ShadowJar> {
val projectVersion: String by project
archiveFileName.set("AuraSkills-${projectVersion}.jar")

java.sourceCompatibility = JavaVersion.VERSION_17
relocate("co.aikar.commands", "dev.aurelium.auraskills.acf")
relocate("co.aikar.locales", "dev.aurelium.auraskills.locales")
relocate("de.tr7zw.changeme.nbtapi", "dev.aurelium.auraskills.nbtapi")
relocate("org.bstats", "dev.aurelium.auraskills.bstats")
relocate("com.ezylang.evalex", "dev.aurelium.auraskills.evalex")
relocate("net.kyori", "dev.aurelium.auraskills.kyori")
relocate("com.zaxxer.hikari", "dev.aurelium.auraskills.hikari")
relocate("dev.aurelium.slate", "dev.aurelium.auraskills.slate")
relocate("org.spongepowered.configurate", "dev.aurelium.auraskills.configurate")
relocate("io.leangen.geantyref", "dev.aurelium.auraskills.geantyref")
relocate("net.querz", "dev.aurelium.auraskills.querz")
relocate("com.archyx.polyglot", "dev.aurelium.auraskills.polyglot")
relocate("org.atteo.evo.inflector", "dev.aurelium.auraskills.inflector")

tasks.register<Copy>("copyJar") {
val projectVersion : String by project
from("build/libs/AuraSkills-${projectVersion}.jar")
into("../build/libs")
}
exclude("acf-*.properties")

finalizedBy("copyJar")
}

register<Copy>("copyJar") {
val projectVersion : String by project
from("build/libs/AuraSkills-${projectVersion}.jar")
into("../build/libs")
}

tasks {
build {
dependsOn(shadowJar)
}

javadoc {
options {
(this as CoreJavadocOptions).addStringOption("Xdoclint:none", "-quiet")
}
}
}

tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
options.isFork = true
options.forkOptions.executable = "javac"
withType<JavaCompile> {
options.encoding = "UTF-8"
options.compilerArgs.add("-parameters")
options.isFork = true
options.forkOptions.executable = "javac"
}

processResources {
filesMatching("plugin.yml") {
expand("projectVersion" to project.version)
}
}
}

tasks.processResources {
filesMatching("plugin.yml") {
expand("projectVersion" to project.version)
val supportedVersions = (project.property("supportedMCVersions") as String).split(",").map { it.trim() }

if (project.hasProperty("hangarApiKey")) {
hangarPublish {
publications.register("AuraSkills") {
val projectVersion = project.version as String

version.set(projectVersion)
id.set("AuraSkills")
channel.set("Release")
changelog.set(extractChangelog(projectVersion))

apiKey.set(project.property("hangarApiKey") as String)

platforms {
paper {
jar.set(tasks.shadowJar.flatMap { it.archiveFile })
platformVersions.set(supportedVersions)
}
}
}
}
}

fun extractChangelog(version: String): String {
val heading = Regex.escape(version)
val path = if (System.getProperty("user.dir").endsWith("bukkit")) "../Changelog.md" else "Changelog.md"

val fullChangelog = File(path).readText()
val headingPattern = Regex("## $heading\\R+([\\s\\S]*?)\\R+##\\s", RegexOption.DOT_MATCHES_ALL)
val result = headingPattern.find(fullChangelog)

return result?.groupValues?.get(1)?.trim()
?: throw IllegalArgumentException("Failed to extract changelog section for version $version")
}

3 changes: 2 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
projectVersion = 2.2.0
projectVersion=2.2.1
supportedMCVersions=1.17,1.17.1,1.18,1.18.1,1.18.2,1.19,1.19.1,1.19.2,1.19.3,1.19.4,1.20,1.20.1,1.20.2,1.20.3,1.20.4,1.20.5,1.20.6,1.21

0 comments on commit b282612

Please sign in to comment.