mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-21 17:45:36 +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.Project
|
||||||
import org.gradle.api.plugins.JavaPluginExtension
|
import org.gradle.api.plugins.JavaPluginExtension
|
||||||
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
import org.gradle.jvm.toolchain.JavaLanguageVersion
|
||||||
import java.io.ByteArrayOutputStream
|
|
||||||
|
|
||||||
fun Project.latestCommitHash(): String {
|
fun Project.latestCommitHash(): String {
|
||||||
return runGitCommand(listOf("rev-parse", "--short", "HEAD"))
|
return runGitCommand(listOf("rev-parse", "--short", "HEAD"))
|
||||||
@ -16,12 +15,9 @@ fun Project.branchName(): String {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fun Project.runGitCommand(args: List<String>): String {
|
fun Project.runGitCommand(args: List<String>): String {
|
||||||
val byteOut = ByteArrayOutputStream()
|
return providers.exec {
|
||||||
exec {
|
|
||||||
commandLine = listOf("git") + args
|
commandLine = listOf("git") + args
|
||||||
standardOutput = byteOut
|
}.standardOutput.asBytes.get().toString(Charsets.UTF_8).trim()
|
||||||
}
|
|
||||||
return byteOut.toString(Charsets.UTF_8.name()).trim()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun JavaPluginExtension.javaTarget(version: Int) {
|
fun JavaPluginExtension.javaTarget(version: Int) {
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
plugins {
|
plugins {
|
||||||
`java-library`
|
`java-library`
|
||||||
|
`jvm-test-suite`
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
tasks {
|
||||||
|
@ -16,10 +16,10 @@ val main = setOf(
|
|||||||
projects.viaversionBukkit,
|
projects.viaversionBukkit,
|
||||||
projects.viaversionVelocity,
|
projects.viaversionVelocity,
|
||||||
projects.viaversionFabric
|
projects.viaversionFabric
|
||||||
).map { it.dependencyProject }
|
).map { it.path }
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
when (this) {
|
when (path) {
|
||||||
in main -> plugins.apply("via.shadow-conventions")
|
in main -> plugins.apply("via.shadow-conventions")
|
||||||
else -> plugins.apply("via.base-conventions")
|
else -> plugins.apply("via.base-conventions")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user