sub dist_test {
my $self = shift;
- my $dist_test = $self->SUPER::dist_test(@_);
- $dist_test .= <<"END";
+ my $include = '';
+ if (open my $fh, '<', 'maint/Makefile.include') {
+ $include = "\n# --- Makefile.include:\n\n" . do { local $/; <$fh> };
+ $include =~ s/\n?\z/\n/;
+ }
+
+ my @bump_targets =
+ grep { $include !~ /^bump$_(?: +\w+)*:/m } ('', 'minor', 'major');
-# --- Distar section:
+ my %vars = (
+ REMAKE => join(' ', '$(PERLRUN)', 'Makefile.PL', map { $self->quote_literal($_) } @ARGV),
+ BRANCH => $self->{BRANCH} ||= 'master',
+ );
-REMAKE = \$(PERLRUN) Makefile.PL @{[ map { $self->quote_literal($_) } @ARGV ]}
+ join('',
+ $self->SUPER::dist_test(@_),
+ "\n\n# --- Distar section:\n\n",
+ (map "$_ = $vars{$_}\n", sort keys %vars),
+ <<'END',
-END
- $dist_test .= <<'END';
preflight:
- $(ABSPERLRUN) Distar/helpers/preflight $(VERSION)
+ $(ABSPERLRUN) Distar/helpers/preflight $(VERSION) --branch=$(BRANCH)
releasetest:
- $(MAKE) disttest RELEASE_TESTING=1 TEST_FILES="$(TEST_FILES)"
+ $(MAKE) disttest RELEASE_TESTING=1 PASTHRU="$(PASTHRU) TEST_FILES=\"$(TEST_FILES)\""
release: preflight releasetest
$(RM_RF) $(DISTVNAME)
$(MAKE) $(DISTVNAME).tar$(SUFFIX)
distmanicheck: create_distdir
cd $(DISTVNAME) && $(ABSPERLRUN) "-MExtUtils::Manifest=manicheck" -e "exit manicheck"
nextrelease:
- $(ABSPERLRUN) Distar/helpers/add-changelog-heading $(VERSION) Changes
- GIT_DIFF_OPTS=-u`$(ABSPERLRUN) Distar/helpers/changelog-context $(VERSION) Changes` git add -p Changes
+ $(ABSPERLRUN) Distar/helpers/add-changelog-heading --git $(VERSION) Changes
refresh:
cd Distar && git pull
- rm Makefile
+ $(RM_F) $(FIRST_MAKEFILE)
$(REMAKE)
END
-
- my $include = '';
- if (open my $fh, '<', 'maint/Makefile.include') {
- $include = "\n# --- Makefile.include:\n" . do { local $/; <$fh> };
- }
-
- for my $type ('', 'minor', 'major') {
- if ($include !~ /^bump$type:/m) {
- my $arg = $type || '$(V)';
- $dist_test .= <<"END"
-bump$type:
- \$(ABSPERLRUN) Distar/helpers/bump-version --git \$(VERSION) $arg
- \$(RM_F) \$(FIRST_MAKEFILE)
- \$(REMAKE)
+ map(sprintf(<<'END', "bump$_", ($_ || '$(V)')), @bump_targets),
+%s:
+ $(ABSPERLRUN) Distar/helpers/bump-version --git $(VERSION) %s
+ $(RM_F) $(FIRST_MAKEFILE)
+ $(REMAKE)
END
- }
- }
-
- $dist_test .= $include . "\n";
-
- return $dist_test;
+ $include,
+ "\n",
+ );
}
}