Skip to content

Commit

Permalink
Update gradle & dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
sofianedjerbi committed Apr 16, 2023
1 parent 6a994e5 commit 3f3c929
Show file tree
Hide file tree
Showing 5 changed files with 207 additions and 144 deletions.
57 changes: 28 additions & 29 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import io.papermc.paperweight.util.constants.*

plugins {
java
id("com.github.johnrengelman.shadow") version "7.1.2"
id("io.papermc.paperweight.patcher") version "1.5.1"
id("com.github.johnrengelman.shadow") version "8.1.1"
id("io.papermc.paperweight.patcher") version "1.5.4"
}

allprojects {
Expand All @@ -30,8 +30,8 @@ repositories {

dependencies {
remapper("net.fabricmc:tiny-remapper:0.8.6:fat")
decompiler("net.minecraftforge:forgeflower:2.0.627.2")
paperclip("io.papermc:paperclip:3.0.2")
decompiler("net.minecraftforge:forgeflower:2.0.629.0")
paperclip("io.papermc:paperclip:3.0.3")
}

subprojects {
Expand Down Expand Up @@ -72,36 +72,35 @@ paperweight {
serverOutputDir.set(layout.projectDirectory.dir("kaiiju-server"))
}
}
}

tasks.register("foliaRefLatest") {
// Update the foliaRef in gradle.properties to be the latest commit.
val tempDir = layout.cacheDir("foliaRefLatest");
val file = "gradle.properties";
tasks.register("foliaRefLatest") {
// Update the foliaRef in gradle.properties to be the latest commit.
val tempDir = layout.cacheDir("foliaRefLatest");
val file = "gradle.properties";

doFirst {
data class GithubCommit(
val sha: String
)

val foliaLatestCommitJson = layout.cache.resolve("foliaLatestCommit.json");
download.get().download("https://api.github.com/repos/PaperMC/Folia/commits/master", foliaLatestCommitJson);
val foliaLatestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(foliaLatestCommitJson)["sha"].asString;

copy {
from(file)
into(tempDir)
filter { line: String ->
line.replace("foliaRef = .*".toRegex(), "foliaRef = $foliaLatestCommit")
}
doFirst {
data class GithubCommit(
val sha: String
)

val foliaLatestCommitJson = layout.cache.resolve("foliaLatestCommit.json");
download.get().download("https://api.github.com/repos/PaperMC/Folia/commits/master", foliaLatestCommitJson);
val foliaLatestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(foliaLatestCommitJson)["sha"].asString;

copy {
from(file)
into(tempDir)
filter { line: String ->
line.replace("foliaRef = .*".toRegex(), "foliaRef = $foliaLatestCommit")
}
}
}

doLast {
copy {
from(tempDir.file("gradle.properties"))
into(project.file(file).parent)
}
doLast {
copy {
from(tempDir.file("gradle.properties"))
into(project.file(file).parent)
}
}
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading

0 comments on commit 3f3c929

Please sign in to comment.