X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=p5sagit%2FModule-Metadata.git;a=blobdiff_plain;f=maint%2FMakefile.PL.include;fp=maint%2FMakefile.PL.include;h=04dd5858ccd0e9d8708983be0b137c66b4df5134;hp=0000000000000000000000000000000000000000;hb=381910b56b17a3cea2ef7eadf76cbaf95b0a8dff;hpb=534471a1fea2b54281a1a2ad2b108df8b0ca1e3d diff --git a/maint/Makefile.PL.include b/maint/Makefile.PL.include new file mode 100644 index 0000000..04dd585 --- /dev/null +++ b/maint/Makefile.PL.include @@ -0,0 +1,67 @@ +use strict; +use warnings FATAL => 'all'; + +my $POSTAMBLE = q{bump: + maint/bump-version +bumpminor: + maint/bump-version minor +bumpmajor: + maint/bump-version major +}; + +{ + package MY; + + { + no warnings 'once'; push @ExtUtils::MakeMaker::Overridable, 'find_tests'; + } + + sub find_tests { + shift->SUPER::find_tests.' xt/*.t'; + } + + sub postamble { $POSTAMBLE } +} + +{ + no warnings 'redefine'; + sub WriteMakefile { + my %args = @_; + ExtUtils::MakeMaker::WriteMakefile( + %args, + AUTHOR => 'Ken Williams , Randy W. Sims ', + ABSTRACT_FROM => $args{VERSION_FROM}, + ); + } +} + +sub manifest_include { + use autodie; + my @files = @_; + my @parts; + while (my ($dir, $spec) = splice(@files, 0, 2)) { + my $re = ($dir ? $dir.'/' : ''). + ((ref($spec) eq 'Regexp') + ? $spec + : !ref($spec) + ? ".*\Q${spec}\E" + : die "spec must be string or regexp, was: ${spec} (${\ref $spec})"); + push @parts, $re; + } + my $final = '^(?!'.join('|', map "${_}\$", @parts).')'; + open my $skip, '>', 'MANIFEST.SKIP'; + print $skip "${final}\n"; + close $skip; +} + +manifest_include( + 'lib' => '.pm', + 't' => '.t', + 't/lib' => '.pm', + 'xt' => '.t', + 'xt/lib' => '.pm', + '' => '.PL', + '' => qr{Changes|MANIFEST|README|META\.yml} +); + +1;