]> Dogcows Code - chaz/p5-Dist-Zilla-PluginBundle-Author-CCM/blobdiff - lib/Dist/Zilla/PluginBundle/Author/CCM.pm
remove use of DZP::ReversionOnRelease
[chaz/p5-Dist-Zilla-PluginBundle-Author-CCM] / lib / Dist / Zilla / PluginBundle / Author / CCM.pm
index 3cdcea1d5e751a36035f4cc18b07acbcf37dee91..d1af73460fdbdffa3d0207fc250251c8138a6c31 100644 (file)
@@ -13,12 +13,6 @@ You probably don't want to use this.
 
     ; VERSION
     [Git::NextVersion]
-    [NextRelease]
-    [ReversionOnRelease]
-    prompt              = 1
-
-    [ExecDir]
-    [ExtraTests]
 
     ; GATHER
     [Git::GatherDir]
@@ -30,6 +24,7 @@ You probably don't want to use this.
 
     [CopyFilesFromBuild]
     copy                = LICENSE
+    [ExecDir]
 
     ; PREREQS
     [AutoPrereqs]
@@ -43,6 +38,8 @@ You probably don't want to use this.
     [PodSyntaxTests]
     [Test::Pod::No404s]
     [Test::Compile]
+    [Test::MinimumVersion]
+    max_target_perl     = 5.10.1
     [Test::EOL]
     [Test::NoTabs]
     [Test::Perl::Critic]
@@ -84,15 +81,16 @@ You probably don't want to use this.
     filename            = README
     location            = build
     type                = text
-    [TravisYML]
     [Manifest]
     [ManifestSkip]
 
     [MakeMaker]                 ; override with the "installer" attribute
 
     ; RELEASE
+    [NextRelease]
     [CheckChangesHasContent]
     [Git::Check]
+    [RunExtraTests]
     [TestRelease]
     [ConfirmRelease]
     [UploadToCPAN]              ; disable with the "no_upload" attribute
@@ -116,6 +114,7 @@ You probably don't want to use this.
 
 =cut
 
+use 5.014;
 use warnings;
 use strict;
 
@@ -123,8 +122,41 @@ our $VERSION = '999.999'; # VERSION
 
 use Dist::Zilla::Util;
 use Moose;
+use Perl::Version;
 use namespace::autoclean;
 
+=attr max_target_perl
+
+Specify the minimum perl version. Defaults to C<5.10.1>.
+
+=cut
+
+has max_target_perl => (
+    is      => 'ro',
+    isa     => 'Str',
+    lazy    => 1,
+    default => sub {
+        my $self = shift;
+        $self->payload->{'Test::MinimumVersion.max_target_perl'} // $self->payload->{max_target_perl} // '5.10.1';
+    },
+);
+
+=attr authority
+
+Specify the release authority. Defaults to C<cpan:CCM>.
+
+=cut
+
+has authority => (
+    is      => 'ro',
+    isa     => 'Str',
+    lazy    => 1,
+    default => sub {
+        my $self = shift;
+        $self->payload->{'Authority.authority'} // $self->payload->{authority} // 'cpan:CCM';
+    },
+);
+
 =attr installer
 
 Specify which installer to use, such as:
@@ -139,7 +171,7 @@ has installer => (
     is      => 'ro',
     isa     => 'Str',
     lazy    => 1,
-    default => sub { shift->payload->{installer} || 'MakeMaker' },
+    default => sub { shift->payload->{installer} // 'MakeMaker' },
 );
 
 =attr airplane
@@ -177,28 +209,24 @@ Required by L<Dist::Zilla::Role::PluginBundle::Easy>.
 sub configure {
     my $self = shift;
 
+    my @copy_from_build     = qw(LICENSE);
+    my @network_plugins     = qw(Git::Push Test::Pod::No404s UploadToCPAN);
+    my @gather_exclude      = (@copy_from_build, qw(README.md));
+    my @gather_prune        = qw(dist.ini);
+    my @no_index            = qw(eg share shares t xt);
+    my @allow_dirty         = (@copy_from_build, qw(Changes LICENSE README.md));
+    my @git_remotes         = qw(github origin);
+    my @check_files         = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
+    my $perl_version_target = $self->max_target_perl;
+
     if ($self->no_upload) {
-        print '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***', "\n";
+        say '[@Author::CCM] WARNING! WARNING! WARNING! *** You are in no_upload mode!! ***';
     }
 
-    my @copy_from_build = qw(LICENSE);
-    my @network_plugins = qw(Git::Push Test::Pod::No404s UploadToCPAN);
-    my @gather_exclude  = (@copy_from_build, qw(README.md));
-    my @gather_prune    = qw(dist.ini);
-    my @no_index        = qw(eg share shares t xt);
-    my @allow_dirty     = (@copy_from_build, qw(.travis.yml Changes LICENSE README.md));
-    my @git_remotes     = qw(github origin);
-    my @check_files     = qw(:InstallModules :ExecFiles :TestFiles :ExtraTestFiles);
-
     my @plugins = (
 
         # VERSION
         ['Git::NextVersion'],
-        ['NextRelease'],
-        ['ReversionOnRelease' => {prompt => 1}],
-
-        ['ExecDir'],
-        ['ExtraTests'],
 
         # GATHER
         ['Git::GatherDir' => {exclude_filename  => [@gather_exclude]}],
@@ -206,6 +234,7 @@ sub configure {
         ['PruneFiles' => {filename => [@gather_prune]}],
 
         ['CopyFilesFromBuild' => {copy => [@copy_from_build]}],
+        ['ExecDir'],
 
         # PREREQS
         ['AutoPrereqs'],
@@ -219,6 +248,7 @@ sub configure {
         ['PodSyntaxTests'],
         ['Test::Pod::No404s'],
         ['Test::Compile'],
+        ['Test::MinimumVersion' => {max_target_perl => $perl_version_target}],
         ['Test::EOL' => {finder => [@check_files]}],
         ['Test::NoTabs' => {finder => [@check_files]}],
         ['Test::Perl::Critic'],
@@ -227,7 +257,7 @@ sub configure {
         ['Test::ReportPrereqs'],
 
         # METADATA
-        ['Authority' => {do_munging => 0}],
+        ['Authority' => {authority => $self->authority, do_munging => 0}],
         ['MetaJSON'],
         ['MetaYAML'],
         ['MetaNoIndex' => {directory => [@no_index]}],
@@ -242,17 +272,18 @@ sub configure {
 
         # GENERATE FILES
         ['License'],
-        ['ReadmeAnyFromPod' => 'repo readme' => {filename => 'README.md', location => 'root', type => 'markdown', phase => 'release'}],
-        ['ReadmeAnyFromPod' => 'dist readme' => {filename => 'README', location => 'build', type => 'text'}],
-        ['TravisYML'],
+        ['ReadmeAnyFromPod' => 'RepoReadme' => {filename => 'README.md', location => 'root', type => 'markdown', phase => 'release'}],
+        ['ReadmeAnyFromPod' => 'DistReadme' => {filename => 'README', location => 'build', type => 'text'}],
         ['Manifest'],
         ['ManifestSkip'],
 
         $self->installer,     # e.g. MakeMaker
 
         # RELEASE
+        ['NextRelease'],
         ['CheckChangesHasContent'],
         ['Git::Check' => {allow_dirty => [@allow_dirty], untracked_files => 'ignore'}],
+        ['RunExtraTests'],
         ['TestRelease'],
         # ['ConfirmRelease'],
         $self->no_upload ? ['FakeRelease'] : ['UploadToCPAN'],
This page took 0.030002 seconds and 4 git commands to generate.