Dist::Zilla::Plugin::ManifestSkip - decline to build files that appear in a MANIFEST.SKIP-like file


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

Index


Code Index:

NAME

Top

Dist::Zilla::Plugin::ManifestSkip - decline to build files that appear in a MANIFEST.SKIP-like file

VERSION

Top

version 4.200008

DESCRIPTION

Top

This plugin reads a MANIFEST.SKIP-like file, as used by ExtUtils::MakeMaker and ExtUtils::Manifest, and prunes any files that it declares should be skipped.

ATTRIBUTES

Top

skipfile

This is the name of the file to read for MANIFEST.SKIP-like content. It defaults, unsurprisingly, to MANIFEST.SKIP.

AUTHOR

Top

Ricardo SIGNES <rjbs@cpan.org>

COPYRIGHT AND LICENSE

Top


Dist-Zilla documentation Contained in the Dist-Zilla distribution.

package Dist::Zilla::Plugin::ManifestSkip;
BEGIN {
  $Dist::Zilla::Plugin::ManifestSkip::VERSION = '4.200008';
}
# ABSTRACT: decline to build files that appear in a MANIFEST.SKIP-like file
use Moose;
with 'Dist::Zilla::Role::FilePruner';

use ExtUtils::Manifest 1.54; # public maniskip routine
use Moose::Autobox;


has skipfile => (is => 'ro', required => 1, default => 'MANIFEST.SKIP');

sub prune_files {
  my ($self) = @_;

  my $skipfile = $self->zilla->root->file( $self->skipfile );
  return unless -f $skipfile;
  my $skip = ExtUtils::Manifest::maniskip($skipfile);

  for my $file ($self->zilla->files->flatten) {
    next unless $skip->($file->name);

    $self->log_debug([ 'pruning %s', $file->name ]);

    $self->zilla->prune_file($file);
  }

  return;
}

__PACKAGE__->meta->make_immutable;
no Moose;
1;

__END__