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