aboutsummaryrefslogtreecommitdiffhomepage
path: root/patches/server/0024-build-replace-use-of-shadow-plugin.patch
blob: 78d0d23bdc24db5b1f488d359947acea2af87e19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Jason Penilla <11360596+jpenilla@users.noreply.github.com>
Date: Thu, 18 Apr 2024 13:39:18 -0700
Subject: [PATCH] build: replace use of shadow plugin


diff --git a/build.gradle.kts b/build.gradle.kts
index 2902bbff8d4aff8d09eaa6b7e4f6c604c42dac29..fec06ac47cf190bf4d5d743c34e4a90b99a0af18 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -4,7 +4,6 @@ import xyz.jpenilla.runpaper.task.RunServer
 plugins {
     java
     `maven-publish`
-    id("com.github.johnrengelman.shadow")
     id("xyz.jpenilla.run-paper") version "2.2.3" apply false
 }
 
@@ -99,14 +98,22 @@ publishing {
     }
 }
 
-tasks.shadowJar {
-    configurations = listOf(project.configurations.vanillaServer.get(), alsoShade) // Paper
+tasks.serverJar {
+    from(alsoShade.elements.map {
+        it.map { f ->
+            if (f.asFile.isFile) {
+                zipTree(f.asFile)
+            } else {
+                f.asFile
+            }
+        }
+    })
 }
 
 // Paper start
 val scanJar = tasks.register("scanJarForBadCalls", io.papermc.paperweight.tasks.ScanJarForBadCalls::class) {
     badAnnotations.add("Lio/papermc/paper/annotation/DoNotUse;")
-    jarToScan.set(tasks.shadowJar.flatMap { it.archiveFile })
+    jarToScan.set(tasks.serverJar.flatMap { it.archiveFile })
     classpath.from(configurations.compileClasspath)
 }
 tasks.check {