mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-01 17:00:26 +00:00
Downloaded LWJGL libraries
- LWJGL is no longer shaded into the Bukkit jar - plugin.yml lists the LWJGL jars and Linux natives as Spigot libraries - The Paper loader resolves the same plugin.yml list through the Maven Central mirror - The packed payload no longer reserves the LWJGL natives prefix - Tests cover reading the library list from the plugin jar
This commit is contained in:
1 parent
aec8f5be8e
commit
0d76d81dab
5 files changed
+67
-8
No files matched your search
@@ -4,9 +4,13 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TemporaryFolder;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.nio.charset.StandardCharsets;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.util.List;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipOutputStream;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@@ -31,4 +35,19 @@ public class IrisPluginLoaderTest {
|
||||
|
||||
assertEquals(List.of(relocatedCaffeine, relocatedGson), libraries);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void readsMavenLibrariesFromTheSpigotDescriptorInThePluginJar() throws Exception {
|
||||
Path jar = temporaryFolder.getRoot().toPath().resolve("Iris.jar");
|
||||
try (OutputStream file = Files.newOutputStream(jar); ZipOutputStream zip = new ZipOutputStream(file)) {
|
||||
zip.putNextEntry(new ZipEntry("plugin.yml"));
|
||||
zip.write("name: Iris\nlibraries: [ 'org.lwjgl:lwjgl:3.4.3', 'org.lwjgl:lwjgl:jar:natives-linux:3.4.3' ]\n"
|
||||
.getBytes(StandardCharsets.UTF_8));
|
||||
zip.closeEntry();
|
||||
}
|
||||
|
||||
List<String> libraries = IrisPluginLoader.mavenLibraries(jar);
|
||||
|
||||
assertEquals(List.of("org.lwjgl:lwjgl:3.4.3", "org.lwjgl:lwjgl:jar:natives-linux:3.4.3"), libraries);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user