@@ -86,33 +86,32 @@ paperweight {
8686}
8787
8888tasks.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