mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-08 06:25:45 +01:00
25 lines
699 B
Java
25 lines
699 B
Java
package sonia.scm.lifecycle;
|
|
|
|
import com.google.inject.AbstractModule;
|
|
import com.google.inject.multibindings.Multibinder;
|
|
import sonia.scm.migration.UpdateStep;
|
|
import sonia.scm.plugin.PluginLoader;
|
|
|
|
class UpdateStepModule extends AbstractModule {
|
|
|
|
private final PluginLoader pluginLoader;
|
|
|
|
UpdateStepModule(PluginLoader pluginLoader) {
|
|
this.pluginLoader = pluginLoader;
|
|
}
|
|
|
|
@Override
|
|
protected void configure() {
|
|
Multibinder<UpdateStep> updateStepBinder = Multibinder.newSetBinder(binder(), UpdateStep.class);
|
|
pluginLoader
|
|
.getExtensionProcessor()
|
|
.byExtensionPoint(UpdateStep.class)
|
|
.forEach(stepClass -> updateStepBinder.addBinding().to(stepClass));
|
|
}
|
|
}
|