From 1f164f447a44455cae7b0592a68e92e1eeda4d59 Mon Sep 17 00:00:00 2001 From: RaphiMC <50594595+RaphiMC@users.noreply.github.com> Date: Thu, 14 Nov 2024 00:52:40 +0100 Subject: [PATCH] Updated gradle to 8.11 --- build.gradle | 39 +++++++++--------------- common/build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +-- 3 files changed, 18 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index ef46454..8859eae 100644 --- a/build.gradle +++ b/build.gradle @@ -57,40 +57,31 @@ idea { // ----------------------------------------------------- // Publishing -def latestCommitHash() { - def byteOut = new ByteArrayOutputStream() - exec { - commandLine 'git', 'rev-parse', '--short', 'HEAD' - standardOutput = byteOut - } - return byteOut.toString('UTF-8').trim() +Provider latestCommitHash() { + return providers.exec { + commandLine = ["git", "rev-parse", "--short", "HEAD"] + }.standardOutput.getAsText().map(String::trim) } -def latestCommitMessage() { - def byteOut = new ByteArrayOutputStream() - exec { - commandLine 'git', 'log', '-1', '--pretty=%B' - standardOutput = byteOut - } - return byteOut.toString('UTF-8').trim() +Provider latestCommitMessage() { + return providers.exec { + commandLine = ["git", "log", "-1", "--pretty=%B"] + }.standardOutput.getAsText().map(String::trim) } -def branchName() { - def byteOut = new ByteArrayOutputStream() - exec { - commandLine 'git', 'rev-parse', '--abbrev-ref', 'HEAD' - standardOutput = byteOut - } - return byteOut.toString('UTF-8').trim() +Provider branchName() { + return providers.exec { + commandLine = ["git", "rev-parse", "--abbrev-ref", "HEAD"] + }.standardOutput.getAsText().map(String::trim) } -def branch = branchName() +def branch = branchName().get() def baseVersion = project.maven_version def isRelease = !baseVersion.contains('-') if (!isRelease) { // Only publish releases from the main branch def suffixedVersion = isRelease ? baseVersion : baseVersion + "+" + System.getenv("GITHUB_RUN_NUMBER") - def commitHash = latestCommitHash() - def changelogContent = "[${commitHash}](https://github.com/ViaVersion/ViaAprilFools/commit/${commitHash}) ${latestCommitMessage()}" + def commitHash = latestCommitHash().get() + def changelogContent = "[${commitHash}](https://github.com/ViaVersion/ViaAprilFools/commit/${commitHash}) ${latestCommitMessage().get()}" modrinth { def mcVersions = project.mcVersions .split(',') diff --git a/common/build.gradle b/common/build.gradle index c8e2b2a..43a63f6 100644 --- a/common/build.gradle +++ b/common/build.gradle @@ -13,7 +13,7 @@ sourceSets { main { classTokenReplacer { property("\${version}", project.version) - property("\${impl_version}", "git-ViaAprilFools-${project.version}:${rootProject.latestCommitHash()}") + property("\${impl_version}", "git-ViaAprilFools-${project.version}:${rootProject.latestCommitHash().get()}") } } } diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index fb602ee..82dd18b 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,7 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionSha256Sum=31c55713e40233a8303827ceb42ca48a47267a0ad4bab9177123121e71524c26 -distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip +distributionSha256Sum=57dafb5c2622c6cc08b993c85b7c06956a2f53536432a30ead46166dbca0f1e9 +distributionUrl=https\://services.gradle.org/distributions/gradle-8.11-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME