diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/Plugin.java b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/Plugin.java index c67f18061e..5049e9fde0 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/Plugin.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/Plugin.java @@ -41,7 +41,7 @@ import javax.annotation.Nullable; public class Plugin { public static enum ApiType { - EXTENSION, PLUGIN; + EXTENSION, PLUGIN, JS; } /** Unique key that changes whenever a plugin reloads. */ @@ -74,6 +74,8 @@ public class Plugin { return ApiType.EXTENSION; } else if (ApiType.PLUGIN.name().equalsIgnoreCase(v)) { return ApiType.PLUGIN; + } else if (ApiType.JS.name().equalsIgnoreCase(v)) { + return ApiType.JS; } else { throw new InvalidPluginException("Invalid Gerrit-ApiType: " + v); } diff --git a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginLoader.java b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginLoader.java index d1c2aa40b3..86bff38063 100644 --- a/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginLoader.java +++ b/gerrit-server/src/main/java/com/google/gerrit/server/plugins/PluginLoader.java @@ -22,6 +22,7 @@ import com.google.common.collect.Sets; import com.google.gerrit.extensions.annotations.PluginName; import com.google.gerrit.extensions.events.LifecycleListener; import com.google.gerrit.extensions.systemstatus.ServerInformation; +import com.google.gerrit.extensions.webui.JavaScriptPlugin; import com.google.gerrit.server.config.ConfigUtil; import com.google.gerrit.server.config.GerritServerConfig; import com.google.gerrit.server.config.SitePaths; @@ -464,6 +465,8 @@ public class PluginLoader implements LifecycleListener { return PluginName.class.getClassLoader(); case PLUGIN: return PluginLoader.class.getClassLoader(); + case JS: + return JavaScriptPlugin.class.getClassLoader(); default: throw new InvalidPluginException("Unsupported ApiType " + type); }