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 { java {
sourceCompatibility = JavaVersion.VERSION_11 sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11 targetCompatibility = JavaVersion.VERSION_11
withSourcesJar()
} }
withType<AbstractArchiveTask> { withType<AbstractArchiveTask> {

View File

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

View File

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