package Distar;
-
use strict;
use warnings FATAL => 'all';
use base qw(Exporter);
}
sub write_manifest_skip {
+ my ($mm) = @_;
my @files = @Manifest;
my @parts;
while (my ($dir, $spec) = splice(@files, 0, 2)) {
: die "spec must be string or regexp, was: ${spec} (${\ref $spec})");
push @parts, $re;
}
- my $final = '^(?!'.join('|', map "${_}\$", @parts).')';
+ my $dist_name = $mm->{DISTNAME};
+ my $include = join '|', map "${_}\$", @parts;
+ my $final = "^(?:\Q$dist_name\E-v?[0-9_.]+/|(?!$include))";
open my $skip, '>', 'MANIFEST.SKIP'
or die "can't open MANIFEST.SKIP: $!";
print $skip "${final}\n";
LICENSE => 'perl_5',
MIN_PERL_VERSION => '5.006',
AUTHOR => ($MM_VER >= 6.5702 ? $Distar::Author : join(', ', @$Distar::Author)),
- %$args,
ABSTRACT_FROM => $args->{VERSION_FROM},
+ %$args,
test => { TESTS => ($args->{test}{TESTS}||'t/*.t').' xt/*.t xt/*/*.t' },
realclean => { FILES => (
($args->{realclean}{FILES}||'')
sub flush {
my $self = shift;
- Distar::write_manifest_skip();
+ Distar::write_manifest_skip($self);
$self->SUPER::flush(@_);
}
+ sub special_targets {
+ my $self = shift;
+ my $targets = $self->SUPER::special_targets(@_);
+ my $phony_targets = join ' ', qw(
+ preflight
+ releasetest
+ release
+ readmefile
+ distmanicheck
+ nextrelease
+ refresh
+ bump
+ bumpmajor
+ bumpminor
+ );
+ $targets =~ s/^(\.PHONY *:.*)/$1 $phony_targets/m;
+ $targets;
+ }
+
sub dist_test {
my $self = shift;
my $dist_test = $self->SUPER::dist_test(@_);
$dist_test .= <<'END';
preflight:
$(ABSPERLRUN) Distar/helpers/preflight $(VERSION)
-release: preflight
- $(MAKE) disttest
+releasetest:
+ $(MAKE) disttest RELEASE_TESTING=1 TEST_FILES="$(TEST_FILES)"
+release: preflight releasetest
$(RM_RF) $(DISTVNAME)
$(MAKE) $(DISTVNAME).tar$(SUFFIX)
git commit -a -m "Release commit for $(VERSION)"
cd $(DISTVNAME) && $(ABSPERLRUN) "-MExtUtils::Manifest=manicheck" -e "exit manicheck"
nextrelease:
$(ABSPERLRUN) Distar/helpers/add-changelog-heading $(VERSION) Changes
- git add -p Changes
+ GIT_DIFF_OPTS=-u`$(ABSPERLRUN) Distar/helpers/changelog-context $(VERSION) Changes` git add -p Changes
refresh:
cd Distar && git pull
- rm Makefile
+ $(RM_F) $(FIRST_MAKEFILE)
$(REMAKE)
END