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