pluginmanager: only load jar plugins from the folder

This commit is contained in:
ThatGamerBlue
2020-08-31 12:28:34 +01:00
parent 469695db7c
commit ae9be07bae
3 changed files with 9 additions and 5 deletions

View File

@@ -166,8 +166,6 @@ subprojects {
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
}
withType<AbstractArchiveTask> {

View File

@@ -76,9 +76,6 @@ tasks {
jar {
enabled = false
}
sourcesJar {
enabled = false
}
processResources {
enabled = false
}

View File

@@ -136,6 +136,10 @@ class ExternalPf4jPluginManager extends DefaultPluginManager
{
try
{
if (!isPluginEligibleForLoading(pluginPath) && isNotDevelopment())
{
continue;
}
loadPluginFromPath(pluginPath);
}
catch (PluginRuntimeException e)
@@ -346,4 +350,9 @@ class ExternalPf4jPluginManager extends DefaultPluginManager
return pluginRepository.deletePluginPath(pluginPath);
}
private boolean isPluginEligibleForLoading(Path path)
{
return path.toFile().getName().endsWith(".jar");
}
}