Skip to content
This repository was archived by the owner on Sep 19, 2025. It is now read-only.

Commit 1755495

Browse files
authored
Update build.gradle.kts
1 parent bd311ef commit 1755495

File tree

1 file changed

+23
-24
lines changed

1 file changed

+23
-24
lines changed

build.gradle.kts

Lines changed: 23 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -86,33 +86,32 @@ paperweight {
8686
}
8787

8888
tasks.register("purpurRefLatest") {
89-
// Update the purpurRef in gradle.properties to be the latest commit.
90-
val tempDir = layout.cacheDir("purpurRefLatest");
91-
val file = "gradle.properties";
92-
93-
doFirst {
94-
data class GithubCommit(
95-
val sha: String
96-
)
97-
98-
val purpurLatestCommitJson = layout.cache.resolve("purpurLatestCommit.json");
99-
download.get().download("https://api.github.com/repos/PurpurMC/Purpur/commits/ver/1.19.3", purpurLatestCommitJson);
100-
val purpurLatestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(purpurLatestCommitJson)["sha"].asString;
101-
102-
copy {
103-
from(file)
104-
into(tempDir)
105-
filter { line: String ->
106-
line.replace("purpurRef = .*".toRegex(), "purpurRef = $purpurLatestCommit")
107-
}
89+
// Update the purpurRef in gradle.properties to be the latest commit.
90+
val tempDir = layout.cacheDir("purpurRefLatest");
91+
val file = "gradle.properties";
92+
93+
doFirst {
94+
data class GithubCommit(
95+
val sha: String
96+
)
97+
98+
val purpurLatestCommitJson = layout.cache.resolve("purpurLatestCommit.json");
99+
download.get().download("https://api.github.com/repos/PurpurMC/Purpur/commits/ver/1.19.3", purpurLatestCommitJson);
100+
val purpurLatestCommit = gson.fromJson<paper.libs.com.google.gson.JsonObject>(purpurLatestCommitJson)["sha"].asString;
101+
102+
copy {
103+
from(file)
104+
into(tempDir)
105+
filter { line: String ->
106+
line.replace("purpurRef = .*".toRegex(), "purpurRef = $purpurLatestCommit")
108107
}
109108
}
109+
}
110110

111-
doLast {
112-
copy {
113-
from(tempDir.file("gradle.properties"))
114-
into(project.file(file).parent)
115-
}
111+
doLast {
112+
copy {
113+
from(tempDir.file("gradle.properties"))
114+
into(project.file(file).parent)
116115
}
117116
}
118117
}

0 commit comments

Comments
 (0)