Merge branch 'stable-2.10'
* stable-2.10: Inject InitStep members again before calling postRun. SSHD: Update to 0.13.0 Bump SSHD Mina version to 2.0.8 Bump Bouncycastle version to 1.51 Update EncryptedContactStore to not use deprecated/removed methods Change-Id: I7853def28109357e8629f1384f90d4630da00483
This commit is contained in:
@@ -67,6 +67,8 @@ public class BaseInit extends SiteProgram {
|
||||
protected final PluginsDistribution pluginsDistribution;
|
||||
private final List<String> pluginsToInstall;
|
||||
|
||||
private Injector sysInjector;
|
||||
|
||||
protected BaseInit(PluginsDistribution pluginsDistribution,
|
||||
List<String> pluginsToInstall) {
|
||||
this.standalone = true;
|
||||
@@ -108,7 +110,7 @@ public class BaseInit extends SiteProgram {
|
||||
run = createSiteRun(init);
|
||||
run.upgradeSchema();
|
||||
|
||||
init.initializer.postRun();
|
||||
init.initializer.postRun(createSysInjector(init));
|
||||
} catch (Exception failure) {
|
||||
if (init.flags.deleteOnFailure) {
|
||||
recursiveDelete(getSitePath());
|
||||
@@ -326,15 +328,18 @@ public class BaseInit extends SiteProgram {
|
||||
}
|
||||
|
||||
private Injector createSysInjector(final SiteInit init) {
|
||||
final List<Module> modules = new ArrayList<>();
|
||||
modules.add(new AbstractModule() {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(ConsoleUI.class).toInstance(init.ui);
|
||||
bind(InitFlags.class).toInstance(init.flags);
|
||||
}
|
||||
});
|
||||
return createDbInjector(SINGLE_USER).createChildInjector(modules);
|
||||
if (sysInjector == null) {
|
||||
final List<Module> modules = new ArrayList<Module>();
|
||||
modules.add(new AbstractModule() {
|
||||
@Override
|
||||
protected void configure() {
|
||||
bind(ConsoleUI.class).toInstance(init.ui);
|
||||
bind(InitFlags.class).toInstance(init.flags);
|
||||
}
|
||||
});
|
||||
sysInjector = createDbInjector(SINGLE_USER).createChildInjector(modules);
|
||||
}
|
||||
return sysInjector;
|
||||
}
|
||||
|
||||
private static void recursiveDelete(File path) {
|
||||
|
||||
@@ -22,6 +22,7 @@ import com.google.gerrit.pgm.init.api.InitStep;
|
||||
import com.google.gerrit.server.config.SitePaths;
|
||||
import com.google.gerrit.server.plugins.JarPluginProvider;
|
||||
import com.google.inject.Inject;
|
||||
import com.google.inject.Injector;
|
||||
import com.google.inject.Singleton;
|
||||
|
||||
import java.io.File;
|
||||
@@ -71,6 +72,8 @@ public class InitPlugins implements InitStep {
|
||||
private final InitPluginStepsLoader pluginLoader;
|
||||
private final PluginsDistribution pluginsDistribution;
|
||||
|
||||
private Injector postRunInjector;
|
||||
|
||||
@Inject
|
||||
InitPlugins(final ConsoleUI ui, final SitePaths site,
|
||||
InitFlags initFlags, InitPluginStepsLoader pluginLoader,
|
||||
@@ -95,6 +98,11 @@ public class InitPlugins implements InitStep {
|
||||
postInitPlugins();
|
||||
}
|
||||
|
||||
@Inject(optional = true)
|
||||
void setPostRunInjector(Injector injector) {
|
||||
postRunInjector = injector;
|
||||
}
|
||||
|
||||
private void installPlugins() throws IOException {
|
||||
List<PluginData> plugins = listPlugins(site, pluginsDistribution);
|
||||
for (PluginData plugin : plugins) {
|
||||
@@ -146,6 +154,7 @@ public class InitPlugins implements InitStep {
|
||||
|
||||
private void postInitPlugins() throws Exception {
|
||||
for (InitStep initStep : pluginLoader.getInitSteps()) {
|
||||
postRunInjector.injectMembers(initStep);
|
||||
initStep.postRun();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -109,12 +109,13 @@ public class SitePathInitializer {
|
||||
}
|
||||
}
|
||||
|
||||
public void postRun() throws Exception {
|
||||
public void postRun(Injector injector) throws Exception {
|
||||
for (InitStep step : steps) {
|
||||
if (step instanceof InitPlugins
|
||||
&& flags.skipPlugins) {
|
||||
continue;
|
||||
}
|
||||
injector.injectMembers(step);
|
||||
step.postRun();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,16 +15,16 @@
|
||||
|
||||
# Version should match lib/bouncycastle/BUCK
|
||||
[library "bouncyCastleProvider"]
|
||||
name = Bouncy Castle Crypto Provider v149
|
||||
url = http://www.bouncycastle.org/download/bcprov-jdk15on-149.jar
|
||||
sha1 = f5155f04330459104b79923274db5060c1057b99
|
||||
name = Bouncy Castle Crypto Provider v151
|
||||
url = http://www.bouncycastle.org/download/bcprov-jdk15on-151.jar
|
||||
sha1 = 9ab8afcc2842d5ef06eb775a0a2b12783b99aa80
|
||||
remove = bcprov-.*[.]jar
|
||||
|
||||
# Version should match lib/bouncycastle/BUCK
|
||||
[library "bouncyCastleSSL"]
|
||||
name = Bouncy Castle Crypto SSL v149
|
||||
url = http://www.bouncycastle.org/download/bcpkix-jdk15on-149.jar
|
||||
sha1 = 924cc7ad2f589630c97b918f044296ebf1bb6855
|
||||
name = Bouncy Castle Crypto SSL v151
|
||||
url = http://www.bouncycastle.org/download/bcpkix-jdk15on-151.jar
|
||||
sha1 = 6c8c1f61bf27a09f9b1a8abc201523669bba9597
|
||||
needs = bouncyCastleProvider
|
||||
remove = bcpkix-.*[.]jar
|
||||
|
||||
|
||||
Reference in New Issue
Block a user