mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-17 10:41:06 +01:00
use plugin condition in backend
This commit is contained in:
@@ -53,7 +53,7 @@
|
|||||||
<artifactId>maven-jetty-plugin</artifactId>
|
<artifactId>maven-jetty-plugin</artifactId>
|
||||||
<version>6.1.26</version>
|
<version>6.1.26</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<stopPort>8005</stopPort>
|
<stopPort>8004</stopPort>
|
||||||
<stopKey>STOP</stopKey>
|
<stopKey>STOP</stopKey>
|
||||||
<source>${project.build.javaLevel}</source>
|
<source>${project.build.javaLevel}</source>
|
||||||
<target>${project.build.javaLevel}</target>
|
<target>${project.build.javaLevel}</target>
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ package sonia.scm.plugin.rest;
|
|||||||
|
|
||||||
//~--- non-JDK imports --------------------------------------------------------
|
//~--- non-JDK imports --------------------------------------------------------
|
||||||
|
|
||||||
|
import sonia.scm.plugin.PluginCondition;
|
||||||
import sonia.scm.plugin.PluginFilter;
|
import sonia.scm.plugin.PluginFilter;
|
||||||
import sonia.scm.plugin.PluginInformation;
|
import sonia.scm.plugin.PluginInformation;
|
||||||
|
|
||||||
@@ -81,8 +82,10 @@ public class DefaultPluginFilter implements PluginFilter
|
|||||||
@Override
|
@Override
|
||||||
public boolean accept(PluginInformation plugin)
|
public boolean accept(PluginInformation plugin)
|
||||||
{
|
{
|
||||||
return snapshot
|
PluginCondition condition = plugin.getCondition();
|
||||||
||!plugin.getVersion().toUpperCase().contains(VERSION_SNAPSHOT);
|
return ((condition != null) && condition.isSupported(version, os, arch))
|
||||||
|
|| (condition == null) &&
|
||||||
|
(snapshot || !plugin.getVersion().toUpperCase().contains(VERSION_SNAPSHOT));
|
||||||
}
|
}
|
||||||
|
|
||||||
//~--- fields ---------------------------------------------------------------
|
//~--- fields ---------------------------------------------------------------
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ import org.slf4j.LoggerFactory;
|
|||||||
|
|
||||||
import sonia.scm.plugin.Plugin;
|
import sonia.scm.plugin.Plugin;
|
||||||
import sonia.scm.plugin.PluginBackend;
|
import sonia.scm.plugin.PluginBackend;
|
||||||
|
import sonia.scm.plugin.PluginCondition;
|
||||||
import sonia.scm.plugin.PluginException;
|
import sonia.scm.plugin.PluginException;
|
||||||
import sonia.scm.util.IOUtil;
|
import sonia.scm.util.IOUtil;
|
||||||
|
|
||||||
@@ -158,6 +159,13 @@ public class DefaultPluginScanner implements PluginScanner
|
|||||||
if ((plugin != null) && (plugin.getInformation() != null)
|
if ((plugin != null) && (plugin.getInformation() != null)
|
||||||
&& plugin.getInformation().isValid())
|
&& plugin.getInformation().isValid())
|
||||||
{
|
{
|
||||||
|
PluginCondition condition = plugin.getCondition();
|
||||||
|
|
||||||
|
if (condition != null)
|
||||||
|
{
|
||||||
|
plugin.getInformation().setCondition(condition);
|
||||||
|
}
|
||||||
|
|
||||||
if (logger.isInfoEnabled())
|
if (logger.isInfoEnabled())
|
||||||
{
|
{
|
||||||
logger.info("add plugin {} to backend", file.getPath());
|
logger.info("add plugin {} to backend", file.getPath());
|
||||||
|
|||||||
Reference in New Issue
Block a user