mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-07 16:49:10 +00:00
[FEATURE] Added Library#requiresJar
This commit is contained in:
@@ -30,7 +30,6 @@ public final class Landing {
|
|||||||
private static String username;
|
private static String username;
|
||||||
private static String password;
|
private static String password;
|
||||||
public static void main(String... args) throws IOException {
|
public static void main(String... args) throws IOException {
|
||||||
System.out.println(JavaUtil.JAVA_VERSION);
|
|
||||||
Core.initiateBugsnagInstance();
|
Core.initiateBugsnagInstance();
|
||||||
|
|
||||||
parseArgs(args);
|
parseArgs(args);
|
||||||
|
|||||||
@@ -42,6 +42,12 @@ public abstract class Library {
|
|||||||
*/
|
*/
|
||||||
public abstract URL getDownloadLink();
|
public abstract URL getDownloadLink();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Defines if the system requires a jar
|
||||||
|
* @return boolean
|
||||||
|
*/
|
||||||
|
public abstract boolean requiresJar();
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches URL from {@link Library#getJarFile()}
|
* Fetches URL from {@link Library#getJarFile()}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import org.parabot.core.Core;
|
|||||||
import org.parabot.core.Directories;
|
import org.parabot.core.Directories;
|
||||||
import org.parabot.core.build.BuildPath;
|
import org.parabot.core.build.BuildPath;
|
||||||
import org.parabot.core.lib.Library;
|
import org.parabot.core.lib.Library;
|
||||||
|
import org.parabot.environment.api.utils.JavaUtil;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -59,6 +60,11 @@ public class JavaFX extends Library {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean requiresJar() {
|
||||||
|
return JavaUtil.JAVA_VERSION <= 1.7;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLibraryName() {
|
public String getLibraryName() {
|
||||||
return "JavaFX";
|
return "JavaFX";
|
||||||
|
|||||||
@@ -56,6 +56,11 @@ public class Naga extends Library {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean requiresJar() {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getLibraryName() {
|
public String getLibraryName() {
|
||||||
return "Naga";
|
return "Naga";
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ public class Environment {
|
|||||||
libs.add(new Naga());
|
libs.add(new Naga());
|
||||||
|
|
||||||
for(Library lib : libs) {
|
for(Library lib : libs) {
|
||||||
if(!lib.hasJar()) {
|
if(!lib.hasJar() && lib.requiresJar()) {
|
||||||
Core.verbose("Downloading " + lib.getLibraryName() + "...");
|
Core.verbose("Downloading " + lib.getLibraryName() + "...");
|
||||||
VerboseLoader.setState("Downloading " + lib.getLibraryName() + "...");
|
VerboseLoader.setState("Downloading " + lib.getLibraryName() + "...");
|
||||||
WebUtil.downloadFile(lib.getDownloadLink(), lib.getJarFile(), VerboseLoader.get());
|
WebUtil.downloadFile(lib.getDownloadLink(), lib.getJarFile(), VerboseLoader.get());
|
||||||
|
|||||||
Reference in New Issue
Block a user