change default repo
This commit is contained in:
@@ -129,7 +129,7 @@ public interface OpenOSRSConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "externalRepositories",
|
keyName = "externalRepos",
|
||||||
name = "",
|
name = "",
|
||||||
description = "",
|
description = "",
|
||||||
hidden = true
|
hidden = true
|
||||||
@@ -140,7 +140,7 @@ public interface OpenOSRSConfig extends Config
|
|||||||
}
|
}
|
||||||
|
|
||||||
@ConfigItem(
|
@ConfigItem(
|
||||||
keyName = "externalRepositories",
|
keyName = "externalRepos",
|
||||||
name = "",
|
name = "",
|
||||||
description = "",
|
description = "",
|
||||||
hidden = true
|
hidden = true
|
||||||
|
|||||||
@@ -89,17 +89,16 @@ import org.pf4j.update.DefaultUpdateRepository;
|
|||||||
import org.pf4j.update.PluginInfo;
|
import org.pf4j.update.PluginInfo;
|
||||||
import org.pf4j.update.UpdateManager;
|
import org.pf4j.update.UpdateManager;
|
||||||
import org.pf4j.update.UpdateRepository;
|
import org.pf4j.update.UpdateRepository;
|
||||||
import org.pf4j.update.VerifyException;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Singleton
|
@Singleton
|
||||||
public class ExternalPluginManager
|
public class ExternalPluginManager
|
||||||
{
|
{
|
||||||
public static final String DEFAULT_PLUGIN_REPOS = "OpenOSRS:https://raw.githubusercontent.com/open-osrs/plugin-hosting/master/";
|
public static final String DEFAULT_PLUGIN_REPOS = "OpenOSRS:https://raw.githubusercontent.com/zeruth/runelite-plugins-release/master/";
|
||||||
static final String DEVELOPMENT_MANIFEST_PATH = "build/tmp/jar/MANIFEST.MF";
|
static final String DEVELOPMENT_MANIFEST_PATH = "build/tmp/jar/MANIFEST.MF";
|
||||||
|
|
||||||
public static ArrayList<ClassLoader> pluginClassLoaders = new ArrayList<>();
|
public static ArrayList<ClassLoader> pluginClassLoaders = new ArrayList<>();
|
||||||
private final net.runelite.client.plugins.PluginManager runelitePluginManager;
|
private final PluginManager runelitePluginManager;
|
||||||
private org.pf4j.PluginManager externalPluginManager;
|
private org.pf4j.PluginManager externalPluginManager;
|
||||||
@Getter(AccessLevel.PUBLIC)
|
@Getter(AccessLevel.PUBLIC)
|
||||||
private final List<UpdateRepository> repositories = new ArrayList<>();
|
private final List<UpdateRepository> repositories = new ArrayList<>();
|
||||||
@@ -260,7 +259,7 @@ public class ExternalPluginManager
|
|||||||
|
|
||||||
if (id.contains("https://raw.githubusercontent.com/"))
|
if (id.contains("https://raw.githubusercontent.com/"))
|
||||||
{
|
{
|
||||||
id = "gh:" + id.substring(id.indexOf("https://raw.githubusercontent.com/")).replace("/master", "")
|
id = "gh:" + id.substring(id.indexOf("https://raw.githubusercontent.com/")).replace("/main", "")
|
||||||
.replace("https://raw.githubusercontent.com/", "");
|
.replace("https://raw.githubusercontent.com/", "");
|
||||||
|
|
||||||
if (id.endsWith("/"))
|
if (id.endsWith("/"))
|
||||||
@@ -540,15 +539,15 @@ public class ExternalPluginManager
|
|||||||
List<Plugin> deps = new ArrayList<>();
|
List<Plugin> deps = new ArrayList<>();
|
||||||
for (net.runelite.client.plugins.PluginDependency pluginDependency : pluginDependencies)
|
for (net.runelite.client.plugins.PluginDependency pluginDependency : pluginDependencies)
|
||||||
{
|
{
|
||||||
Optional<Plugin> dependency =
|
Optional<net.runelite.client.plugins.Plugin> dependency =
|
||||||
Stream.concat(runelitePluginManager.getOprsPlugins().stream(), scannedPlugins.stream())
|
Stream.concat(runelitePluginManager.getPlugins().stream(), scannedPlugins.stream())
|
||||||
.filter(p -> p.getClass() == pluginDependency.value()).findFirst();
|
.filter(p -> p.getClass() == pluginDependency.value()).findFirst();
|
||||||
if (dependency.isEmpty())
|
if (dependency.isEmpty())
|
||||||
{
|
{
|
||||||
throw new PluginInstantiationException(
|
throw new PluginInstantiationException(
|
||||||
"Unmet dependency for " + clazz.getSimpleName() + ": " + pluginDependency.value().getSimpleName());
|
"Unmet dependency for " + clazz.getSimpleName() + ": " + pluginDependency.value().getSimpleName());
|
||||||
}
|
}
|
||||||
deps.add(dependency.get());
|
deps.add((Plugin) dependency.get());
|
||||||
}
|
}
|
||||||
|
|
||||||
log.info("Loading plugin {}", clazz.getSimpleName());
|
log.info("Loading plugin {}", clazz.getSimpleName());
|
||||||
@@ -774,7 +773,7 @@ public class ExternalPluginManager
|
|||||||
|
|
||||||
List<Plugin> extensions = externalPluginManager.getExtensions(Plugin.class, pluginId);
|
List<Plugin> extensions = externalPluginManager.getExtensions(Plugin.class, pluginId);
|
||||||
|
|
||||||
for (Plugin plugin : runelitePluginManager.getOprsPlugins())
|
for (net.runelite.client.plugins.Plugin plugin : runelitePluginManager.getPlugins())
|
||||||
{
|
{
|
||||||
if (!extensions.get(0).getClass().getName().equals(plugin.getClass().getName()))
|
if (!extensions.get(0).getClass().getName().equals(plugin.getClass().getName()))
|
||||||
{
|
{
|
||||||
@@ -812,7 +811,7 @@ public class ExternalPluginManager
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean install(String pluginId) throws VerifyException
|
public boolean install(String pluginId)
|
||||||
{
|
{
|
||||||
if (getDisabledPlugins().contains(pluginId))
|
if (getDisabledPlugins().contains(pluginId))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -99,7 +99,6 @@ public class PluginManager
|
|||||||
|
|
||||||
@Setter
|
@Setter
|
||||||
boolean isOutdated;
|
boolean isOutdated;
|
||||||
private Collection<com.openosrs.client.plugins.Plugin> oprsPlugins;
|
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
@VisibleForTesting
|
@VisibleForTesting
|
||||||
@@ -569,11 +568,6 @@ public class PluginManager
|
|||||||
return plugins;
|
return plugins;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Collection<com.openosrs.client.plugins.Plugin> getOprsPlugins()
|
|
||||||
{
|
|
||||||
return oprsPlugins;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Topologically sort a graph into separate groups.
|
* Topologically sort a graph into separate groups.
|
||||||
* Each group represents the dependency level of the plugins.
|
* Each group represents the dependency level of the plugins.
|
||||||
|
|||||||
Reference in New Issue
Block a user