Gradle deprecation fixes & upgrades (#1594)
* Fix Gradle deprecations By using test suites, we explicitely configure the relevant dependencies on the test sourceset. This is not done by merely configuring the test task. * Switch to maintained version of Shadow * Update to Gradle 8.14.2
This commit is contained in:
@@ -2,8 +2,15 @@ import org.gradle.jvm.tasks.Jar
|
|||||||
import org.gradle.kotlin.dsl.withType
|
import org.gradle.kotlin.dsl.withType
|
||||||
import java.io.ByteArrayOutputStream
|
import java.io.ByteArrayOutputStream
|
||||||
|
|
||||||
|
// This interface is needed as a workaround to get an instance of ExecOperations
|
||||||
|
interface Injected {
|
||||||
|
@get:Inject
|
||||||
|
val execOps: ExecOperations
|
||||||
|
}
|
||||||
|
|
||||||
val currentShortRevision = ByteArrayOutputStream().use {
|
val currentShortRevision = ByteArrayOutputStream().use {
|
||||||
exec {
|
val execOps = objects.newInstance<Injected>().execOps
|
||||||
|
execOps.exec {
|
||||||
executable = "git"
|
executable = "git"
|
||||||
args = listOf("rev-parse", "HEAD")
|
args = listOf("rev-parse", "HEAD")
|
||||||
standardOutput = it
|
standardOutput = it
|
||||||
|
@@ -20,11 +20,11 @@ subprojects {
|
|||||||
testImplementation(rootProject.libs.junit)
|
testImplementation(rootProject.libs.junit)
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks {
|
testing.suites.named<JvmTestSuite>("test") {
|
||||||
test {
|
useJUnitJupiter()
|
||||||
useJUnitPlatform()
|
targets.all {
|
||||||
reports {
|
testTask.configure {
|
||||||
junitXml.required.set(true)
|
reports.junitXml.required = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -8,7 +8,7 @@ netty = "4.2.1.Final"
|
|||||||
[plugins]
|
[plugins]
|
||||||
fill = "io.papermc.fill.gradle:1.0.3"
|
fill = "io.papermc.fill.gradle:1.0.3"
|
||||||
indra-publishing = "net.kyori.indra.publishing:2.0.6"
|
indra-publishing = "net.kyori.indra.publishing:2.0.6"
|
||||||
shadow = "io.github.goooler.shadow:8.1.5"
|
shadow = "com.gradleup.shadow:8.3.6"
|
||||||
spotless = "com.diffplug.spotless:6.25.0"
|
spotless = "com.diffplug.spotless:6.25.0"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,6 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.2-bin.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
validateDistributionUrl=true
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
Reference in New Issue
Block a user