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