Store the role which first defines an attribute, and pass that along when cloning.
[gitmo/Moose.git] / inc / RequireAuthorDeps.pm
CommitLineData
b7838518 1package inc::RequireAuthorDeps;
2
3use Moose;
4
5use Try::Tiny;
6
7with 'Dist::Zilla::Role::BeforeRelease';
8
9sub before_release {
10 my $self = shift;
11
12 $self->log("Ensuring all author dependencies are installed");
13 my $req = Version::Requirements->new;
14 my $prereqs = $self->zilla->prereqs;
15
16 for my $phase (qw(build test configure runtime develop)) {
17 $req->add_requirements($prereqs->requirements_for($phase, 'requires'));
18 }
19
20 for my $mod (grep { $_ ne 'perl' } $req->required_modules) {
21 Class::MOP::load_class($mod);
22 }
23}
24
251;