mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-22 00:17:37 +01:00
Address Gradle deprecation warnings
This commit is contained in:
parent
f59e2a2de4
commit
5515011644
@ -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) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
plugins {
|
||||
`java-library`
|
||||
`jvm-test-suite`
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
@ -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")
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user