feat: implement run-task plugins

resolves #75
This commit is contained in:
Adrian 2023-02-07 12:46:08 -05:00
parent 74b75fc5f9
commit ed0554bdb3
6 changed files with 29 additions and 24 deletions

2
.gitignore vendored
View File

@ -25,3 +25,5 @@ buildNumber.properties
*.class *.class
.gitpod.yml .gitpod.yml
*/run/

View File

@ -1,7 +1,5 @@
plugins { plugins {
alias(libs.plugins.blossom) alias(libs.plugins.blossom)
// Required to relocate packages
alias(libs.plugins.shadow)
id("authmevelocity.spotless") id("authmevelocity.spotless")
} }
@ -15,16 +13,8 @@ dependencies {
compileOnly(libs.libby.core) compileOnly(libs.libby.core)
} }
tasks {
shadowJar {
relocate("net.byteflux.libby", "io.github._4drian3d.authmevelocity.libs.libby")
relocate("org.spongepowered", "io.github._4drian3d.authmevelocity.libs.sponge")
relocate("io.leangen.geantyref", "io.github._4drian3d.authmevelocity.libs.geantyref")
}
}
blossom { blossom {
replaceTokenIn("src/main/java/me/adrianed/authmevelocity/common/Constants.java") replaceTokenIn("src/main/java/io/github/_4drian3d/authmevelocity/common/Constants.java")
replaceToken("{version}", project.version) replaceToken("{version}", project.version)
replaceToken("{description}", project.description) replaceToken("{description}", project.description)
replaceToken("{configurate}", libs.versions.configurate.get()) replaceToken("{configurate}", libs.versions.configurate.get())

View File

@ -21,7 +21,6 @@ import net.byteflux.libby.Library;
import net.byteflux.libby.LibraryManager; import net.byteflux.libby.LibraryManager;
import net.byteflux.libby.relocation.Relocation; import net.byteflux.libby.relocation.Relocation;
public final class LibsManager { public final class LibsManager {
private final LibraryManager manager; private final LibraryManager manager;

View File

@ -16,6 +16,7 @@ adventure = "4.12.0"
blossom = "1.3.1" blossom = "1.3.1"
geantyref = "1.3.13" geantyref = "1.3.13"
indra = "3.0.1" indra = "3.0.1"
runtask = "2.0.1"
[libraries] [libraries]
@ -44,5 +45,9 @@ plugin-shadow = { group = "gradle.plugin.com.github.johnrengelman", name = "shad
pluginyml-bukkit = { id = "net.minecrell.plugin-yml.bukkit", version.ref = "pluginyml" } pluginyml-bukkit = { id = "net.minecrell.plugin-yml.bukkit", version.ref = "pluginyml" }
shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" } shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
blossom = { id = "net.kyori.blossom", version.ref = "blossom" } blossom = { id = "net.kyori.blossom", version.ref = "blossom" }
indra = { id = "net.kyori.indra.publishing", version.ref = "indra" } indra = { id = "net.kyori.indra.publishing", version.ref = "indra" }
runvelocity = { id = "xyz.jpenilla.run-velocity", version.ref = "runtask" }
runpaper = { id = "xyz.jpenilla.run-paper", version.ref = "runtask" }

View File

@ -1,6 +1,7 @@
plugins { plugins {
alias(libs.plugins.pluginyml.bukkit) alias(libs.plugins.pluginyml.bukkit)
alias(libs.plugins.shadow) alias(libs.plugins.shadow)
alias(libs.plugins.runpaper)
id("authmevelocity.spotless") id("authmevelocity.spotless")
} }
@ -48,20 +49,23 @@ bukkit {
tasks { tasks {
shadowJar { shadowJar {
//duplicatesStrategy = DuplicatesStrategy.EXCLUDE
archiveFileName.set("AuthMeVelocity-Paper-${project.version}.jar") archiveFileName.set("AuthMeVelocity-Paper-${project.version}.jar")
archiveClassifier.set("") archiveClassifier.set("")
relocate("net.byteflux.libby", "io.github._4drian3d.authmevelocity.libs.libby")
}
relocate("net.byteflux.libby", "io.github._4drian3d.authmevelocity.libs.libby")
relocate("org.spongepowered", "io.github._4drian3d.authmevelocity.libs.sponge")
relocate("io.leangen.geantyref", "io.github._4drian3d.authmevelocity.libs.geantyref")
}
build { build {
dependsOn(shadowJar) dependsOn(shadowJar)
} }
} compileJava {
options.encoding = Charsets.UTF_8.name()
tasks.compileJava { options.release.set(17)
options.encoding = Charsets.UTF_8.name() }
options.release.set(17) runServer {
minecraftVersion("1.19.3")
}
} }
java.toolchain.languageVersion.set(JavaLanguageVersion.of(17)) java.toolchain.languageVersion.set(JavaLanguageVersion.of(17))

View File

@ -1,5 +1,6 @@
plugins { plugins {
alias(libs.plugins.shadow) alias(libs.plugins.shadow)
alias(libs.plugins.runvelocity)
id("authmevelocity.spotless") id("authmevelocity.spotless")
} }
@ -42,12 +43,16 @@ tasks {
archiveFileName.set("AuthMeVelocity-Velocity-${project.version}.jar") archiveFileName.set("AuthMeVelocity-Velocity-${project.version}.jar")
archiveClassifier.set("") archiveClassifier.set("")
relocate("net.byteflux.libby", "io.github._4drian3d.authmevelocity.libs.libby")
relocate("org.bstats", "io.github._4drian3d.authmevelocity.libs.bstats") relocate("org.bstats", "io.github._4drian3d.authmevelocity.libs.bstats")
relocate("net.byteflux.libby", "io.github._4drian3d.authmevelocity.libs.libby")
relocate("org.spongepowered", "io.github._4drian3d.authmevelocity.libs.sponge")
relocate("io.leangen.geantyref", "io.github._4drian3d.authmevelocity.libs.geantyref")
} }
build { build {
dependsOn(shadowJar) dependsOn(shadowJar)
} }
runVelocity {
velocityVersion(libs.versions.velocity.get())
}
} }