7 author manifest_include run_preflight
12 shift->export_to_level(1,@_);
15 sub author { our $Author = shift }
24 '' => qr{Changes|MANIFEST|README|META\.yml},
25 'maint' => qr{[^.].*},
28 sub manifest_include {
32 sub write_manifest_skip {
34 my @files = @Manifest;
36 while (my ($dir, $spec) = splice(@files, 0, 2)) {
37 my $re = ($dir ? $dir.'/' : '').
38 ((ref($spec) eq 'Regexp')
42 # print ref as well as stringification in case of overload ""
43 : die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
46 my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
47 open my $skip, '>', 'MANIFEST.SKIP';
48 print $skip "${final}\n";
55 for (scalar `make manifest 2>&1 >/dev/null`) {
56 $_ && die "make manifest changed:\n$_ Go check it and retry";
59 for (scalar `git status`) {
60 /Your branch is (behind|ahead of)/ && die "Not synced with upstream";
63 for (scalar `git diff`) {
64 length && die "Oustanding changes";
67 "%i-%02i-%02i", (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3]
69 my @cached = grep /^\+/, `git diff --cached -U0`;
70 @cached > 0 or die "Please add:\n\n$ARGV[0] - $ymd\n\nto Changes and git add";
71 @cached == 2 or die "Pre-commit Changes not just Changes line";
72 $cached[0] eq "+++ b/Changes\n" or die "Changes not changed";
73 $cached[1] eq "+$ARGV[0] - $ymd\n" or die "Changes new line should be: \n\n$ARGV[0] - $ymd\n ";
76 sub MY::postamble { <<'END'; }
78 perl -IDistar/lib -MDistar -erun_preflight $(VERSION)
79 upload: preflight $(DISTVNAME).tar$(SUFFIX)
80 cpan-upload $(DISTVNAME).tar$(SUFFIX)
82 git commit -a -m "Release commit for $(VERSION)"
83 git tag release_$(VERSION)
87 readmefile: create_distdir
88 pod2text $(VERSION_FROM) >$(DISTVNAME)/README
89 $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{README} => q{README file (added by Distar)}}) } ' \
90 -e ' or print "Could not add README to MANIFEST: $${'\''@'\''}\n"' --
94 no warnings 'redefine';
95 sub main::WriteMakefile {
97 ExtUtils::MakeMaker::WriteMakefile(
99 @_, AUTHOR => our $Author, ABSTRACT_FROM => $args{VERSION_FROM},
100 test => { TESTS => ($args{test}{TESTS}||'').' xt/*.t' },
106 write_manifest_skip()