7 author manifest_include run_preflight
12 shift->export_to_level(1,@_);
15 sub author { our $Author = shift }
26 '' => qr{Changes|MANIFEST|README|META\.yml},
27 'maint' => qr{[^.].*},
30 sub manifest_include {
34 sub write_manifest_skip {
36 my @files = @Manifest;
38 while (my ($dir, $spec) = splice(@files, 0, 2)) {
39 my $re = ($dir ? $dir.'/' : '').
40 ((ref($spec) eq 'Regexp')
44 # print ref as well as stringification in case of overload ""
45 : die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
48 my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
49 open my $skip, '>', 'MANIFEST.SKIP';
50 print $skip "${final}\n";
59 for (scalar `make manifest 2>&1 >/dev/null`) {
60 $_ && die "make manifest changed:\n$_ Go check it and retry";
63 for (scalar `git status`) {
64 /^# On branch master/ || die "Not on master. EEEK";
65 /Your branch is (behind|ahead of)/ && die "Not synced with upstream";
68 for (scalar `git diff`) {
69 length && die "Oustanding changes";
72 "%i-%02i-%02i", (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3]
74 my @cached = grep /^\+/, `git diff --cached -U0`;
75 @cached > 0 or die "Please add:\n\n$ARGV[0] - $ymd\n\nto Changes and git add";
76 @cached == 2 or die "Pre-commit Changes not just Changes line";
77 $cached[0] eq "+++ b/Changes\n" or die "Changes not changed";
78 $cached[1] eq "+$ARGV[0] - $ymd\n" or die "Changes new line should be: \n\n$ARGV[0] - $ymd\n ";
81 sub MY::postamble { <<'END'; }
83 perl -IDistar/lib -MDistar -erun_preflight $(VERSION)
84 upload: preflight $(DISTVNAME).tar$(SUFFIX)
85 cpan-upload $(DISTVNAME).tar$(SUFFIX)
87 git commit -a -m "Release commit for $(VERSION)"
88 git tag v$(VERSION) -m "release v$(VERSION)"
92 readmefile: create_distdir
93 pod2text $(VERSION_FROM) >$(DISTVNAME)/README
94 $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) -MExtUtils::Manifest=maniadd -e 'eval { maniadd({q{README} => q{README file (added by Distar)}}) } ' \
95 -e ' or print "Could not add README to MANIFEST: $${'\''@'\''}\n"' --
99 no warnings 'redefine';
100 sub main::WriteMakefile {
102 ExtUtils::MakeMaker::WriteMakefile(
104 @_, AUTHOR => our $Author, ABSTRACT_FROM => $args{VERSION_FROM},
105 test => { TESTS => ($args{test}{TESTS}||'t/*.t').' xt/*.t' },
111 write_manifest_skip() unless $Ran_Preflight