hydra/src/lib/Hydra/Helper/PluginHooks.pm

36 lines
705 B
Perl
Raw Normal View History

package Hydra::Helper::PluginHooks;
use strict;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT = qw(
2016-03-11 21:48:31 -05:00
notifyBuildStarted
notifyBuildFinished);
2016-03-11 21:48:31 -05:00
sub notifyBuildStarted {
my ($plugins, $build) = @_;
foreach my $plugin (@{$plugins}) {
eval {
$plugin->buildStarted($build);
};
if ($@) {
print STDERR "$plugin->buildStarted: $@\n":
}
}
}
sub notifyBuildFinished {
my ($plugins, $build, $dependents) = @_;
foreach my $plugin (@{$plugins}) {
eval {
$plugin->buildFinished($build, $dependents);
};
if ($@) {
print STDERR "$plugin->buildFinished: $@\n";
}
}
}
1;