Address Gradle deprecation warnings

This commit is contained in:
Nassim Jahnke 2024-11-17 13:31:36 +01:00
parent f59e2a2de4
commit 5515011644
No known key found for this signature in database
GPG Key ID: EF6771C01F6EF02F
3 changed files with 5 additions and 8 deletions

View File

@ -1,7 +1,6 @@
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.jvm.toolchain.JavaLanguageVersion
import java.io.ByteArrayOutputStream
fun Project.latestCommitHash(): String {
return runGitCommand(listOf("rev-parse", "--short", "HEAD"))
@ -16,12 +15,9 @@ fun Project.branchName(): String {
}
fun Project.runGitCommand(args: List<String>): String {
val byteOut = ByteArrayOutputStream()
exec {
return providers.exec {
commandLine = listOf("git") + args
standardOutput = byteOut
}
return byteOut.toString(Charsets.UTF_8.name()).trim()
}.standardOutput.asBytes.get().toString(Charsets.UTF_8).trim()
}
fun JavaPluginExtension.javaTarget(version: Int) {

View File

@ -1,5 +1,6 @@
plugins {
`java-library`
`jvm-test-suite`
}
tasks {

View File

@ -16,10 +16,10 @@ val main = setOf(
projects.viaversionBukkit,
projects.viaversionVelocity,
projects.viaversionFabric
).map { it.dependencyProject }
).map { it.path }
subprojects {
when (this) {
when (path) {
in main -> plugins.apply("via.shadow-conventions")
else -> plugins.apply("via.base-conventions")
}