Merge "Separate out the plugin API from other Gerrit plugins"
This commit is contained in:
commit
4c1a4b2a2b
|
@ -53,6 +53,7 @@ import com.google.gerrit.server.StartupChecks;
|
|||
import com.google.gerrit.server.account.AccountDeactivator;
|
||||
import com.google.gerrit.server.account.InternalAccountDirectory;
|
||||
import com.google.gerrit.server.api.GerritApiModule;
|
||||
import com.google.gerrit.server.api.PluginApiModule;
|
||||
import com.google.gerrit.server.cache.h2.DefaultCacheFactory;
|
||||
import com.google.gerrit.server.change.ChangeCleanupRunner;
|
||||
import com.google.gerrit.server.config.AuthConfig;
|
||||
|
@ -413,6 +414,7 @@ public class Daemon extends SiteProgram {
|
|||
modules.add(new MimeUtil2Module());
|
||||
modules.add(cfgInjector.getInstance(GerritGlobalModule.class));
|
||||
modules.add(new GerritApiModule());
|
||||
modules.add(new PluginApiModule());
|
||||
|
||||
modules.add(new SearchingChangeCacheImpl.Module(slave));
|
||||
modules.add(new InternalAccountDirectory.Module());
|
||||
|
|
|
@ -15,10 +15,7 @@
|
|||
package com.google.gerrit.server.api;
|
||||
|
||||
import com.google.gerrit.extensions.api.GerritApi;
|
||||
import com.google.gerrit.extensions.api.plugins.Plugins;
|
||||
import com.google.gerrit.extensions.config.FactoryModule;
|
||||
import com.google.gerrit.server.api.plugins.PluginApiImpl;
|
||||
import com.google.gerrit.server.api.plugins.PluginsImpl;
|
||||
|
||||
public class GerritApiModule extends FactoryModule {
|
||||
@Override
|
||||
|
@ -30,8 +27,5 @@ public class GerritApiModule extends FactoryModule {
|
|||
install(new com.google.gerrit.server.api.config.Module());
|
||||
install(new com.google.gerrit.server.api.groups.Module());
|
||||
install(new com.google.gerrit.server.api.projects.Module());
|
||||
|
||||
bind(Plugins.class).to(PluginsImpl.class);
|
||||
factory(PluginApiImpl.Factory.class);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
// Copyright (C) 2017 The Android Open Source Project
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
package com.google.gerrit.server.api;
|
||||
|
||||
import com.google.gerrit.extensions.api.plugins.Plugins;
|
||||
import com.google.gerrit.extensions.config.FactoryModule;
|
||||
import com.google.gerrit.server.api.plugins.PluginApiImpl;
|
||||
import com.google.gerrit.server.api.plugins.PluginsImpl;
|
||||
|
||||
public class PluginApiModule extends FactoryModule {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(Plugins.class).to(PluginsImpl.class);
|
||||
factory(PluginApiImpl.Factory.class);
|
||||
}
|
||||
}
|
|
@ -30,6 +30,7 @@ import com.google.gerrit.reviewdb.server.ReviewDb;
|
|||
import com.google.gerrit.server.GerritPersonIdent;
|
||||
import com.google.gerrit.server.GerritPersonIdentProvider;
|
||||
import com.google.gerrit.server.api.GerritApiModule;
|
||||
import com.google.gerrit.server.api.PluginApiModule;
|
||||
import com.google.gerrit.server.cache.h2.DefaultCacheFactory;
|
||||
import com.google.gerrit.server.config.AllProjectsName;
|
||||
import com.google.gerrit.server.config.AllProjectsNameProvider;
|
||||
|
@ -163,6 +164,7 @@ public class InMemoryModule extends FactoryModule {
|
|||
bind(MetricMaker.class).to(DisabledMetricMaker.class);
|
||||
install(cfgInjector.getInstance(GerritGlobalModule.class));
|
||||
install(new GerritApiModule());
|
||||
install(new PluginApiModule());
|
||||
install(new DefaultPermissionBackendModule());
|
||||
install(new SearchingChangeCacheImpl.Module());
|
||||
factory(GarbageCollection.Factory.class);
|
||||
|
|
Loading…
Reference in New Issue