Commit | Line | Data |
b7838518 |
1 | package inc::RequireAuthorDeps; |
2 | |
3 | use Moose; |
4 | |
5 | use Try::Tiny; |
6 | |
7 | with 'Dist::Zilla::Role::BeforeRelease'; |
8 | |
9 | sub 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 | |
25 | 1; |