mirror of
https://github.com/2006-Scape/Parabot.git
synced 2026-07-03 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 password;
|
||||
public static void main(String... args) throws IOException {
|
||||
System.out.println(JavaUtil.JAVA_VERSION);
|
||||
Core.initiateBugsnagInstance();
|
||||
|
||||
parseArgs(args);
|
||||
|
||||
@@ -41,6 +41,12 @@ public abstract class Library {
|
||||
* @return url
|
||||
*/
|
||||
public abstract URL getDownloadLink();
|
||||
|
||||
/**
|
||||
* Defines if the system requires a jar
|
||||
* @return boolean
|
||||
*/
|
||||
public abstract boolean requiresJar();
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.parabot.core.Core;
|
||||
import org.parabot.core.Directories;
|
||||
import org.parabot.core.build.BuildPath;
|
||||
import org.parabot.core.lib.Library;
|
||||
import org.parabot.environment.api.utils.JavaUtil;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -59,6 +60,11 @@ public class JavaFX extends Library {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresJar() {
|
||||
return JavaUtil.JAVA_VERSION <= 1.7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLibraryName() {
|
||||
return "JavaFX";
|
||||
|
||||
@@ -56,6 +56,11 @@ public class Naga extends Library {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean requiresJar() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getLibraryName() {
|
||||
return "Naga";
|
||||
|
||||
@@ -33,7 +33,7 @@ public class Environment {
|
||||
libs.add(new Naga());
|
||||
|
||||
for(Library lib : libs) {
|
||||
if(!lib.hasJar()) {
|
||||
if(!lib.hasJar() && lib.requiresJar()) {
|
||||
Core.verbose("Downloading " + lib.getLibraryName() + "...");
|
||||
VerboseLoader.setState("Downloading " + lib.getLibraryName() + "...");
|
||||
WebUtil.downloadFile(lib.getDownloadLink(), lib.getJarFile(), VerboseLoader.get());
|
||||
|
||||
Reference in New Issue
Block a user