10 author manifest_include run_preflight
15 shift->export_to_level(1,@_);
18 sub author { our $Author = shift }
29 '' => qr{Changes|MANIFEST|README|META\.yml},
30 'maint' => qr{[^.].*},
33 sub manifest_include {
37 sub write_manifest_skip {
39 my @files = @Manifest;
41 while (my ($dir, $spec) = splice(@files, 0, 2)) {
42 my $re = ($dir ? $dir.'/' : '').
43 ((ref($spec) eq 'Regexp')
47 # print ref as well as stringification in case of overload ""
48 : die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
51 my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
52 open my $skip, '>', 'MANIFEST.SKIP';
53 print $skip "${final}\n";
62 my $make = $Config{make};
63 my $null = File::Spec->devnull;
65 for (scalar `"$make" manifest 2>&1 >$null`) {
66 $_ && die "$make manifest changed:\n$_ Go check it and retry";
69 for (scalar `git status`) {
70 /^# On branch master/ || die "Not on master. EEEK";
71 /Your branch is behind|Your branch and .*? have diverged/ && die "Not synced with upstream";
74 for (scalar `git diff`) {
75 length && die "Outstanding changes";
78 "%i-%02i-%02i", (localtime)[5]+1900, (localtime)[4]+1, (localtime)[3]
80 my @cached = grep /^\+/, `git diff --cached -U0`;
81 @cached > 0 or die "Please add:\n\n$ARGV[0] - $ymd\n\nto Changes stage Changes (git add Changes)";
82 @cached == 2 or die "Pre-commit Changes not just Changes line";
83 $cached[0] =~ /^\+\+\+ .\/Changes\n/ or die "Changes not changed";
84 $cached[1] eq "+$ARGV[0] - $ymd\n" or die "Changes new line should be: \n\n$ARGV[0] - $ymd\n ";
88 my ($self, %extra) = @_;
92 perl -IDistar/lib -MDistar -erun_preflight $(VERSION)
96 $(MAKE) $(DISTVNAME).tar$(SUFFIX)
97 git commit -a -m "Release commit for $(VERSION)"
98 git tag v$(VERSION) -m "release v$(VERSION)"
99 cpan-upload $(DISTVNAME).tar$(SUFFIX)
100 git push origin v$(VERSION) HEAD
102 readmefile: create_distdir
103 pod2text $(VERSION_FROM) >$(DISTVNAME)/README
104 $(NOECHO) cd $(DISTVNAME) && $(ABSPERLRUN) ../Distar/helpers/add-readme-to-manifest
106 if (open my $fh, '<', 'maint/Makefile.include') {
107 $post .= do { local $/; <$fh> };
110 # add on any extra args that WriteMakefile chose to pass us
111 # (note that Devel::Declare, and possibly others, use this)
112 $post .= "\n" . join('', %extra) if keys %extra;
118 no warnings 'redefine';
119 sub main::WriteMakefile {
121 ExtUtils::MakeMaker::WriteMakefile(
123 @_, AUTHOR => our $Author, ABSTRACT_FROM => $args{VERSION_FROM},
124 test => { TESTS => ($args{test}{TESTS}||'t/*.t').' xt/*.t' },
130 write_manifest_skip() unless $Ran_Preflight