Add ApiType.JS
Adds JS ApiType to match current configuration in plugin-js-archetype. Change-Id: I5482fea8c74ff4489eb26323f81858ef48593e7d Signed-off-by: Dariusz Luksza <dariusz@luksza.org>
This commit is contained in:
parent
df52478ca9
commit
aaf2c4f87a
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user