Commit | Line | Data |
a4891190 |
1 | use strict; |
2 | use warnings FATAL => 'all'; |
3 | |
4 | { |
5 | package MY; |
534471a1 |
6 | |
b98e2d46 |
7 | { |
8 | no warnings 'once'; push @ExtUtils::MakeMaker::Overridable, 'find_tests'; |
9 | } |
534471a1 |
10 | |
a4891190 |
11 | sub find_tests { |
12 | shift->SUPER::find_tests.' xt/*.t'; |
13 | } |
534471a1 |
14 | |
9a785a3b |
15 | sub postamble { 'include maint/Makefile.include' } |
a4891190 |
16 | } |
17 | |
18 | { |
19 | no warnings 'redefine'; |
20 | sub WriteMakefile { |
21 | my %args = @_; |
22 | ExtUtils::MakeMaker::WriteMakefile( |
23 | %args, |
24 | AUTHOR => 'Ken Williams <kwilliams@cpan.org>, Randy W. Sims <RandyS@ThePierianSpring.org>', |
25 | ABSTRACT_FROM => $args{VERSION_FROM}, |
e8c1f315 |
26 | LICENSE => 'perl', |
a4891190 |
27 | ); |
28 | } |
29 | } |
30 | |
31 | sub manifest_include { |
32 | use autodie; |
33 | my @files = @_; |
34 | my @parts; |
35 | while (my ($dir, $spec) = splice(@files, 0, 2)) { |
36 | my $re = ($dir ? $dir.'/' : ''). |
37 | ((ref($spec) eq 'Regexp') |
38 | ? $spec |
39 | : !ref($spec) |
40 | ? ".*\Q${spec}\E" |
41 | : die "spec must be string or regexp, was: ${spec} (${\ref $spec})"); |
42 | push @parts, $re; |
43 | } |
44 | my $final = '^(?!'.join('|', map "${_}\$", @parts).')'; |
45 | open my $skip, '>', 'MANIFEST.SKIP'; |
46 | print $skip "${final}\n"; |
47 | close $skip; |
48 | } |
49 | |
50 | manifest_include( |
51 | 'lib' => '.pm', |
52 | 't' => '.t', |
53 | 't/lib' => '.pm', |
80b3eb9c |
54 | 'xt' => '.t', |
55 | 'xt/lib' => '.pm', |
a4891190 |
56 | '' => '.PL', |
f1d18ad3 |
57 | '' => qr{Changes|MANIFEST|README|META\.yml}, |
58 | 'maint' => qr{[^.].*}, |
a4891190 |
59 | ); |
60 | |
61 | 1; |