Prevents jars from being built as part of jar downloading
All checks were successful
KnarCraft/Minecraft-Server-Launcher/pipeline/head This commit looks good

This commit is contained in:
Kristian Knarvik 2021-08-03 10:16:43 +02:00
parent e4be75b770
commit 33795a90a9
3 changed files with 8 additions and 8 deletions

View File

@ -60,6 +60,9 @@ public final class JarDownloader {
continue; continue;
} }
for (String version : type.getVersions()) { for (String version : type.getVersions()) {
if ((type.getName().equals("Spigot") || type.getName().equals("Bukkit")) && version.equals("Latest")) {
continue;
}
gui.setStatus("Downloading " + type.getName() + version + "..."); gui.setStatus("Downloading " + type.getName() + version + "...");
boolean success = type.downloadJar(jarDirectory, version); boolean success = type.downloadJar(jarDirectory, version);
if (!success) { if (!success) {

View File

@ -1,6 +1,5 @@
package net.knarcraft.minecraftserverlauncher.utility; package net.knarcraft.minecraftserverlauncher.utility;
import net.knarcraft.minecraftserverlauncher.Main;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.stringBetween; import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.stringBetween;
@ -8,12 +7,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
public class CommonFunctionsTest { public class CommonFunctionsTest {
@Test
public void saveProfileTest() {
Main.getController().addProfile("Test");
Main.getController().saveState();
}
@Test @Test
public void stringBetweenTest() { public void stringBetweenTest() {
String substring = stringBetween("fish'nchips", "f", "'"); String substring = stringBetween("fish'nchips", "f", "'");

View File

@ -58,7 +58,7 @@ public class JarDownloaderTest {
} }
@Test @Test
public void craftbukkitDownloadTest() throws ConfigurationException, IOException { public void craftBukkitDownloadTest() throws ConfigurationException, IOException {
singleDownloadTest(ServerTypeHandler.getByName("Bukkit")); singleDownloadTest(ServerTypeHandler.getByName("Bukkit"));
} }
@ -96,6 +96,10 @@ public class JarDownloaderTest {
private void singleDownloadTest(ServerType serverType) throws IOException { private void singleDownloadTest(ServerType serverType) throws IOException {
assertNotNull(serverType); assertNotNull(serverType);
for (String serverVersion : serverType.getVersions()) { for (String serverVersion : serverType.getVersions()) {
if ((serverType.getName().equals("Spigot") || serverType.getName().equals("Bukkit"))
&& serverVersion.equals("Latest")) {
continue;
}
System.out.println("Downloading " + serverType.getName() + serverVersion + ".jar"); System.out.println("Downloading " + serverType.getName() + serverVersion + ".jar");
serverType.downloadJar(targetDirectory, serverVersion); serverType.downloadJar(targetDirectory, serverVersion);
assertTrue(new File(targetDirectory + serverType.getName() + serverVersion + ".jar").exists()); assertTrue(new File(targetDirectory + serverType.getName() + serverVersion + ".jar").exists());