From: Jesse Luehrs Date: Mon, 3 Jan 2011 20:07:08 +0000 (-0600) Subject: ensure all author deps are installed before doing release testing X-Git-Tag: 1.9902~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b783851897cfbe632d61cc20aa1b60dc52193b14;p=gitmo%2FMoose.git ensure all author deps are installed before doing release testing --- diff --git a/dist.ini b/dist.ini index c952a7e..4fdcd06 100644 --- a/dist.ini +++ b/dist.ini @@ -6,6 +6,8 @@ copyright_holder = Infinity Interactive, Inc. version = 1.9901 +[=inc::RequireAuthorDeps] + [=inc::GatherDir] [PruneCruft] [ManifestSkip] diff --git a/inc/RequireAuthorDeps.pm b/inc/RequireAuthorDeps.pm new file mode 100644 index 0000000..d19966f --- /dev/null +++ b/inc/RequireAuthorDeps.pm @@ -0,0 +1,25 @@ +package inc::RequireAuthorDeps; + +use Moose; + +use Try::Tiny; + +with 'Dist::Zilla::Role::BeforeRelease'; + +sub before_release { + my $self = shift; + + $self->log("Ensuring all author dependencies are installed"); + my $req = Version::Requirements->new; + my $prereqs = $self->zilla->prereqs; + + for my $phase (qw(build test configure runtime develop)) { + $req->add_requirements($prereqs->requirements_for($phase, 'requires')); + } + + for my $mod (grep { $_ ne 'perl' } $req->required_modules) { + Class::MOP::load_class($mod); + } +} + +1;