Skip to content

Commit

Permalink
skip plugins that are bundled with the distribution
Browse files Browse the repository at this point in the history
They are not installable and do not need to be included as prereqs.
  • Loading branch information
karenetheridge committed May 16, 2020
1 parent 009f5ab commit aaf1cf9
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Changes
Expand Up @@ -2,6 +2,10 @@ Revision history for Dist-Zilla-Plugin-Prereqs-AuthorDeps

{{$NEXT}}

[CHANGED]

- plugins that exist in the local build root are not added as prereqs.

0.006 2016-05-02 11:06:55-04:00 America/New_York

[CHANGED]
Expand Down
2 changes: 2 additions & 0 deletions corpus/DZ/dist.ini
Expand Up @@ -19,4 +19,6 @@ exclude = Dist::Zilla::Plugin::RemovePrereqs
[RemovePrereqs]
remove = MostlyHarmless

[=inc::Foo]

; authordep Devel::Foo = 0.123
5 changes: 5 additions & 0 deletions corpus/DZ/inc/Foo.pm
@@ -0,0 +1,5 @@
package inc::Foo;
use Moose;
with 'Dist::Zilla::Role::BeforeBuild';
sub before_build { 1 }
1;
5 changes: 5 additions & 0 deletions lib/Dist/Zilla/Plugin/Prereqs/AuthorDeps.pm
Expand Up @@ -9,6 +9,7 @@ our $VERSION = '0.007';
use Moose;
use MooseX::Types::Moose qw( HashRef ArrayRef Str );
use List::Util qw/min/;
use Path::Tiny;

use Dist::Zilla::Util::AuthorDeps 5.021;
use Dist::Zilla 4;
Expand Down Expand Up @@ -81,6 +82,10 @@ sub register_prereqs {
for my $req (@$authordeps) {
my ( $mod, $version ) = each %$req;
next if $self->_exclude_hash->{$mod};

(my $filename = $mod) =~ s{::}{/}g;
next if path($self->zilla->root, $filename.'.pm')->exists;

$zilla->register_prereqs( { phase => $phase, type => $relation }, $mod, $version );
}

Expand Down

0 comments on commit aaf1cf9

Please sign in to comment.